1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

SPRacingF3 - Allow Sonar and Parallel PWM (drops 2 input channels).

Naze32 - Fix initialisation of outputs 5/6 when Parallel PWM and
Sonar are used together with a mixer that needs more than 4 motors.
This commit is contained in:
Dominic Clifton 2015-05-06 21:28:25 +01:00
parent c0aec95e14
commit b04be157b1
4 changed files with 29 additions and 6 deletions

View file

@ -381,6 +381,29 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
continue;
#endif
#ifdef SONAR
// skip Sonar pins
// FIXME - Hack - See sonar.c sonarInit() and sonarHardware_t
if (init->useSonar && timerHardwarePtr->gpio == GPIOB) {
#if defined(SPRACINGF3) || defined(OLIMEXINO)
if (timerHardwarePtr->pin == GPIO_Pin_0 || timerHardwarePtr->pin == GPIO_Pin_1) {
continue;
}
#endif
#if defined(NAZE)
if (init->useParallelPWM) {
if (timerHardwarePtr->pin == GPIO_Pin_8 || timerHardwarePtr->pin == GPIO_Pin_9) {
continue;
}
} else {
if (timerHardwarePtr->pin == GPIO_Pin_0 || timerHardwarePtr->pin == GPIO_Pin_1) {
continue;
}
}
#endif
}
#endif
#ifdef SOFTSERIAL_1_TIMER
if (init->useSoftSerial && timerHardwarePtr->tim == SOFTSERIAL_1_TIMER)
continue;