Updated Jun 2025

vTaskResume()

[Task Control]

task. h

1void vTaskResume( TaskHandle_t xTaskToResume );

INCLUDE_vTaskSuspend
must be defined as 1 for this function to be available. See the RTOS Configuration documentation for more information.

Resumes a suspended task.

A task that has been suspended by one or more calls to

vTaskSuspend(
) will be made available for running again by a single call to
vTaskResume()
.

Parameters:

  • xTaskToResume

    Handle to the task being readied.

Example usage:

1void vAFunction( void )
2{
3 TaskHandle_t xHandle;
4
5 // Create a task, storing the handle.
6 xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
7
8 // ...
9
10 // Use the handle to suspend the created task.
11 vTaskSuspend( xHandle );
12
13 // ...
14
15 // The created task will not run during this period, unless
16 // another task calls vTaskResume( xHandle ).
17
18 //...
19
20 // Resume the suspended task ourselves.
21 vTaskResume( xHandle );
22
23 // The created task will once again get microcontroller processing
24 // time in accordance with its priority within the system.
25}