mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 20:03:35 +08:00
commander: reboot/shutdown usability fixes
- always check with state machine before reboot/shutdown - respect BOARD_HAS_POWER_CONTROL (shutdown from command, low battery, power button) - px4_shutdown_request add optional delay and always execute from HPWORK - px4_shutdown_request split out px4_reboot_request
This commit is contained in:
@@ -223,7 +223,7 @@ void UavcanNode::busevent_signal_trampoline()
|
||||
|
||||
static void cb_reboot(const uavcan::TimerEvent &)
|
||||
{
|
||||
px4_systemreset(false);
|
||||
board_reset(0);
|
||||
}
|
||||
|
||||
void UavcanNode::cb_beginfirmware_update(const uavcan::ReceivedDataStructure<UavcanNode::BeginFirmwareUpdate::Request>
|
||||
@@ -276,7 +276,7 @@ class RestartRequestHandler: public uavcan::IRestartRequestHandler
|
||||
{
|
||||
PX4_INFO("UAVCAN: Restarting by request from %i\n", int(request_source.get()));
|
||||
usleep(20 * 1000 * 1000);
|
||||
px4_systemreset(false);
|
||||
board_reset(0);
|
||||
return true; // Will never be executed BTW
|
||||
}
|
||||
} restart_request_handler;
|
||||
|
||||
Reference in New Issue
Block a user