task.h
long BaseType_t
Definition portmacro.h:59
uint16_t TickType_t
Definition portmacro.h:63
struct xTIME_OUT TimeOut_t
BaseType_t xTaskCheckForTimeOut(TimeOut_t *const pxTimeOut, TickType_t *const pxTicksToWait)
Definition tasks.c:5534
Determines if pxTicksToWait ticks has passed since a time was captured using a call to vTaskSetTimeOutState(). The captured time includes the tick count and the number of times the tick count has overflowed.
- Parameters
-
pxTimeOut | The time status as captured previously using vTaskSetTimeOutState. If the timeout has not yet occurred, it is updated to reflect the current time status. |
pxTicksToWait | The number of ticks to check for timeout i.e. if pxTicksToWait ticks have passed since pxTimeOut was last updated (either by vTaskSetTimeOutState() or xTaskCheckForTimeOut()), the timeout has occurred. If the timeout has not occurred, pxTicksToWait is updated to reflect the number of remaining ticks. |
- Returns
- If timeout has occurred, pdTRUE is returned. Otherwise pdFALSE is returned and pxTicksToWait is updated to reflect the number of remaining ticks.
- See also
- https://www.FreeRTOS.org/xTaskCheckForTimeOut.html
Example Usage:
size_t xUART_Receive( uint8_t *pucBuffer, size_t uxWantedBytes )
{
size_t uxReceived = 0;
while( UART_bytes_in_rx_buffer( pxUARTInstance ) < uxWantedBytes )
{
{
break;
}
}
uxReceived = UART_read_from_receive_buffer( pxUARTInstance,
pucBuffer,
uxWantedBytes );
return uxReceived;
}
#define pdFALSE
Definition projdefs.h:52
#define pdTRUE
Definition projdefs.h:53
#define ulTaskNotifyTake(xClearCountOnExit, xTicksToWait)
Definition task.h:3177
void vTaskSetTimeOutState(TimeOut_t *const pxTimeOut)
Definition tasks.c:5506