Lines Matching refs:semaphore
592 cy_rslt_t cy_rtos_semaphore_init(cy_semaphore_t* semaphore, uint32_t maxcount, uint32_t initcount) in cy_rtos_semaphore_init() argument
595 if (semaphore == NULL) in cy_rtos_semaphore_init()
601 *semaphore = xSemaphoreCreateCounting(maxcount, initcount); in cy_rtos_semaphore_init()
602 if (*semaphore == NULL) in cy_rtos_semaphore_init()
618 cy_rslt_t cy_rtos_semaphore_get(cy_semaphore_t* semaphore, cy_time_t timeout_ms) in cy_rtos_semaphore_get() argument
625 if ((semaphore == NULL) || (is_in_isr() && (timeout_ms != 0))) in cy_rtos_semaphore_get()
636 if (pdFALSE == xSemaphoreTakeFromISR(*semaphore, &xHigherPriorityTaskWoken)) in cy_rtos_semaphore_get()
647 if (pdFALSE == xSemaphoreTake(*semaphore, ticks)) in cy_rtos_semaphore_get()
661 cy_rslt_t cy_rtos_semaphore_set(cy_semaphore_t* semaphore) in cy_rtos_semaphore_set() argument
665 if (semaphore == NULL) in cy_rtos_semaphore_set()
675 ret = xSemaphoreGiveFromISR(*semaphore, &xHigherPriorityTaskWoken); in cy_rtos_semaphore_set()
683 ret = xSemaphoreGive(*semaphore); in cy_rtos_semaphore_set()
703 cy_rslt_t cy_rtos_semaphore_get_count(cy_semaphore_t* semaphore, size_t* count) in cy_rtos_semaphore_get_count() argument
706 if (semaphore == NULL) in cy_rtos_semaphore_get_count()
712 *count = uxSemaphoreGetCount(*semaphore); in cy_rtos_semaphore_get_count()
722 cy_rslt_t cy_rtos_semaphore_deinit(cy_semaphore_t* semaphore) in cy_rtos_semaphore_deinit() argument
725 if (semaphore == NULL) in cy_rtos_semaphore_deinit()
731 vSemaphoreDelete(*semaphore); in cy_rtos_semaphore_deinit()