Miscellaneous

RTOS miscellaneous functions. More...

Functions

uint32_t gos_rtos_get_time (void)
 Get the current system tick count. More...
 
gos_result_t gos_rtos_delay_milliseconds (uint32_t milliseconds)
 Sleep for a given period. More...
 

Detailed Description

RTOS miscellaneous functions.

Function Documentation

◆ gos_rtos_delay_milliseconds()

gos_result_t gos_rtos_delay_milliseconds ( uint32_t  milliseconds)

Sleep for a given period.

Causes the current thread to sleep for AT LEAST the specified number of milliseconds. If the processor is heavily loaded with higher priority tasks, the delay may be longer than requested.

Parameters
[in]milliseconds: Time to sleep in milliseconds
Returns
Result of API call, gos_result_t
Examples:
demo/uart_blaster/uart_blaster.c, and wifi/wifi_scan/main.c.

◆ gos_rtos_get_time()

uint32_t gos_rtos_get_time ( void  )

Get the current system tick count.

The system tick counter increments every millisecond. The value wraps back to zero after 2^32 milliseconds have passed since startup.

Returns
Number of milliseconds since system was started
Examples:
demo/uart_blaster/uart_blaster.c, network/softap_tcp_server/main.c, network/tcp_echo_server/main.c, network/tcp_multiclient/main.c, system/uart/main.c, utility/msgpack/read_write_buffer.c, utility/msgpack/read_write_stream.c, and wifi/wifi_scan/main.c.