mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
apps/fastboot: add switchboot command
The switchboot command can be sent even without enabling sh Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
parent
63c1767d33
commit
9633580d2c
1 changed files with 22 additions and 0 deletions
|
|
@ -226,6 +226,10 @@ static void fastboot_filedump(FAR struct fastboot_ctx_s *ctx,
|
|||
static void fastboot_shell(FAR struct fastboot_ctx_s *ctx,
|
||||
FAR const char *arg);
|
||||
#endif
|
||||
#ifdef CONFIG_BOARDCTL_SWITCH_BOOT
|
||||
static void fastboot_switchboot(FAR struct fastboot_ctx_s *context,
|
||||
FAR const char *arg);
|
||||
#endif
|
||||
|
||||
/* USB transport */
|
||||
|
||||
|
|
@ -272,6 +276,9 @@ static const struct fastboot_cmd_s g_oem_cmd[] =
|
|||
#ifdef CONFIG_SYSTEM_FASTBOOTD_SHELL
|
||||
{ "shell", fastboot_shell },
|
||||
#endif
|
||||
#ifdef CONFIG_BOARDCTL_SWITCH_BOOT
|
||||
{ "switchboot", fastboot_switchboot },
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_BOARD_MEMORY_RANGE
|
||||
|
|
@ -930,6 +937,21 @@ static void fastboot_shell(FAR struct fastboot_ctx_s *ctx,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_SWITCH_BOOT
|
||||
static void fastboot_switchboot(FAR struct fastboot_ctx_s *context,
|
||||
FAR const char *arg)
|
||||
{
|
||||
if (!arg)
|
||||
{
|
||||
fastboot_fail(context, "Invalid argument");
|
||||
return;
|
||||
}
|
||||
|
||||
boardctl(BOARDIOC_SWITCH_BOOT, (uintptr_t)&arg[0]);
|
||||
fastboot_okay(context, "");
|
||||
}
|
||||
#endif
|
||||
|
||||
static void fastboot_upload(FAR struct fastboot_ctx_s *ctx,
|
||||
FAR const char *arg)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue