Skip to content

Commit

Permalink
Update esp32_ledc_mcu.cpp to ensure ledc_timer is initialised to a kn…
Browse files Browse the repository at this point in the history
…own state (ledc_timer = false)
  • Loading branch information
rob-deutsch committed Jan 28, 2025
1 parent c72f063 commit 97abb54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/drivers/hardware_specific/esp32/esp32_ledc_mcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ bool _ledcAttachChannelAdvanced(uint8_t pin, int _channel, int _group, uint32_t

ledc_timer_bit_t res = static_cast<ledc_timer_bit_t>(resolution);
ledc_timer_config_t ledc_timer;
memset(&ledc_timer, 0, sizeof(ledc_timer));
ledc_timer.speed_mode = group;
ledc_timer.timer_num = LEDC_TIMER_0;
ledc_timer.duty_resolution = res;
Expand Down Expand Up @@ -401,4 +402,4 @@ void _writeDutyCycle6PWM(float dc_a, float dc_b, float dc_c, PhaseState *phase
_setPwmPairDutyCycle(params, 4, 5, dc_c, ((ESP32LEDCDriverParams*)params)->dead_zone, phase_state[2]);
}

#endif
#endif

0 comments on commit 97abb54

Please sign in to comment.