mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Cleanup Softserial/LedStrip timer clash checking. Move definitions of
led strip timer and softserial pwm ports/timers into target specific files.
This commit is contained in:
parent
f9f6b05aac
commit
2d8f65448d
12 changed files with 64 additions and 60 deletions
|
@ -283,43 +283,15 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
|
|||
continue;
|
||||
#endif
|
||||
|
||||
#ifdef CC3D
|
||||
// skip SoftSerial port
|
||||
if (init->useSoftSerial && (timerIndex == PWM3 || timerIndex == PWM4))
|
||||
continue;
|
||||
else
|
||||
#ifdef STM32F10X
|
||||
// skip softSerial ports
|
||||
if (init->useSoftSerial && (timerIndex == PWM5 || timerIndex == PWM6 || timerIndex == PWM7 || timerIndex == PWM8))
|
||||
#ifdef SOFTSERIAL1_TIMER
|
||||
if (init->useSoftSerial && timerHardwarePtr->tim == SOFTSERIAL1_TIMER)
|
||||
continue;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CHEBUZZF3
|
||||
// skip softSerial ports
|
||||
// PWM4 can no-longer be used since it uses the same timer as PWM5 and PWM6
|
||||
if (init->useSoftSerial && (timerIndex == PWM4 || timerIndex == PWM5 || timerIndex == PWM6 || timerIndex == PWM7 || timerIndex == PWM8))
|
||||
#ifdef SOFTSERIAL2_TIMER
|
||||
if (init->useSoftSerial && timerHardwarePtr->tim == SOFTSERIAL2_TIMER)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
#if defined(STM32F3DISCOVERY) && !defined(CHEBUZZF3)
|
||||
// skip softSerial ports
|
||||
if (init->useSoftSerial && (timerIndex == PWM9 || timerIndex == PWM10 || timerIndex == PWM11 || timerIndex == PWM12))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
#if defined(STM32F10X) && !defined(CC3D)
|
||||
#define LED_STRIP_TIMER TIM3
|
||||
#endif
|
||||
|
||||
#if defined(CC3D)
|
||||
#define LED_STRIP_TIMER TIM3
|
||||
#endif
|
||||
|
||||
#if defined(STM32F303)
|
||||
#define LED_STRIP_TIMER TIM16
|
||||
#endif
|
||||
|
||||
#ifdef LED_STRIP_TIMER
|
||||
// skip LED Strip output
|
||||
if (init->useLEDStrip && timerHardwarePtr->tim == LED_STRIP_TIMER)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue