From 776d5e6ba3b7dacc6c6c4dd53aa6854f25f79592 Mon Sep 17 00:00:00 2001 From: Alexander Malishev Date: Mon, 30 Apr 2018 22:41:55 +0400 Subject: [PATCH] HAL_ChibiOS: Fixed s-bus signal polarity in SoftSigReaderInt.cpp --- libraries/AP_HAL_ChibiOS/SoftSigReaderInt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/SoftSigReaderInt.cpp b/libraries/AP_HAL_ChibiOS/SoftSigReaderInt.cpp index a93ddd8044..916dc62230 100644 --- a/libraries/AP_HAL_ChibiOS/SoftSigReaderInt.cpp +++ b/libraries/AP_HAL_ChibiOS/SoftSigReaderInt.cpp @@ -45,7 +45,11 @@ void SoftSigReaderInt::init(EICUDriver* icu_drv, eicuchannel_t chan) icucfg.iccfgp[i]=nullptr; } icucfg.iccfgp[chan] = &channel_config; +#ifdef HAL_RCIN_IS_INVERTED channel_config.alvl = EICU_INPUT_ACTIVE_HIGH; +#else + channel_config.alvl = EICU_INPUT_ACTIVE_LOW; +#endif channel_config.capture_cb = _irq_handler; eicuStart(_icu_drv, &icucfg); //sets input filtering to 4 timer clock