29#define BLOCK_INDEFINITELY UINT16_MAX
StatusCode sem_post(Semaphore *sem)
Releases a semaphore and increments the counting semaphore.
Definition: semaphore.c:80
StatusCode sem_init(Semaphore *sem, uint32_t max_count, uint32_t initial_count)
Initializes counting semaphore with max and initial count.
Definition: semaphore.c:58
StatusCode sem_wait(Semaphore *sem, uint32_t timeout_ms)
Obtains previously initiated semaphore and decrements the counting semaphore.
Definition: semaphore.c:70
StatusCode mutex_lock(Mutex *mutex, uint16_t ms_to_wait)
Locks a Mutex.
Definition: semaphore.c:27
StatusCode mutex_unlock(Mutex *mutex)
Unlocks a Mutex.
Definition: semaphore.c:46
StatusCode mutex_init(Mutex *mutex)
Initializes a mutex using provided static entity.
Definition: semaphore.c:18
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Semaphore object with handle and buffer.
Definition: semaphore.h:32
StaticSemaphore_t buffer
Definition: semaphore.h:34
SemaphoreHandle_t handle
Definition: semaphore.h:33