Espressif ESP32-S2 Programming Manual page 939

Table of Contents

Advertisement

Chapter 2. API Reference
the Blocked state, waiting for messages to arrive on the timer command queue. Calling xTimer-
StartFromISR() writes a message to the timer command queue, so has the potential to transition
the timer service/daemon task out of the Blocked state. If calling xTimerStartFromISR() causes
the timer service/daemon task to leave the Blocked state, and the timer service/ daemon task has
a priority equal to or greater than the currently executing task (the task that was interrupted), then
*pxHigherPriorityTaskWoken will get set to pdTRUE internally within the xTimerStartFromISR()
function. If xTimerStartFromISR() sets this value to pdTRUE then a context switch should be per-
formed before the interrupt exits.
xTimerStopFromISR(xTimer, pxHigherPriorityTaskWoken)
BaseType_t xTimerStopFromISR( TimerHandle_t xTimer, BaseType_t *pxHigherPriorityTaskWoken );
A version of xTimerStop() that can be called from an interrupt service routine.
Example usage:
* //
This scenario assumes xTimer has already been created
* //
an interrupt occurs, the timer should be simply
*
* //
The interrupt service routine that stops the
*
void vAnExampleInterruptServiceRoutine( void )
*
{
*
BaseType_t xHigherPriorityTaskWoken
*
*
//
The interrupt has occurred
*
//
xHigherPriorityTaskWoken was
*
//
(within this
*
//
FreeRTOS API functions that end
*
if( xTimerStopFromISR( xTimer, &xHigherPriorityTaskWoken )
*
{
*
//
The stop command was
*
//
action
*
}
*
*
//
If xHigherPriorityTaskWoken equals pdTRUE, then a context switch
*
//
should be
*
//
from
inside
*
// compiler.
*
//
actual syntax
*
if( xHigherPriorityTaskWoken
*
{
*
//
Call the interrupt safe
*
//
depends on the FreeRTOS port being
*
}
*
}
*
Return pdFAIL will be returned if the stop command could not be sent to the timer command queue. pdPASS
will be returned if the command was successfully sent to the timer command queue. When the command
is actually processed will depend on the priority of the timer service/daemon task relative to other tasks
in the system. The timer service/daemon task priority is set by the configTIMER_TASK_PRIORITY
configuration constant.
Parameters
• xTimer: The handle of the timer being stopped.
• pxHigherPriorityTaskWoken: The timer service/daemon task spends most of its time in
the Blocked state, waiting for messages to arrive on the timer command queue. Calling xTimer-
StopFromISR() writes a message to the timer command queue, so has the potential to transition
the timer service/daemon task out of the Blocked state. If calling xTimerStopFromISR() causes
the timer service/daemon task to leave the Blocked state, and the timer service/ daemon task has
a priority equal to or greater than the currently executing task (the task that was interrupted), then
*pxHigherPriorityTaskWoken will get set to pdTRUE internally within the xTimerStopFromISR()
function. If xTimerStopFromISR() sets this value to pdTRUE then a context switch should be per-
Espressif Systems
=
-
simply stop the
set
function).
As this
not
executed
here.
performed.
The syntax required to perform a context switch
an ISR varies
from
Inspect the demos
for
required.
!=
pdFALSE )
yield
928
Submit Document Feedback
and
stopped.
timer.
pdFALSE;
timer.
to pdFALSE where it was defined
is
an interrupt service routine, only
in
"FromISR"
can be
successfully.
port
to port,
and from
the port you are using to find the
function here (actual function
used).
started.
When
used.
!=
pdPASS )
Take appropriate
compiler
to
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF