Skip to content

Commit

Permalink
msp: also reboot on MSP_REBOOT_BOOTLOADER_FLASH
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Aug 8, 2024
1 parent 2e3e09d commit e912b8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/io/msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,19 @@ static void msp_process_serial_cmd(msp_t *msp, msp_magic_t magic, uint16_t cmd,

case MSP_REBOOT: {
if (flags.arm_state) {
msp_send_error(msp, magic, cmd);
break;
}

msp_send_reply(msp, magic, cmd, payload, 1);
time_delay_ms(100);

switch (payload[0]) {
case MSP_REBOOT_FIRMWARE:
system_reset();
break;

case MSP_REBOOT_BOOTLOADER_FLASH:
case MSP_REBOOT_BOOTLOADER_ROM:
system_reset_to_bootloader();
break;
Expand Down

0 comments on commit e912b8c

Please sign in to comment.