ledc_set_duty_and_update requires ledc_fade_func_install

StevePeake
Posts: 8
Joined: Mon Nov 30, 2020 10:52 am

ledc_set_duty_and_update requires ledc_fade_func_install

Postby StevePeake » Tue Mar 16, 2021 1:03 pm

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.

wts1985
Posts: 3
Joined: Wed Apr 07, 2021 9:55 am

Re: ledc_set_duty_and_update requires ledc_fade_func_install

Postby wts1985 » Wed Apr 07, 2021 9:58 am

Thank you StevePeake, you saved the day.

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

Who is online

Users browsing this forum: No registered users and 123 guests