shell: flash: add command to release the current flash device
This commit is contained in:
parent
2bae987d27
commit
d709c44fa4
1 changed files with 13 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
#include <shell.h>
|
#include <shell.h>
|
||||||
|
|
||||||
static void do_flash_probe(const char *s);
|
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_info(const char *s);
|
||||||
static void do_flash_read(const char *s);
|
static void do_flash_read(const char *s);
|
||||||
static void do_flash_write(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[] = {
|
static struct cmd flash_cmds[] = {
|
||||||
{ "probe", do_flash_probe },
|
{ "probe", do_flash_probe },
|
||||||
|
{ "release", do_flash_release },
|
||||||
{ "info", do_flash_info },
|
{ "info", do_flash_info },
|
||||||
{ "read", do_flash_read },
|
{ "read", do_flash_read },
|
||||||
{ "write", do_flash_write },
|
{ "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)
|
static void do_flash_info(const char *s)
|
||||||
{
|
{
|
||||||
size_t size, capacity;
|
size_t size, capacity;
|
||||||
|
|
Loading…
Add table
Reference in a new issue