diff --git a/libraries/AP_HAL_SITL/RCOutput.cpp b/libraries/AP_HAL_SITL/RCOutput.cpp index b1df8706a1..616d6a27c0 100644 --- a/libraries/AP_HAL_SITL/RCOutput.cpp +++ b/libraries/AP_HAL_SITL/RCOutput.cpp @@ -35,7 +35,7 @@ void RCOutput::enable_ch(uint8_t ch) if (!(_enable_mask & (1U << ch))) { Debug("enable_ch(%u)\n", ch); } - _enable_mask |= 1U << ch; + _enable_mask |= (1U << ch); } void RCOutput::disable_ch(uint8_t ch) @@ -43,13 +43,14 @@ void RCOutput::disable_ch(uint8_t ch) if (_enable_mask & (1U << ch)) { Debug("disable_ch(%u)\n", ch); } - _enable_mask &= ~1U << ch; + _enable_mask &= ~(1U << ch); } void RCOutput::write(uint8_t ch, uint16_t period_us) { _sitlState->output_ready = true; - if (ch < SITL_NUM_CHANNELS && (_enable_mask & (1U<pwm_output[ch]; } return 0;