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.
pull/7993/head
Michael Kaplan 2018-09-05 11:17:28 +02:00
parent 3057c6c722
commit dd2e93fbd3
1 changed files with 1 additions and 1 deletions

View File

@ -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;