Chapter 2. API Reference
*
if( xTimerIsTimerActive( xTimer )
equivalently
→
*
{
*
//
xTimer
*
}
*
else
*
{
*
//
xTimer
*
}
*
}
*
Return pdFALSE will be returned if the timer is dormant. A value other than pdFALSE will be returned if
the timer is active.
Parameters
• xTimer: The timer being queried.
TaskHandle_t
xTimerGetTimerDaemonTaskHandle(void)
xTimerGetTimerDaemonTaskHandle() is only available if INCLUDE_xTimerGetTimerDaemonTaskHandle
is set to 1 in FreeRTOSConfig.h.
Simply returns the handle of the timer service/daemon task. It it not valid to call xTimerGetTimerDaemon-
TaskHandle() before the scheduler has been started.
BaseType_t
xTimerPendFunctionCallFromISR(PendedFunction_t
BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1,
uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken );
Used from application interrupt service routines to defer the execution of a function to the RTOS daemon task
(the timer service task, hence this function is implemented in timers.c and is prefixed with 'Timer').
Ideally an interrupt service routine (ISR) is kept as short as possible, but sometimes an ISR either has a lot of
processing to do, or needs to perform processing that is not deterministic. In these cases xTimerPendFunc-
tionCallFromISR() can be used to defer processing of a function to the RTOS daemon task.
A mechanism is provided that allows the interrupt to return directly to the task that will subsequently execute the
pended callback function. This allows the callback function to execute contiguously in time with the interrupt
- just as if the callback had executed in the interrupt itself.
Example usage:
*
*
//
The callback function that will execute
task.
→
*
//
Note callback functions must
*
void vProcessInterface( void *pvParameter1, uint32_t ulParameter2 )
*
{
*
BaseType_t xInterfaceToService;
*
*
//
The interface that requires servicing
*
// parameter.
*
xInterfaceToService
*
*
//
...Perform the processing
*
}
*
*
//
An ISR that receives data packets
*
void vAnISR( void )
*
{
*
BaseType_t xInterfaceToService, xHigherPriorityTaskWoken;
Espressif Systems
"if( xTimerIsTimerActive( xTimer ) )"
is
active, do
something.
is not
active, do something
The first parameter
=
( BaseType_t ) ulParameter2;
Submit Document Feedback
!=
pdFALSE )
//
else.
*pvParameter1, uint32_t ulParameter2, Base-
Type_t *pxHigherPriorityTaskWoken)
in
the context of the
all
use this same
prototype.
is
passed
is not
used
in
here...
from
multiple
interfaces
919
(continued from previous page)
or
more simply
and␣
xFunctionToPend,
void
daemon␣
in
the second
this
case.
(continues on next page)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?