is there a way to get Task status (multi core setup)? #7478
-
I'm having a setup where I'm running my main code loop an ESP32-S3 on core 1. In parallel I occasionally have a simple LED animation which I'm running on Core 0 using : xTaskCreatePinnedToCore(). After each LED animation I suspend the task, something like this (simplified):
then when I want to play the LED animation again I simple call
This works well, and runs smooth. However in my main application I want to put the ESP in deep sleep, but only want to do that once my LED animation is finished and the task is suspended. Is there an easy way to check the status of the task so I can wait with putting the ESP in deep sleep once the task is done and suspended? conceptually something like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
That's interesting. vTaskSuspend is in a FREETOS header included the ESP32 IDF: I see a function that may satisfy your needs:
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to get it to work, but I'm getting a compilation error. this is what I have:
but getting this error:
I found some examples and I believe I implemented it correctly (but most likely not): |
Beta Was this translation helpful? Give feedback.
-
It's probably because it's not included in the precompiled arduino code. pseudocode because it lacks all the arguments:
you can check with ulTaskNotifyTake() in your other task. Use |
Beta Was this translation helpful? Give feedback.
-
thanks, will look into this |
Beta Was this translation helpful? Give feedback.
-
Found another function |
Beta Was this translation helpful? Give feedback.
-
Hmmm, vTaskGetInfo() does not want to compile. Access to the function can be guaranteed with:
However the function may not exist in the compiled Arduino core. Using a Semaphore may be the way to go. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
eTaskState ts = eTaskGetState(LEDS);
does compile!