From 8af9796b1642189f590520062b1a00e965d5985e Mon Sep 17 00:00:00 2001 From: Tweako Date: Wed, 16 Sep 2020 10:29:33 +0200 Subject: [PATCH] stm32/led: Support PWM output without TIM3. For example, the STM32WB55 doesn't have TIM3 but can still drive LEDs using PWM on other timers. --- ports/stm32/led.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm32/led.c b/ports/stm32/led.c index 9231718846..adcb240cc0 100644 --- a/ports/stm32/led.c +++ b/ports/stm32/led.c @@ -141,9 +141,11 @@ STATIC void led_pwm_init(int led) { case 2: __TIM2_CLK_ENABLE(); break; + #if defined(TIM3) case 3: __TIM3_CLK_ENABLE(); break; + #endif default: assert(0); }