mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
mcpwm: fix the issue of wrong period (backport v4.1)
This commit is contained in:
@ -152,7 +152,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)
|
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;
|
mcpwm->timer[timer].period.upmethod = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,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)
|
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 *******************/
|
/********************* Sync *******************/
|
||||||
|
Reference in New Issue
Block a user