shell: flash: add command to release the current flash device

tags/0.1.0
S.J.R. van Schaik 7 years ago
parent 2bae987d27
commit d709c44fa4
  1. 13
      source/shell/flash.c

@ -12,6 +12,7 @@
#include <shell.h>
static void do_flash_probe(const char *s);
static void do_flash_release(const char *s);
static void do_flash_info(const char *s);
static void do_flash_read(const char *s);
static void do_flash_write(const char *s);
@ -19,6 +20,7 @@ static void do_flash_erase(const char *s);
static struct cmd flash_cmds[] = {
{ "probe", do_flash_probe },
{ "release", do_flash_release },
{ "info", do_flash_info },
{ "read", do_flash_read },
{ "write", do_flash_write },
@ -110,6 +112,17 @@ static void do_flash_probe(const char *s)
}
}
static void do_flash_release(const char *s)
{
(void)s;
if (!flash)
return;
flash_release(flash);
flash = NULL;
}
static void do_flash_info(const char *s)
{
size_t size, capacity;

Loading…
Cancel
Save