summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTweako <tweako@live.nl>2020-09-16 10:29:33 +0200
committerDamien George <damien@micropython.org>2020-09-18 18:37:11 +1000
commit8af9796b1642189f590520062b1a00e965d5985e (patch)
tree514aa9ac0a40afd572230d9caa84fd0d772138b8
parent9d1983f078150b0f1da7bfb2e55c0ac823c328b6 (diff)
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.
-rw-r--r--ports/stm32/led.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/stm32/led.c b/ports/stm32/led.c
index 923171884..adcb240cc 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);
}