mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
STM32F303 - Skip UART3 pins in PWM mapping when UART3 is used.
This commit is contained in:
parent
6f2b4f17f8
commit
c0aec95e14
3 changed files with 12 additions and 0 deletions
|
@ -375,6 +375,12 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
|
|||
continue;
|
||||
#endif
|
||||
|
||||
#ifdef STM32F303xC
|
||||
// skip UART3 ports (PB10/PB11)
|
||||
if (init->useUART3 && timerHardwarePtr->gpio == UART3_GPIO && (timerHardwarePtr->pin == UART3_TX_PIN || timerHardwarePtr->pin == UART3_RX_PIN))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
#ifdef SOFTSERIAL_1_TIMER
|
||||
if (init->useSoftSerial && timerHardwarePtr->tim == SOFTSERIAL_1_TIMER)
|
||||
continue;
|
||||
|
|
|
@ -44,6 +44,9 @@ typedef struct drv_pwm_config_t {
|
|||
bool useCurrentMeterADC;
|
||||
#ifdef STM32F10X
|
||||
bool useUART2;
|
||||
#endif
|
||||
#ifdef STM32F303xC
|
||||
bool useUART3;
|
||||
#endif
|
||||
bool useVbat;
|
||||
bool useOneshot;
|
||||
|
|
|
@ -200,6 +200,9 @@ void init(void)
|
|||
pwm_params.airplane = false;
|
||||
#if defined(USE_USART2) && defined(STM32F10X)
|
||||
pwm_params.useUART2 = doesConfigurationUsePort(SERIAL_PORT_USART2);
|
||||
#endif
|
||||
#ifdef STM32F303xC
|
||||
pwm_params.useUART3 = doesConfigurationUsePort(SERIAL_PORT_USART3);
|
||||
#endif
|
||||
pwm_params.useVbat = feature(FEATURE_VBAT);
|
||||
pwm_params.useSoftSerial = feature(FEATURE_SOFTSERIAL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue