27 #ifndef _CSP_SEMAPHORE_H_ 28 #define _CSP_SEMAPHORE_H_ 39 #if defined(CSP_POSIX) 42 #include <semaphore.h> 44 #define CSP_SEMAPHORE_OK 1 45 #define CSP_SEMAPHORE_ERROR 2 46 #define CSP_MUTEX_OK CSP_SEMAPHORE_OK 47 #define CSP_MUTEX_ERROR CSP_SEMAPHORE_ERROR 49 typedef sem_t csp_bin_sem_handle_t;
50 typedef pthread_mutex_t csp_mutex_t;
55 #if defined(CSP_MACOSX) 60 #define CSP_SEMAPHORE_OK PTHREAD_QUEUE_OK 61 #define CSP_SEMAPHORE_ERROR PTHREAD_QUEUE_EMPTY 62 #define CSP_MUTEX_OK CSP_SEMAPHORE_OK 63 #define CSP_MUTEX_ERROR CSP_SEMAPHORE_ERROR 70 #if defined(CSP_WINDOWS) 75 #define CSP_SEMAPHORE_OK 1 76 #define CSP_SEMAPHORE_ERROR 2 77 #define CSP_MUTEX_OK CSP_SEMAPHORE_OK 78 #define CSP_MUTEX_ERROR CSP_SEMAPHORE_ERROR 80 typedef HANDLE csp_bin_sem_handle_t;
81 typedef HANDLE csp_mutex_t;
86 #if defined(CSP_FREERTOS) 91 #define CSP_SEMAPHORE_OK pdPASS 92 #define CSP_SEMAPHORE_ERROR pdFAIL 93 #define CSP_MUTEX_OK CSP_SEMAPHORE_OK 94 #define CSP_MUTEX_ERROR CSP_SEMAPHORE_ERROR 96 typedef xSemaphoreHandle csp_bin_sem_handle_t;
97 typedef xSemaphoreHandle csp_mutex_t;
99 #endif // CSP_FREERTOS 159 #endif // _CSP_SEMAPHORE_H_ int csp_bin_sem_post(csp_bin_sem_handle_t *sem)
int csp_bin_sem_remove(csp_bin_sem_handle_t *sem)
Definition: pthread_queue.h:44
int csp_bin_sem_post_isr(csp_bin_sem_handle_t *sem, CSP_BASE_TYPE *task_woken)
int csp_bin_sem_create(csp_bin_sem_handle_t *sem)
int csp_mutex_unlock(csp_mutex_t *mutex)
int csp_mutex_create(csp_mutex_t *mutex)
int csp_mutex_lock(csp_mutex_t *mutex, uint32_t timeout)
int csp_mutex_remove(csp_mutex_t *mutex)
int csp_bin_sem_wait(csp_bin_sem_handle_t *sem, uint32_t timeout)