k_event_wait_safe

Function k_event_wait_safe 

Source
pub unsafe extern "C" fn k_event_wait_safe(
    event: *mut k_event,
    events: u32,
    reset: bool,
    timeout: k_timeout_t,
) -> u32
Expand description

@brief Wait for any of the specified events (safe version)

This call is nearly identical to @ref k_event_wait with the main difference being that the safe version atomically clears received events from the event object. This mitigates the need for calling @ref k_event_clear, or passing a “reset” argument, since doing so may result in lost event information.

@param event Address of the event object @param events Set of desired events on which to wait @param reset If true, clear the set of events tracked by the event object before waiting. If false, do not clear the events. @param timeout Waiting period for the desired set of events or one of the special values K_NO_WAIT and K_FOREVER.

@retval non-zero set of matching events upon success @retval 0 if no matching event was received within the specified time