Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update esp32_ledc_mcu.cpp to ensure ledc_timer is initialised to a kn…
…own state (ledc_timer = false)
  • Loading branch information
rob-deutsch committed Jan 28, 2025
commit 97abb54cd90e6fcad126b9694e4c3e15cec5239a
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
Loading