AP_IOMCU: respond to override change more quickly

This commit is contained in:
Andrew Tridgell 2018-11-06 12:02:55 +11:00
parent 8d8853d4b7
commit 8e7695e5f0

View File

@ -300,6 +300,8 @@ void AP_IOMCU_FW::rcin_update()
hal.rcout->set_default_rate(reg_setup.pwm_defaultrate); hal.rcout->set_default_rate(reg_setup.pwm_defaultrate);
} }
bool old_override = override_active;
// check for active override channel // check for active override channel
if (mixing.enabled && if (mixing.enabled &&
mixing.rc_chan_override > 0 && mixing.rc_chan_override > 0 &&
@ -309,6 +311,12 @@ void AP_IOMCU_FW::rcin_update()
} else { } else {
override_active = false; override_active = false;
} }
if (old_override != override_active) {
if (override_active) {
fill_failsafe_pwm();
}
chEvtSignal(thread_ctx, EVENT_MASK(IOEVENT_PWM));
}
} }
void AP_IOMCU_FW::process_io_packet() void AP_IOMCU_FW::process_io_packet()