mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Allow excluding of servo code at compilation time.
This is in preparation for backbox on CJMCU/64k. Flight tested on CJMCU.
This commit is contained in:
parent
5a15c3b271
commit
9057d70410
26 changed files with 131 additions and 48 deletions
|
@ -419,6 +419,7 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
|
|||
if (type == MAP_TO_PPM_INPUT && !init->usePPM)
|
||||
continue;
|
||||
|
||||
#ifdef USE_SERVOS
|
||||
if (init->useServos && !init->airplane) {
|
||||
#if defined(NAZE)
|
||||
// remap PWM9+10 as servos
|
||||
|
@ -455,6 +456,7 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
|
|||
if (timerIndex >= PWM5 && timerIndex <= PWM8)
|
||||
type = MAP_TO_SERVO_OUTPUT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CC3D
|
||||
if (init->useParallelPWM) {
|
||||
|
@ -489,8 +491,10 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
|
|||
}
|
||||
pwmOutputConfiguration.motorCount++;
|
||||
} else if (type == MAP_TO_SERVO_OUTPUT) {
|
||||
#ifdef USE_SERVOS
|
||||
pwmServoConfig(timerHardwarePtr, pwmOutputConfiguration.servoCount, init->servoPwmRate, init->servoCenterPulse);
|
||||
pwmOutputConfiguration.servoCount++;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue