Skip to content

Commit 1d634b4

Browse files
committed
center alignement fixed
1 parent e87dd58 commit 1d634b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/drivers/hardware_specific/esp32_mcu.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ stepper_2pwm_motor_slots_t esp32_stepper_2pwm_motor_slots[4] = {
100100
// configuring high frequency pwm timer
101101
// a lot of help from this post from Paul Gauld
102102
// https://hackaday.io/project/169905-esp-32-bldc-robot-actuator-controller
103+
// a short tutorial for v2.0.1+
104+
// https://kzhead.info/sun/q6uFktWgkYeMeZ8/esp32-arduino.html
105+
//
103106
void _configureTimerFrequency(long pwm_frequency, mcpwm_dev_t* mcpwm_num, mcpwm_unit_t mcpwm_unit, float dead_zone = NOT_SET){
104107

105108
mcpwm_config_t pwm_config;
@@ -169,8 +172,8 @@ void _configureTimerFrequency(long pwm_frequency, mcpwm_dev_t* mcpwm_num, mcpwm
169172
mcpwm_sync_configure(mcpwm_unit, MCPWM_TIMER_1, &sync_conf);
170173
mcpwm_sync_configure(mcpwm_unit, MCPWM_TIMER_2, &sync_conf);
171174

172-
// TIMER0 has itself as sync source, route this sync source directly to sync output for the other two
173-
mcpwm_set_timer_sync_output(mcpwm_unit, MCPWM_TIMER_0, MCPWM_SWSYNC_SOURCE_SYNCIN);
175+
// Enable sync event for all timers to be the TEZ of timer0
176+
mcpwm_set_timer_sync_output(mcpwm_unit, MCPWM_TIMER_0, MCPWM_SWSYNC_SOURCE_TEZ);
174177
}
175178

176179
// function setting the high pwm frequency to the supplied pins

0 commit comments

Comments
 (0)