AP_HAL_ChibiOS: exclude more code based on HAL_WITH_IO_MCU

This commit is contained in:
Peter Barker 2023-02-08 12:54:58 +11:00 committed by Peter Barker
parent c0b0ae44d5
commit 0b127e0437
2 changed files with 6 additions and 0 deletions

View File

@ -176,11 +176,15 @@ void RCInput::_timer_tick(void)
}
#endif
#if HAL_WITH_IO_MCU
uint32_t now = AP_HAL::millis();
const bool have_iocmu_rc = (_rcin_last_iomcu_ms != 0 && now - _rcin_last_iomcu_ms < 400);
if (!have_iocmu_rc) {
_rcin_last_iomcu_ms = 0;
}
#else
const bool have_iocmu_rc = false;
#endif
if (rcprot.new_input() && !have_iocmu_rc) {
WITH_SEMAPHORE(rcin_mutex);

View File

@ -69,7 +69,9 @@ private:
int16_t _rssi = -1;
int16_t _rx_link_quality = -1;
uint32_t _rcin_timestamp_last_signal;
#if HAL_WITH_IO_MCU
uint32_t _rcin_last_iomcu_ms;
#endif
bool _init;
const char *last_protocol;