mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Minor updates to formatting and MISRA compliance of the PR used to update the vTaskDelayUntil() function to xTaskDelayUntil(). (#198)
This commit is contained in:
parent
6375d52250
commit
167ea16282
|
@ -816,7 +816,8 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
|
||||||
* a fixed interface period.
|
* a fixed interface period.
|
||||||
*
|
*
|
||||||
* @return Value which can be used to check whether the task was actually delayed.
|
* @return Value which can be used to check whether the task was actually delayed.
|
||||||
* Will be pdTRUE if the task way delayed and pdFALSE otherwise.
|
* Will be pdTRUE if the task way delayed and pdFALSE otherwise. A task will not
|
||||||
|
* be delayed if the next expected wake time is in the past.
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -825,16 +826,17 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
|
||||||
* {
|
* {
|
||||||
* TickType_t xLastWakeTime;
|
* TickType_t xLastWakeTime;
|
||||||
* const TickType_t xFrequency = 10;
|
* const TickType_t xFrequency = 10;
|
||||||
|
* BaseType_t xWasDelayed;
|
||||||
*
|
*
|
||||||
* // Initialise the xLastWakeTime variable with the current time.
|
* // Initialise the xLastWakeTime variable with the current time.
|
||||||
* xLastWakeTime = xTaskGetTickCount ();
|
* xLastWakeTime = xTaskGetTickCount ();
|
||||||
* for( ;; )
|
* for( ;; )
|
||||||
* {
|
* {
|
||||||
* // Wait for the next cycle.
|
* // Wait for the next cycle.
|
||||||
* BaseType_t xWasDelayed = xTaskDelayUntil( &xLastWakeTime, xFrequency );
|
* xWasDelayed = xTaskDelayUntil( &xLastWakeTime, xFrequency );
|
||||||
*
|
*
|
||||||
* // Perform action here. xWasDelayed value can be used to determine
|
* // Perform action here. xWasDelayed value can be used to determine
|
||||||
* // whether a deadline was missed if the code here took too long.
|
* // whether a deadline was missed if the code here took too long.
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -843,9 +845,10 @@ void vTaskDelay( const TickType_t xTicksToDelay ) PRIVILEGED_FUNCTION;
|
||||||
*/
|
*/
|
||||||
BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||||
const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
|
const TickType_t xTimeIncrement ) PRIVILEGED_FUNCTION;
|
||||||
#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
|
|
||||||
{ \
|
#define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ) \
|
||||||
xTaskDelayUntil ( pxPreviousWakeTime , xTimeIncrement ); \
|
{ \
|
||||||
|
( void ) xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue