vTaskResume
[任务控制]
task. h void vTaskResume( TaskHandle_t xTaskToResume );
必须将 INCLUDE_vTaskSuspend 定义为 1 才能使用此函数。有关详细信息,请参阅 RTOS 配置文档。
恢复已挂起的任务。
由一次或多次调用 vTaskSuspend () 而挂起的任务可通过单次调用 vTaskResume () 重新运行。
- 参数:
-
用法示例:
void vAFunction( void )
{
TaskHandle_t xHandle;
// Create a task, storing the handle.
xTaskCreate( vTaskCode, "NAME", STACK_SIZE, NULL, tskIDLE_PRIORITY, &xHandle );
// ...
// Use the handle to suspend the created task.
vTaskSuspend( xHandle );
// ...
// The created task will not run during this period, unless
// another task calls vTaskResume( xHandle ).
//...
// Resume the suspended task ourselves.
vTaskResume( xHandle );
// The created task will once again get microcontroller processing
// time in accordance with its priority within the system.
}
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|