52 #if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__) 91 #define _BSEMAPHORE_DATA(name, taken) \ 92 {_SEMAPHORE_DATA(name.sem, ((taken) ? 0 : 1))} 102 #define BSEMAPHORE_DECL(name, taken) \ 103 binary_semaphore_t name = _BSEMAPHORE_DATA(name, taken) 304 return (bsp->sem.
cnt > (
cnt_t)0) ?
false :
true;
msg_t chSemWait(semaphore_t *sp)
Performs a wait operation on a semaphore.
cnt_t cnt
The semaphore counter.
static void chBSemReset(binary_semaphore_t *bsp, bool taken)
Reset operation on the binary semaphore.
#define chSysLock()
Enters the kernel lock state.
static void chBSemObjectInit(binary_semaphore_t *bsp, bool taken)
Initializes a binary semaphore.
uint64_t sysinterval_t
Type of time interval.
static void chBSemSignal(binary_semaphore_t *bsp)
Performs a signal operation on a binary semaphore.
static msg_t chBSemWaitS(binary_semaphore_t *bsp)
Wait operation on the binary semaphore.
msg_t chSemWaitTimeoutS(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
msg_t chSemWaitS(semaphore_t *sp)
Performs a wait operation on a semaphore.
static bool chBSemGetStateI(const binary_semaphore_t *bsp)
Returns the binary semaphore current state.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
static void chBSemSignalI(binary_semaphore_t *bsp)
Performs a signal operation on a binary semaphore.
#define chSysUnlock()
Leaves the kernel lock state.
void chSemReset(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.
struct ch_binary_semaphore binary_semaphore_t
Binary semaphore type.
void chSemObjectInit(semaphore_t *sp, cnt_t n)
Initializes a semaphore with the specified counter value.
static msg_t chBSemWaitTimeout(binary_semaphore_t *bsp, sysinterval_t timeout)
Wait operation on the binary semaphore.
msg_t chSemWaitTimeout(semaphore_t *sp, sysinterval_t timeout)
Performs a wait operation on a semaphore with timeout specification.
static msg_t chBSemWait(binary_semaphore_t *bsp)
Wait operation on the binary semaphore.
void chSemSignalI(semaphore_t *sp)
Performs a signal operation on a semaphore.
static msg_t chBSemWaitTimeoutS(binary_semaphore_t *bsp, sysinterval_t timeout)
Wait operation on the binary semaphore.
void chSemResetI(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.
static void chBSemResetI(binary_semaphore_t *bsp, bool taken)
Reset operation on the binary semaphore.