Page 1 of 1

How to get timer task handle

Posted: Sun Aug 27, 2023 9:55 pm
by jcolebaker
I want to get the task handle for the timer daemon task.

There is a FreeRTOS function: xTimerGetTimerDaemonTaskHandle

However, it is disabled in FreeRTOSConfig.h (INCLUDE_xTimerGetTimerDaemonTaskHandle is 0) with the comment:

"Currently there is no need for this API"

Is there another API or easy way to get the timer task handle? I'd prefer not to hack/patch the ESP-IDF source to enable this function.

Re: How to get timer task handle

Posted: Tue Aug 29, 2023 6:49 pm
by abellofiore
The task name is "Tmr Svc". Just use the following API in "task.h":

Code: Select all

TaskHandle_t xTaskGetHandle( const char * pcNameToQuery )

Re: How to get timer task handle

Posted: Fri Sep 01, 2023 3:47 am
by jcolebaker
Thanks - That works well.