diff --git a/libraries/AP_HAL_Linux/RCOutput_AeroIO.cpp b/libraries/AP_HAL_Linux/RCOutput_AeroIO.cpp index ac0fb904da..fc25f36570 100644 --- a/libraries/AP_HAL_Linux/RCOutput_AeroIO.cpp +++ b/libraries/AP_HAL_Linux/RCOutput_AeroIO.cpp @@ -132,6 +132,7 @@ void RCOutput_AeroIO::set_freq(uint32_t chmask, uint16_t freq_hz) } if (!_corking) { + _corking = true; push(); } } @@ -150,6 +151,7 @@ void RCOutput_AeroIO::enable_ch(uint8_t ch) return; } _pending_duty_write_mask |= (1U << ch); + _corking = true; push(); } @@ -160,6 +162,7 @@ void RCOutput_AeroIO::disable_ch(uint8_t ch) } _duty_buffer[ch] = 0; _pending_duty_write_mask |= (1U << ch); + _corking = true; push(); } @@ -169,6 +172,7 @@ void RCOutput_AeroIO::write(uint8_t ch, uint16_t period_us) _duty_buffer[ch] = period_us; if (!_corking) { + _corking = true; push(); } } @@ -180,6 +184,9 @@ void RCOutput_AeroIO::cork() void RCOutput_AeroIO::push() { + if (!_corking) { + return; + } _corking = false; for (uint8_t i = 0; i < PWM_CHAN_COUNT; i++) { diff --git a/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp b/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp index 0c1253a46f..126cc05c61 100644 --- a/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp +++ b/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp @@ -142,6 +142,9 @@ void RCOutput_AioPRU::cork(void) void RCOutput_AioPRU::push(void) { + if (!corked) { + return; + } corked = false; for (uint8_t i=0; iset_duty_cycle(usec_to_nsec(_pending[i])); diff --git a/libraries/AP_HAL_Linux/RCOutput_ZYNQ.cpp b/libraries/AP_HAL_Linux/RCOutput_ZYNQ.cpp index f37a761df6..a9d1d20b05 100644 --- a/libraries/AP_HAL_Linux/RCOutput_ZYNQ.cpp +++ b/libraries/AP_HAL_Linux/RCOutput_ZYNQ.cpp @@ -119,6 +119,9 @@ void RCOutput_ZYNQ::cork(void) void RCOutput_ZYNQ::push(void) { + if (!corked) { + return; + } corked = false; for (uint8_t i=0; i