From dd2e93fbd3b9d9b18a73168ed2dfa2f65c62014e Mon Sep 17 00:00:00 2001 From: Michael Kaplan Date: Wed, 5 Sep 2018 11:17:28 +0200 Subject: [PATCH] Fix EFM32 pwmout hal function pwmout_period In pwmout_period() is a check for changed values, which is not working because of a wrongly used bitmask. This is fixed now. --- targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c index 759c1533d3..9553d1e4a5 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c @@ -302,7 +302,7 @@ void pwmout_period(pwmout_t *obj, float seconds) } //Check if anything changed - if(((PWM_TIMER->CTRL & ~_TIMER_CTRL_PRESC_MASK) == (pwm_prescaler_div << _TIMER_CTRL_PRESC_SHIFT)) && (TIMER_TopGet(PWM_TIMER) == cycles)) return; + if(((PWM_TIMER->CTRL & _TIMER_CTRL_PRESC_MASK) == (pwm_prescaler_div << _TIMER_CTRL_PRESC_SHIFT)) && (TIMER_TopGet(PWM_TIMER) == cycles)) return; //Save previous period for recalculation of duty cycles uint32_t previous_period_cycles = PWM_TIMER->TOPB;