Skip to content

Fix EFM32 pwmout hal function pwmout_period #7993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion targets/TARGET_Silicon_Labs/TARGET_EFM32/pwmout_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down