Skip to content

Commit 1c25100

Browse files
Merge pull request #452 from simplefoc/master
Merge master changes back to dev branch
2 parents f60c953 + fb0be07 commit 1c25100

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/drivers/hardware_specific/esp32/esp32_ledc_mcu.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ bool _ledcAttachChannelAdvanced(uint8_t pin, int _channel, int _group, uint32_t
8686

8787
ledc_timer_bit_t res = static_cast<ledc_timer_bit_t>(resolution);
8888
ledc_timer_config_t ledc_timer;
89+
memset(&ledc_timer, 0, sizeof(ledc_timer));
8990
ledc_timer.speed_mode = group;
9091
ledc_timer.timer_num = LEDC_TIMER_0;
9192
ledc_timer.duty_resolution = res;
@@ -411,4 +412,4 @@ void _writeDutyCycle6PWM(float dc_a, float dc_b, float dc_c, PhaseState *phase
411412
_setPwmPairDutyCycle(params, 4, 5, dc_c, ((ESP32LEDCDriverParams*)params)->dead_zone, phase_state[2]);
412413
}
413414

414-
#endif
415+
#endif

0 commit comments

Comments
 (0)