Chapter 2. API Reference
pdTRUE then a context switch should be performed before the interrupt exits.
xTimerResetFromISR(xTimer, pxHigherPriorityTaskWoken)
BaseType_t xTimerResetFromISR( TimerHandle_t xTimer, BaseType_t *pxHigherPriorityTaskWoken );
A version of xTimerReset() that can be called from an interrupt service routine.
Example usage:
* //
This scenario assumes xBacklightTimer has already been
* //
key
is
pressed, an LCD back-light
* //
without a key being pressed, then the LCD back-light
* //
this case, the timer
* //
the xTimerReset() function, the key press event handler
* //
service
routine.
*
* //
The callback function assigned to the one-shot
* //
parameter
*
void vBacklightTimerCallback( TimerHandle_t pxTimer )
*
{
*
//
The timer expired, therefore
*
//
was
pressed.
*
vSetBacklightState( BACKLIGHT_OFF );
*
}
*
* //
The key press interrupt service
*
void vKeyPressEventInterruptHandler( void )
*
{
*
BaseType_t xHigherPriorityTaskWoken
*
*
//
Ensure the LCD back-light
*
//
responsible
*
//
key
inactivity.
*
//
call FreeRTOS API functions that end
*
vSetBacklightState( BACKLIGHT_ON );
*
*
//
xTimerStartFromISR()
*
//
as
both cause the timer to re-calculate its expiry
*
//
xHigherPriorityTaskWoken was initialised to pdFALSE when it was
*
//
declared
*
if( xTimerResetFromISR( xBacklightTimer, &xHigherPriorityTaskWoken )
pdPASS )
→
*
{
*
//
The reset command was
*
//
action
*
}
*
*
//
Perform the rest of the key processing
*
*
//
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 reset 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
Espressif Systems
is
a one-shot timer,
is not
used.
Switch off the LCD
for
turning the back-light off after
This
is
an interrupt service routine so can only
or
xTimerResetFromISR() could be called here
(in
this
function).
here.
performed.
The syntax required to perform a context switch
an ISR varies
Inspect the demos
required.
Submit Document Feedback
is
switched
on.
and
unlike the example given
timer.
5
seconds must have passed since a key
back-light.
routine.
=
pdFALSE;
is
on, then reset the timer that
in
"FromISR".
not
executed
successfully.
here.
from
port
to port,
and from
for
the port you are using to find the
!=
pdFALSE )
yield
function here (actual function
used).
930
created.
When a
If
5
seconds
pass
is
switched
off.
is
an interrupt
In this case the
is
5
seconds of
time.
!=␣
Take appropriate
compiler
to
Release v4.4
In
for
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?