1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Remove usage of feature() from rx driver code so that driver code does

not have a dependency on config.c.
This commit is contained in:
Dominic Clifton 2014-12-06 14:33:43 +00:00
parent 7356863939
commit 0b92f74b80
3 changed files with 14 additions and 7 deletions

View file

@ -24,7 +24,6 @@
#include "build_config.h"
#include "common/utils.h"
#include "config/config.h"
#include "system.h"
@ -317,6 +316,13 @@ void pwmInConfig(const timerHardware_t *timerHardwarePtr, uint8_t channel)
#define UNUSED_PPM_TIMER_REFERENCE 0
#define FIRST_PWM_PORT 0
void ppmAvoidPWMTimerClash(const timerHardware_t *timerHardwarePtr, TIM_TypeDef *sharedPwmTimer)
{
if (timerHardwarePtr->tim == sharedPwmTimer) {
ppmCountShift = 3; // Divide by 8 if the timer is running at 8 MHz
}
}
void ppmInConfig(const timerHardware_t *timerHardwarePtr)
{
ppmInit();
@ -331,11 +337,6 @@ void ppmInConfig(const timerHardware_t *timerHardwarePtr)
timerConfigure(timerHardwarePtr, (uint16_t)PPM_TIMER_PERIOD, PWM_TIMER_MHZ);
if((timerHardwarePtr->tim == TIM4) && (feature(FEATURE_ONESHOT125))){
ppmCountShift = 3; // Divide by 8 if the timer is running at 8 MHz
}
timerChCCHandlerInit(&self->edgeCb, ppmEdgeCallback);
timerChOvrHandlerInit(&self->overflowCb, ppmOverflowCallback);
timerChConfigCallbacks(timerHardwarePtr, &self->edgeCb, &self->overflowCb);