MPU_vTaskDelayUntil() is only used within FreeRTOS.
 
Symbols
loading...
Files
loading...

MPU_vTaskDelayUntil() function

INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available. See the configuration section for more information. Delay a task until a specified time. This function can be used by periodic tasks to ensure a constant execution frequency. This function differs from vTaskDelay () in one important aspect: vTaskDelay () will cause a task to block for the specified number of ticks from the time vTaskDelay () is called. It is therefore difficult to use vTaskDelay () by itself to generate a fixed execution frequency as the time between a task starting to execute and that task calling vTaskDelay () may not be fixed [the task may take a different path though the code between calls, or may get interrupted or preempted a different number of times each time it executes]. Whereas vTaskDelay () specifies a wake time relative to the time at which the function is called, vTaskDelayUntil () specifies the absolute (exact) time at which it wishes to unblock. The constant portTICK_PERIOD_MS can be used to calculate real time from the tick rate - with the resolution of one tick period. Example usage:
// Perform an action every 10 ticks. void vTaskFunction( void * pvParameters ) { TickType_t xLastWakeTime; const TickType_t xFrequency = 10; // Initialise the xLastWakeTime variable with the current time. xLastWakeTime = xTaskGetTickCount (); for( ;; ) { // Wait for the next cycle. vTaskDelayUntil( &xLastWakeTime, xFrequency ); // Perform action here. } }

Syntax

void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime,     const TickType_t xTimeIncrement );

Arguments

pxPreviousWakeTime

Pointer to a variable that holds the time at which the task was last unblocked. The variable must be initialised with the current time prior to its first use (see the example below). Following this the variable is automatically updated within vTaskDelayUntil ().

xTimeIncrement

The cycle time period. The task will be unblocked at time *pxPreviousWakeTime + xTimeIncrement. Calling vTaskDelayUntil with the same xTimeIncrement parameter value will cause the task to execute with a fixed interface period.

References

LocationText
mpu_wrappers.c:162
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, TickType_t xTimeIncrement ) /* FREERTOS_SYSTEM_CALL */
mpu_prototypes.h:48
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
task.h:817

Call Tree

Functions called by MPU_vTaskDelayUntil()
MPU_vTaskDelayUntil()
Data read by MPU_vTaskDelayUntil()
MPU_vTaskDelayUntil()::pxPreviousWakeTime
MPU_vTaskDelayUntil()::xTimeIncrement
MPU_vTaskDelayUntil()::xRunningPrivileged
all items filtered out
MPU_vTaskDelayUntil()
Type of MPU_vTaskDelayUntil()
MPU_vTaskDelayUntil()
all items filtered out