diff --git a/src/main/drivers/pwm_rx.c b/src/main/drivers/pwm_rx.c index 2adaa8af6..ed52ecaec 100644 --- a/src/main/drivers/pwm_rx.c +++ b/src/main/drivers/pwm_rx.c @@ -103,7 +103,6 @@ typedef struct ppmDevice_s { ppmDevice_t ppmDev; - #define PPM_IN_MIN_SYNC_PULSE_US 2700 // microseconds #define PPM_IN_MIN_CHANNEL_PULSE_US 750 // microseconds #define PPM_IN_MAX_CHANNEL_PULSE_US 2250 // microseconds @@ -111,7 +110,6 @@ ppmDevice_t ppmDev; #define PPM_IN_MIN_NUM_CHANNELS 4 #define PPM_IN_MAX_NUM_CHANNELS PWM_PORTS_OR_PPM_CAPTURE_COUNT - bool isPPMDataBeingReceived(void) { return (ppmFrameCount != lastPPMFrameCount); @@ -364,17 +362,15 @@ void pwmICConfig(TIM_TypeDef *tim, uint8_t channel, uint16_t polarity) TIM_ICInit(tim, &TIM_ICInitStructure); } - #endif - void pwmRxInit(const pwmConfig_t *pwmConfig) { for (int channel = 0; channel < PWM_INPUT_PORT_COUNT; channel++) { pwmInputPort_t *port = &pwmInputPorts[channel]; - const timerHardware_t *timer = timerGetByTag(pwmConfig->ioTags[channel], TIM_USE_PWM); + const timerHardware_t *timer = timerGetByTag(pwmConfig->ioTags[channel], TIM_USE_ANY); if (!timer) { /* TODO: maybe fail here if not enough channels? */ @@ -444,7 +440,7 @@ void ppmRxInit(const ppmConfig_t *ppmConfig, uint8_t pwmProtocol) pwmInputPort_t *port = &pwmInputPorts[FIRST_PWM_PORT]; - const timerHardware_t *timer = timerGetByTag(ppmConfig->ioTag, TIM_USE_PPM); + const timerHardware_t *timer = timerGetByTag(ppmConfig->ioTag, TIM_USE_ANY); if (!timer) { /* TODO: fail here? */ return;