RTOS Abstraction (abstraction-rtos)
Time

General Description

APIs for getting the current time and waiting.

cy_rslt_t cy_rtos_time_get (cy_time_t *tval)
 Gets time in milliseconds since RTOS start. More...
 
cy_rslt_t cy_rtos_delay_milliseconds (cy_time_t num_ms)
 Delay for a number of milliseconds. More...
 
#define cy_rtos_get_time(tval)   cy_rtos_time_get(tval)
 Gets time in milliseconds since RTOS start. More...
 

Macro Definition Documentation

◆ cy_rtos_get_time

#define cy_rtos_get_time (   tval)    cy_rtos_time_get(tval)

Gets time in milliseconds since RTOS start.

Note
Since this is only 32 bits, it will roll over every 49 days, 17 hours, 2 mins, 47.296 seconds
Parameters
[out]tvalPointer to the struct to populate with the RTOS time
Returns
Time in milliseconds since the RTOS started.

Function Documentation

◆ cy_rtos_time_get()

cy_rslt_t cy_rtos_time_get ( cy_time_t tval)

Gets time in milliseconds since RTOS start.

Note
Since this is only 32 bits, it will roll over every 49 days, 17 hours, 2 mins, 47.296 seconds
Parameters
[out]tvalPointer to the struct to populate with the RTOS time
Returns
Time in milliseconds since the RTOS started.

◆ cy_rtos_delay_milliseconds()

cy_rslt_t cy_rtos_delay_milliseconds ( cy_time_t  num_ms)

Delay for a number of milliseconds.

Processing of this function depends on the minimum sleep time resolution of the RTOS. The current thread should sleep for the longest period possible which is less than the delay required, then makes up the difference with a tight loop.

Parameters
[in]num_msThe number of milliseconds to delay for
Returns
The status of the delay request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]