From 75f345502923f490f277b5d098973bdfb5df7d86 Mon Sep 17 00:00:00 2001 From: MrScothh <167884257+MrScothh@users.noreply.github.com> Date: Thu, 8 Oct 2026 13:03:29 +0200 Subject: [PATCH] pwm_mapping: a timer output on UART1's pins is skipped when UART1 has a function besides MSP checkPwmTimerConflicts() kept outputs off the pins of UART2 to UART8 but not UART1. On NEXUSX and VANTAC_RF007 the pads labelled AUX and SBUS are both UART1 and two timer outputs, and SPRACINGF7DUAL has the same on PWM 3 and 4: with a receiver on UART1, a motor or servo could be assigned to the receiver's pin and drive nothing once the receiver took it back. UART1 gets MSP by default next to the VCP, and MSP opens before the outputs and has always given them these pins, so MSP alone still does; any other function on UART1 now keeps them, as on UART2 to UART8. --- src/main/drivers/pwm_mapping.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/drivers/pwm_mapping.c b/src/main/drivers/pwm_mapping.c index 06cdf5ea279..15bc4787761 100644 --- a/src/main/drivers/pwm_mapping.c +++ b/src/main/drivers/pwm_mapping.c @@ -97,6 +97,15 @@ static bool checkPwmTimerConflicts(const timerHardware_t *timHw) { serialPortPins_t uartPins; +#if defined(USE_UART1) + // MSP is UART1's default next to the VCP and has always given these pins up to the outputs + const serialPortConfig_t *uart1Config = serialFindPortConfiguration(SERIAL_PORT_USART1); + uartGetPortPins(UARTDEV_1, &uartPins); + if (uart1Config && (uart1Config->functionMask & ~FUNCTION_MSP) && (timHw->tag == uartPins.txPin || timHw->tag == uartPins.rxPin)) { + return true; + } +#endif + #if defined(USE_UART2) uartGetPortPins(UARTDEV_2, &uartPins); if (doesConfigurationUsePort(SERIAL_PORT_USART2) && (timHw->tag == uartPins.txPin || timHw->tag == uartPins.rxPin)) {