zephyr::raw

Function k_usleep

source
pub unsafe extern "C" fn k_usleep(us: i32) -> i32
Expand description

@brief Put the current thread to sleep with microsecond resolution.

This function is unlikely to work as expected without kernel tuning. In particular, because the lower bound on the duration of a sleep is the duration of a tick, @kconfig{CONFIG_SYS_CLOCK_TICKS_PER_SEC} must be adjusted to achieve the resolution desired. The implications of doing this must be understood before attempting to use k_usleep(). Use with caution.

@param us Number of microseconds to sleep.

@return Zero if the requested time has elapsed or if the thread was woken up by the \ref k_wakeup call, the time left to sleep rounded up to the nearest microsecond.