Files
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
..