Hello.
I am currently working with esp-idf and ran into an error. I am trying to set up an LED to fade in and out in a breath like fashion, but I also need the board to do other things, rather than waiting because the way I have it written, other functions get blocked, since if I don't wait for the LED to fully fade, it won't fade at all. So I made a thread. The code used to have ledc_fade_func_install(0) in the main function and it would call rgb_fade() from another file afterward in a loop, however, once I put the thread in, that functionality stopped working because according to the fades inside the thread, ledc_fade_func_install was not run. When I moved the install inside the thread, I was met with an error return of 261: ESP_ERR_NOT_FOUND, as opposed to the successful installation in main.
Is there something I'm missing that would fix this, or is ledc_fade_func_install not thread safe?
Threading and LED fade
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: Threading and LED fade
Hi,
Are you using dual core and frequently calling "ledc_fade_func_install" ? and can you provide your IDF version?
Are you using dual core and frequently calling "ledc_fade_func_install" ? and can you provide your IDF version?
wookooho
-
- Posts: 2
- Joined: Tue Nov 27, 2018 10:48 pm
Re: Threading and LED fade
I am using IDF version 3.1.1 if memory serves, and no, I'm trying to call ledc_fade_func_install once if I can. I am using a dual core board though.
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: Threading and LED fade
Hi, CopperCoryCopperCory wrote: ↑Wed Nov 28, 2018 5:11 pmI am using IDF version 3.1.1 if memory serves, and no, I'm trying to call ledc_fade_func_install once if I can. I am using a dual core board though.
Can you please try the master branch for testing? we have some update on master branch. According to your description, I guess that your issue sholud be solved by this fix: (3.1.1 : https://github.com/espressif/esp-idf/bl ... loc.c#L713 master: https://github.com/espressif/esp-idf/bl ... loc.c#L714).
wookooho
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: Threading and LED fade
ESP_houwenxiang wrote: ↑Thu Nov 29, 2018 5:33 amHi, CopperCoryCopperCory wrote: ↑Wed Nov 28, 2018 5:11 pmI am using IDF version 3.1.1 if memory serves, and no, I'm trying to call ledc_fade_func_install once if I can. I am using a dual core board though.
Can you please try the master branch for testing? we have some update on master branch. According to your description, I guess that your issue sholud be solved by this fix: (3.1.1 : https://github.com/espressif/esp-idf/bl ... loc.c#L713 master: https://github.com/espressif/esp-idf/bl ... loc.c#L714).
Hi, CopperCory
Has your problem been solved?
wookooho
Who is online
Users browsing this forum: tomatosoup and 127 guests