Chapter 2. API Reference
*
xBacklightTimer
text name,
not
→
*
timer period
→
*
is
a one-shot
→
*
not
used by the callback so can take
→
*
callback function that switches the LCD back-light
→
*
*
*
if( xBacklightTimer
*
{
*
//
The timer was
*
}
*
else
*
{
*
//
Start the
*
//
it would be ignored because the scheduler has
*
// started.
*
if( xTimerStart( xBacklightTimer,
*
{
*
//
*
}
*
}
*
*
// ...
*
//
Create tasks
*
// ...
*
*
//
Starting the scheduler will start the timer running
*
//
been
set
*
vTaskStartScheduler();
*
*
//
Should
*
for( ;; );
*
}
*
Return pdFAIL will be returned if the reset command could not be sent to the timer command queue even
after xTicksToWait ticks had passed. 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, although the timers expiry time is
relative to when xTimerStart() is actually called. The timer service/daemon task priority is set by the
configTIMER_TASK_PRIORITY configuration constant.
Parameters
• xTimer: The handle of the timer being reset/started/restarted.
• xTicksToWait: Specifies the time, in ticks, that the calling task should be held in the Blocked
state to wait for the reset command to be successfully sent to the timer command queue, should the
queue already be full when xTimerReset() was called. xTicksToWait is ignored if xTimerReset() is
called before the scheduler is started.
xTimerStartFromISR(xTimer, pxHigherPriorityTaskWoken)
BaseType_t xTimerStartFromISR( TimerHandle_t xTimer, BaseType_t *pxHigherPriorityTaskWoken );
A version of xTimerStart() that can be called from an interrupt service routine.
Example usage:
* //
This scenario assumes xBacklightTimer has already been
Espressif Systems
=
xTimerCreate( "BacklightTimer",
used by the
kernel.
in
ticks.
timer.
==
NULL )
not
created.
timer.
No block time
The timer could
not
here.
into the active
state.
not
reach
here.
Submit Document Feedback
(
5000
/
portTICK_PERIOD_MS),
pdFALSE,
0,
any
value.
vBacklightTimerCallback
off.
);
is
specified,
0
)
!=
pdPASS )
be
set
into the Active
926
(continued from previous page)
//
Just
a␣
//
The␣
//
The
timer␣
//
The
id
is␣
//
The␣
and
even
if
one was
not
yet been
state.
as
it has already
created.
When a
(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?