mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-29 11:44:06 +08:00
tap_esc: reset outputs only when armed really changed (not on each topic update)
This commit is contained in:
parent
4045068187
commit
c55c978145
@ -754,13 +754,15 @@ TAP_ESC::cycle()
|
||||
|
||||
if (updated) {
|
||||
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 */
|
||||
_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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user