zephyr::raw

Function k_sem_init

source
pub unsafe extern "C" fn k_sem_init(
    sem: *mut k_sem,
    initial_count: u32,
    limit: u32,
) -> i32
Expand description

@brief Initialize a semaphore.

This routine initializes a semaphore object, prior to its first use.

@param sem Address of the semaphore. @param initial_count Initial semaphore count. @param limit Maximum permitted semaphore count.

@see K_SEM_MAX_LIMIT

@retval 0 Semaphore created successfully @retval -EINVAL Invalid values