1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

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

not have a dependency on config.c.
This commit is contained in:
Dominic Clifton 2014-12-06 11:39:31 +00:00
parent d7e26980a8
commit e802e2d032
7 changed files with 42 additions and 41 deletions

View file

@ -370,7 +370,9 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
pwmInConfig(timerHardwarePtr, channelIndex);
channelIndex++;
} else if (type == MAP_TO_MOTOR_OUTPUT) {
if (init->motorPwmRate > 500) {
if (init->useOneshot) {
pwmOneshotMotorConfig(timerHardwarePtr, pwmOutputConfiguration.motorCount, init->idlePulse);
} else if (init->motorPwmRate > 500) {
pwmBrushedMotorConfig(timerHardwarePtr, pwmOutputConfiguration.motorCount, init->motorPwmRate, init->idlePulse);
} else {
pwmBrushlessMotorConfig(timerHardwarePtr, pwmOutputConfiguration.motorCount, init->motorPwmRate, init->idlePulse);