Page 1 of 1

ledc_set_duty_and_update requires ledc_fade_func_install

Posted: Tue Mar 16, 2021 1:03 pm
by StevePeake
Hi All

ledc_set_duty_and_update() always fails unless ledc_fade_func_install() has been called as part of the LEDC configuration.

The separate (non-thread-safe) functions ledc_set_duty() and ledc_update_duty() work fine without ledc_fade_func_install()

I couldn't find this mentioned in the documentation. As I didn't need the fade functionality, I didn't include that call when moving from the LEDC example to integrating into my current project.

I've just lost a whole morning to this, so posting in case it saves someone else some time.

ESP-IDF v4.2 using CMAKE.

Re: ledc_set_duty_and_update requires ledc_fade_func_install

Posted: Wed Apr 07, 2021 9:58 am
by wts1985
Thank you StevePeake, you saved the day.

I guess I will stay with thread "unsafe" code at the moment for cleaner code sake.