14 Commits
Author SHA1 Message Date
caaa5e1c56 fix(ledc): wait for a pending duty update before reconfiguring a channel on ESP32
On ESP32, duty_start stays set until a duty update or fade completes.
ledc_ll_set_duty_start() waits for that bit inside ledc_spinlock, so
writing new channel parameters while an update is still pending corrupts
the in-flight operation and then spins with interrupts disabled until it
finishes, which trips the interrupt watchdog.

Wait for duty_start to clear in _ledc_fade_hw_acquire() with vTaskDelay,
after taking the fade semaphore and masking DUTY_CHANGE_END, and before
rewriting duty/fade registers. The wait also applies when fade service is
not installed. Keep a short HAL wait as a last guard for ledc_update_duty().
ledc_set_duty_and_update() still returns before the new duty takes effect
on the next PWM cycle.

Merges https://github.com/espressif/esp-idf/pull/19077

Co-authored-by: Song Ruo Jing <songruojing@espressif.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 17:23:04 +08:00
morris f5bbafc050 refactor(ledc): move sleep retention config into driver layer
Move per-target LEDC regdma retention descriptors out of esp_hal_ledc
and into
esp_driver_ledc so the driver owns its backup scope and restore flow.
2026-07-09 15:42:51 +08:00
Chen Chen 32ee52d8a6 fix(ledc): add error check for potential out-of-bounds read 2026-02-24 18:10:21 +08:00
Song Ruo Jing cc3577e31a feat(ledc): add ETM support for LEDC peripheral
Closes https://github.com/espressif/esp-idf/issues/11855
2025-10-23 16:24:11 +08:00
Song Ruo Jing 3e464a508e feat(ledc): Add channel deconfiguration option to release the occupied IOs
Closes https://github.com/espressif/esp-idf/issues/15666
2025-09-16 11:17:59 +08:00
renpeiying 2f2cb51904 docs: Update struct for correct building of ledc.h
Closes https://github.com/espressif/esp-idf/issues/8813
2025-08-11 16:18:01 +08:00
Song Ruo Jing 63e2d6828b refactor(ledc): deprecate ledc_isr_register and ledc_channel_config_t::intr_type 2025-07-22 15:10:52 +08:00
Song Ruo Jing dca8f204eb refactor(ledc): remove deprecated API/macro for v6.0 2025-07-22 15:05:10 +08:00
Song Ruo Jing 5378b716a0 docs(ledc): add notes for ledc_set_fade_with_time API reference
Closes https://github.com/espressif/esp-idf/issues/15085
2025-02-07 21:28:34 +08:00
Song Ruo Jing 1cd5736e75 refactor(ledc): deprecate ledc_timer_set API
Closes https://github.com/espressif/esp-idf/issues/14884
2024-12-05 19:02:33 +08:00
Song Ruo Jing 4a90deb227 feat(ledc): support ledc sleep mode selection
Support LEDC sleep retention on C6/H2/P4
2024-10-22 17:54:32 +08:00
Song Ruo Jing 51a7f7895c feat(ledc): add esp_gpio_reserve to ledc driver 2024-07-05 15:11:57 +08:00
morris c0289ee6eb fix(drivers): fix typos found by codespell
codespell components/esp_driver*
2024-03-28 10:01:27 +08:00
wanlei 82f26471f0 feat(ledc): make esp_driver_ledc as component 2023-12-29 11:28:19 +08:00