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:
Daniel Agar
2020-05-06 13:53:54 -04:00
parent 45ebbb895a
commit 746a8f5cf9
96 changed files with 332 additions and 528 deletions
+2 -2
View File
@@ -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;