mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 17:49:10 -04:00
Merge branch 'bugfix/mcpwm_period_error_MR' into 'master'
bugfix(mcpwm_period_error): fix the issue of wrong period See merge request espressif/esp-idf!7734
This commit is contained in:
commit
69b6ca6a70
@ -156,7 +156,7 @@ static inline void mcpwm_ll_timer_stop(mcpwm_dev_t *mcpwm, int timer)
|
||||
static inline void mcpwm_ll_timer_set_period(mcpwm_dev_t *mcpwm, int timer, uint32_t period)
|
||||
{
|
||||
|
||||
mcpwm->timer[timer].period.period = period;
|
||||
mcpwm->timer[timer].period.period = period - 1;
|
||||
mcpwm->timer[timer].period.upmethod = 0;
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ static inline void mcpwm_ll_timer_set_period(mcpwm_dev_t *mcpwm, int timer, uint
|
||||
*/
|
||||
static inline uint32_t mcpwm_ll_timer_get_period(mcpwm_dev_t *mcpwm, int timer)
|
||||
{
|
||||
return mcpwm->timer[timer].period.period;
|
||||
return mcpwm->timer[timer].period.period + 1;
|
||||
}
|
||||
|
||||
/********************* Sync *******************/
|
||||
|
Loading…
x
Reference in New Issue
Block a user