Lines Matching refs:semaphore
507 cy_rslt_t cy_rtos_init_semaphore(cy_semaphore_t* semaphore, uint32_t maxcount, uint32_t initcount) in cy_rtos_init_semaphore() argument
512 if (semaphore == NULL) in cy_rtos_init_semaphore()
530 *semaphore = osSemaphoreNew(maxcount, initcount, &attr); in cy_rtos_init_semaphore()
531 CY_ASSERT((*semaphore == attr.cb_mem) || (*semaphore == NULL)); in cy_rtos_init_semaphore()
532 status = (*semaphore == NULL) ? CY_RTOS_GENERAL_ERROR : CY_RSLT_SUCCESS; in cy_rtos_init_semaphore()
543 cy_rslt_t cy_rtos_get_semaphore(cy_semaphore_t* semaphore, cy_time_t timeout_ms, bool in_isr) in cy_rtos_get_semaphore() argument
550 if ((semaphore == NULL) || (in_isr && (timeout_ms != 0))) in cy_rtos_get_semaphore()
556 statusInternal = osSemaphoreAcquire(*semaphore, timeout_ms); in cy_rtos_get_semaphore()
567 cy_rslt_t cy_rtos_set_semaphore(cy_semaphore_t* semaphore, bool in_isr) in cy_rtos_set_semaphore() argument
573 if (semaphore == NULL) in cy_rtos_set_semaphore()
579 statusInternal = osSemaphoreRelease(*semaphore); in cy_rtos_set_semaphore()
590 cy_rslt_t cy_rtos_get_count_semaphore(cy_semaphore_t* semaphore, size_t* count) in cy_rtos_get_count_semaphore() argument
593 if ((semaphore == NULL) || (count == NULL)) in cy_rtos_get_count_semaphore()
599 *count = osSemaphoreGetCount(*semaphore); in cy_rtos_get_count_semaphore()
609 cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t* semaphore) in cy_rtos_deinit_semaphore() argument
614 if (semaphore == NULL) in cy_rtos_deinit_semaphore()
620 statusInternal = osSemaphoreDelete(*semaphore); in cy_rtos_deinit_semaphore()
624 free(*semaphore); in cy_rtos_deinit_semaphore()
625 *semaphore = NULL; in cy_rtos_deinit_semaphore()