Rover: support reboot to bootloader

This commit is contained in:
Andrew Tridgell 2013-09-04 11:58:41 +10:00
parent 7082e0f8aa
commit 1ca1b1e36e
2 changed files with 4 additions and 12 deletions

View File

@ -1068,8 +1068,9 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
break;
case MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN:
if (packet.param1 == 1) {
reboot_apm();
if (packet.param1 == 1 || packet.param1 == 3) {
// when packet.param1 == 3 we reboot to hold in bootloader
hal.scheduler->reboot(packet.param1 == 3);
result = MAV_RESULT_ACCEPTED;
}
break;

View File

@ -45,7 +45,7 @@ MENU(main_menu, THISFIRMWARE, main_menu_commands);
static int8_t reboot_board(uint8_t argc, const Menu::arg *argv)
{
reboot_apm();
hal.scheduler->reboot(false);
return 0;
}
@ -513,15 +513,6 @@ print_mode(AP_HAL::BetterStream *port, uint8_t mode)
}
}
/*
force a software reset of the APM
*/
static void reboot_apm(void)
{
hal.scheduler->reboot();
while (1);
}
/*
check a digitial pin for high,low (1/0)
*/