Lines Matching refs:semaphore
555 cy_rslt_t cy_rtos_semaphore_init(cy_semaphore_t* semaphore, uint32_t maxcount, uint32_t initcount) in cy_rtos_semaphore_init() argument
560 if (semaphore == NULL) in cy_rtos_semaphore_init()
578 *semaphore = osSemaphoreNew(maxcount, initcount, &attr); in cy_rtos_semaphore_init()
579 CY_ASSERT((*semaphore == attr.cb_mem) || (*semaphore == NULL)); in cy_rtos_semaphore_init()
580 status = (*semaphore == NULL) ? CY_RTOS_GENERAL_ERROR : CY_RSLT_SUCCESS; in cy_rtos_semaphore_init()
591 cy_rslt_t cy_rtos_semaphore_get(cy_semaphore_t* semaphore, cy_time_t timeout_ms) in cy_rtos_semaphore_get() argument
598 if ((semaphore == NULL) || (in_isr && (timeout_ms != 0))) in cy_rtos_semaphore_get()
604 statusInternal = osSemaphoreAcquire(*semaphore, timeout_ms); in cy_rtos_semaphore_get()
615 cy_rslt_t cy_rtos_semaphore_set(cy_semaphore_t* semaphore) in cy_rtos_semaphore_set() argument
620 if (semaphore == NULL) in cy_rtos_semaphore_set()
626 statusInternal = osSemaphoreRelease(*semaphore); in cy_rtos_semaphore_set()
637 cy_rslt_t cy_rtos_semaphore_get_count(cy_semaphore_t* semaphore, size_t* count) in cy_rtos_semaphore_get_count() argument
640 if ((semaphore == NULL) || (count == NULL)) in cy_rtos_semaphore_get_count()
646 *count = osSemaphoreGetCount(*semaphore); in cy_rtos_semaphore_get_count()
656 cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t* semaphore) in cy_rtos_deinit_semaphore() argument
661 if (semaphore == NULL) in cy_rtos_deinit_semaphore()
667 statusInternal = osSemaphoreDelete(*semaphore); in cy_rtos_deinit_semaphore()
671 free(*semaphore); in cy_rtos_deinit_semaphore()
672 *semaphore = NULL; in cy_rtos_deinit_semaphore()