Chapter 2. API Reference
allow the state information to be omitted from the TaskStatus_t structure. To obtain state information
then set eState to eInvalid - otherwise the value passed in eState will be reported as the task state in
the TaskStatus_t structure.
void
vTaskPrioritySet(TaskHandle_t
INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available. See the configuration
section for more information.
Set the priority of any task.
A context switch will occur before the function returns if the priority being set is higher than the currently
executing task.
Example usage:
void vAFunction( void )
{
TaskHandle_t xHandle;
//
Create a task, storing the
xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY,
);
→
// ...
//
Use the handle to
vTaskPrioritySet( xHandle, tskIDLE_PRIORITY
// ...
//
Use a NULL handle to
vTaskPrioritySet( NULL, tskIDLE_PRIORITY
}
Parameters
• xTask: Handle to the task for which the priority is being set. Passing a NULL handle results in the
priority of the calling task being set.
• uxNewPriority: The priority to which the task will be set.
void
vTaskSuspend(TaskHandle_t
INCLUDE_vTaskSuspend must be defined as 1 for this function to be available. See the configuration section
for more information.
Suspend any task. When suspended a task will never get any microcontroller processing time, no matter what
its priority.
Calls to vTaskSuspend are not accumulative - i.e. calling vTaskSuspend () twice on the same task still only
requires one call to vTaskResume () to ready the suspended task.
Example usage:
void vAFunction( void )
{
TaskHandle_t xHandle;
//
Create a task, storing the
xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY,
);
→
// ...
//
Use the handle to suspend the created
vTaskSuspend( xHandle );
Espressif Systems
xTask, UBaseType_t uxNewPriority)
handle.
raise
the priority of the created
raise
our priority to the same
xTaskToSuspend)
handle.
862
Submit Document Feedback
task.
+
1
);
value.
+
1
);
task.
&xHandle␣
&xHandle␣
(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?