Lines Matching refs:semaphore
491 cy_rslt_t cy_rtos_init_semaphore(cy_semaphore_t* semaphore, uint32_t maxcount, uint32_t initcount) in cy_rtos_init_semaphore() argument
494 if (semaphore == NULL) in cy_rtos_init_semaphore()
500 *semaphore = xSemaphoreCreateCounting(maxcount, initcount); in cy_rtos_init_semaphore()
501 if (*semaphore == NULL) in cy_rtos_init_semaphore()
517 cy_rslt_t cy_rtos_get_semaphore(cy_semaphore_t* semaphore, uint32_t timeout_ms, bool in_isr) in cy_rtos_get_semaphore() argument
524 if ((semaphore == NULL) || (in_isr && (timeout_ms != 0))) in cy_rtos_get_semaphore()
535 if (pdFALSE == xSemaphoreTakeFromISR(*semaphore, &xHigherPriorityTaskWoken)) in cy_rtos_get_semaphore()
542 if (pdFALSE == xSemaphoreTake(*semaphore, ticks)) in cy_rtos_get_semaphore()
556 cy_rslt_t cy_rtos_set_semaphore(cy_semaphore_t* semaphore, bool in_isr) in cy_rtos_set_semaphore() argument
560 if (semaphore == NULL) in cy_rtos_set_semaphore()
570 ret = xSemaphoreGiveFromISR(*semaphore, &xHigherPriorityTaskWoken); in cy_rtos_set_semaphore()
577 ret = xSemaphoreGive(*semaphore); in cy_rtos_set_semaphore()
597 cy_rslt_t cy_rtos_get_count_semaphore(cy_semaphore_t* semaphore, size_t* count) in cy_rtos_get_count_semaphore() argument
600 if (semaphore == NULL) in cy_rtos_get_count_semaphore()
606 *count = uxSemaphoreGetCount(*semaphore); in cy_rtos_get_count_semaphore()
616 cy_rslt_t cy_rtos_deinit_semaphore(cy_semaphore_t* semaphore) in cy_rtos_deinit_semaphore() argument
619 if (semaphore == NULL) in cy_rtos_deinit_semaphore()
625 vSemaphoreDelete(*semaphore); in cy_rtos_deinit_semaphore()