mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 22:18:29 -04:00
GCS_MAVLink: do not process commands after we have decided to reboot
This commit is contained in:
parent
d24a3d7a66
commit
21ae7d8153
@ -2551,8 +2551,13 @@ MAV_RESULT GCS_MAVLINK::handle_preflight_reboot(const mavlink_command_long_t &pa
|
|||||||
// flush pending parameter writes
|
// flush pending parameter writes
|
||||||
AP_Param::flush();
|
AP_Param::flush();
|
||||||
|
|
||||||
|
// do not process incoming mavlink messages while we delay:
|
||||||
|
hal.scheduler->register_delay_callback(nullptr, 5);
|
||||||
|
|
||||||
|
// delay to give the ACK a chance to get out, the LEDs to flash,
|
||||||
|
// the IO board safety to be forced on, the parameters to flush, ...
|
||||||
hal.scheduler->delay(200);
|
hal.scheduler->delay(200);
|
||||||
|
|
||||||
// when packet.param1 == 3 we reboot to hold in bootloader
|
// when packet.param1 == 3 we reboot to hold in bootloader
|
||||||
const bool hold_in_bootloader = is_equal(packet.param1, 3.0f);
|
const bool hold_in_bootloader = is_equal(packet.param1, 3.0f);
|
||||||
hal.scheduler->reboot(hold_in_bootloader);
|
hal.scheduler->reboot(hold_in_bootloader);
|
||||||
|
Loading…
Reference in New Issue
Block a user