mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 10:53:33 +08:00
tap_esc: reset outputs only when armed really changed (not on each topic update)
This commit is contained in:
@@ -754,13 +754,15 @@ TAP_ESC::cycle()
|
|||||||
|
|
||||||
if (updated) {
|
if (updated) {
|
||||||
orb_copy(ORB_ID(actuator_armed), _armed_sub, &_armed);
|
orb_copy(ORB_ID(actuator_armed), _armed_sub, &_armed);
|
||||||
|
if (_is_armed != _armed.armed) {
|
||||||
|
/* reset all outputs */
|
||||||
|
for (size_t i = 0; i < sizeof(_outputs.output) / sizeof(_outputs.output[0]); i++) {
|
||||||
|
_outputs.output[i] = NAN;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* do not obey the lockdown value, as lockdown is for PWMSim */
|
/* do not obey the lockdown value, as lockdown is for PWMSim */
|
||||||
_is_armed = _armed.armed;
|
_is_armed = _armed.armed;
|
||||||
|
|
||||||
/* reset all outputs */
|
|
||||||
for (size_t i = 0; i < sizeof(_outputs.output) / sizeof(_outputs.output[0]); i++) {
|
|
||||||
_outputs.output[i] = NAN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user