EasyManua.ls Logo

Espressif ESP32-S2 - Page 935

Espressif ESP32-S2
1695 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
(continued from previous page)
* // command queue.
* if( xTimerChangePeriod( xTimer, 500 / portTICK_PERIOD_MS, 100 ) ==
,pdPASS )
* {
* // The command was successfully sent.
* }
* else
* {
* // The command could not be sent, even after waiting for 100
,ticks
* // to pass. Take appropriate action here.
* }
* }
* }
*
Return pdFAIL will be returned if the change period 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. The timer service/daemon task
priority is set by the configTIMER_TASK_PRIORITY configuration constant.
Parameters
xTimer: The handle of the timer that is having its period changed.
xNewPeriod: The new period for xTimer. Timer periods are specified in tick periods, so the
constant portTICK_PERIOD_MS can be used to convert a time that has been specied in millisec-
onds. For example, if the timer must expire after 100 ticks, then xNewPeriod should be set to
100. Alternatively, if the timer must expire after 500ms, then xNewPeriod can be set to ( 500 /
portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or equal to 1000.
xTicksToWait: Specifies the time, in ticks, that the calling task should be held in the Blocked
state to wait for the change period command to be successfully sent to the timer command queue,
should the queue already be full when xTimerChangePeriod() was called. xTicksToWait is ignored
if xTimerChangePeriod() is called before the scheduler is started.
xTimerDelete(xTimer, xTicksToWait)
BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait );
Timer functionality is provided by a timer service/daemon task. Many of the public FreeRTOS timer API
functions send commands to the timer service task through a queue called the timer command queue. The
timer command queue is private to the kernel itself and is not directly accessible to application code. The
length of the timer command queue is set by the configTIMER_QUEUE_LENGTH configuration constant.
xTimerDelete() deletes a timer that was previously created using the xTimerCreate() API function.
The configUSE_TIMERS configuration constant must be set to 1 for xTimerDelete() to be available.
Example usage:
Return pdFAIL will be returned if the delete 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. The timer service/daemon task priority
is set by the configTIMER_TASK_PRIORITY configuration constant.
Parameters
xTimer: The handle of the timer being deleted.
xTicksToWait: Specifies the time, in ticks, that the calling task should be held in the Blocked
state to wait for the delete command to be successfully sent to the timer command queue, should the
queue already be full when xTimerDelete() was called. xTicksToWait is ignored if xTimerDelete()
is called before the scheduler is started.
See the xTimerChangePeriod() API function example usage scenario.
Espressif Systems 924
Submit Document Feedback
Release v4.4

Table of Contents