From e6d18af3ad2c69a625fd5aca7f078ccfbcd80d96 Mon Sep 17 00:00:00 2001 From: Jue Date: Thu, 27 Oct 2022 23:50:07 +0200 Subject: [PATCH] cpu/efm32/timer_series2: fix timer_start() interaction with pm_layered The timer hasn't been enabled yet, if the STATUS isn't RUNNING, yet ... --- cpu/efm32/periph/timer_series2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/efm32/periph/timer_series2.c b/cpu/efm32/periph/timer_series2.c index 59b3274294..ee5772af13 100644 --- a/cpu/efm32/periph/timer_series2.c +++ b/cpu/efm32/periph/timer_series2.c @@ -255,7 +255,7 @@ static inline void _letimer_start(tim_t dev) { LETIMER_TypeDef *tim = timer_config[dev].dev; - if (tim->STATUS & LETIMER_STATUS_RUNNING) { + if (!(tim->STATUS & LETIMER_STATUS_RUNNING)) { pm_block(LETIMER_PM_BLOCKER); } @@ -266,7 +266,7 @@ static inline void _timer_start(tim_t dev) { TIMER_TypeDef *tim = timer_config[dev].dev; - if (tim->STATUS & TIMER_STATUS_RUNNING) { + if (!(tim->STATUS & TIMER_STATUS_RUNNING)) { pm_block(TIMER_PM_BLOCKER); }