BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp );
Corrects the tick count value after the application code has held
interrupts disabled for an extended period.
This function is similar to vTaskStepTick()
, however, unlike
, this function may move the tick count forward past a
time at which a task should be remove from the blocked state. That means xTaskCatchUpTicks()
may remove tasks from the blocked state.
The number of tick interrupts that have been missed due to interrupts being disabled.
Its value is not computed automatically, so must be computed by the
- pdTRUE if moving the tick count forward resulted in a task leaving the
blocked state and a context switch being performed. Otherwise pdFALSE.
void vExampleFunction( void )
unsigned long ulTimeBefore, ulTimeAfter;
/* Read the current time before arbitrary processing takes place. */
ulTimeBefore = ulGetExternalTime();
/* Stop the timer that is generating the tick interrupt. */
/* Perform some arbitrary processing. */
/* Read the current time for computing elapsed time since ticks
were disabled. */
ulTimeAfter = ulGetExternalTime();
if ( xTaskCatchUpTicks( ulTimeAfter - ulTimeBefore ) == pdTRUE )
/* Moving the tick count forward resulted in a context switch. */
/* Restart the timer that is generating the tick interrupt. */
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.