mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
SRV_Channel: prepare for reboot at the HAL rc output level
ensures that the 0s get to the hardware significantly reduces the race conditions which might allow a thread to write after values are zeroed
This commit is contained in:
committed by
Peter Barker
parent
94800d5ae6
commit
94f7e038b0
@@ -603,6 +603,10 @@ public:
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
// called once a reboot has been commanded: stop driving the
|
||||
// outputs so the reset cannot truncate a pulse in flight
|
||||
static void prepare_for_reboot();
|
||||
|
||||
static void zero_rc_outputs();
|
||||
|
||||
// initialize before any call to push
|
||||
|
||||
@@ -548,6 +548,12 @@ void SRV_Channels::push()
|
||||
#endif // HAL_ENABLE_DRONECAN_DRIVERS
|
||||
}
|
||||
|
||||
void SRV_Channels::prepare_for_reboot()
|
||||
{
|
||||
hal.rcout->prepare_for_reboot();
|
||||
}
|
||||
|
||||
|
||||
void SRV_Channels::zero_rc_outputs()
|
||||
{
|
||||
/* Send an invalid signal to the motors to prevent spinning due to
|
||||
|
||||
Reference in New Issue
Block a user