1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

shell_commands: provide command to reboot to bootloader

Make the triggering of the bootloader available as a shell command.
This commit is contained in:
Benjamin Valentin 2020-06-03 16:10:31 +02:00
parent bf0317cd1f
commit 036d2e2d81
2 changed files with 21 additions and 0 deletions

View File

@ -32,6 +32,20 @@ int _reboot_handler(int argc, char **argv)
return 0;
}
#ifdef MODULE_USB_BOARD_RESET
void usb_board_reset_in_bootloader(void);
int _bootloader_handler(int argc, char **argv)
{
(void) argc;
(void) argv;
usb_board_reset_in_bootloader();
return 0;
}
#endif
int _version_handler(int argc, char **argv)
{
(void) argc;

View File

@ -175,9 +175,16 @@ extern int _suit_handler(int argc, char **argv);
extern int _cryptoauth(int argc, char **argv);
#endif
#ifdef MODULE_USB_BOARD_RESET
extern int _bootloader_handler(int argc, char **argv);
#endif
const shell_command_t _shell_command_list[] = {
{"reboot", "Reboot the node", _reboot_handler},
{"version", "Prints current RIOT_VERSION", _version_handler},
#ifdef MODULE_USB_BOARD_RESET
{"bootloader", "Reboot to bootloader", _bootloader_handler},
#endif
#ifdef MODULE_CONFIG
{"id", "Gets or sets the node's id.", _id_handler},
#endif