Skip to content

Commit 8af9796

Browse files
Tweakodpgeorge
authored andcommitted
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.
1 parent 9d1983f commit 8af9796

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ports/stm32/led.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ STATIC void led_pwm_init(int led) {
141141
case 2:
142142
__TIM2_CLK_ENABLE();
143143
break;
144+
#if defined(TIM3)
144145
case 3:
145146
__TIM3_CLK_ENABLE();
146147
break;
148+
#endif
147149
default:
148150
assert(0);
149151
}

0 commit comments

Comments
 (0)