Merge pull request #7993 from evva-sfw/hotfix/efm32_hal_pwmout_set_period_fix

Fix EFM32 pwmout hal function pwmout_period
pull/8208/head
Cruz Monrreal 2018-09-20 13:42:04 -05:00 committed by GitHub
commit 7d54df66b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;