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) 236 chSemResetI(&bsp->sem, taken ? (cnt_t)0 : (cnt_t)1);
255 chSemReset(&bsp->sem, taken ? (cnt_t)0 : (cnt_t)1);
270 if (bsp->sem.
cnt < (cnt_t)1) {
304 return (bsp->sem.
cnt > (cnt_t)0) ?
false :
true;
msg_t chSemWait(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 chDbgCheckClassS(void)
S-class functions context check.
static void chBSemObjectInit(binary_semaphore_t *bsp, bool taken)
Initializes a binary semaphore.
cnt_t cnt
The semaphore counter.
uint64_t sysinterval_t
Type of time interval.
static void chSysLock(void)
Enters the kernel lock state.
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 void chBSemSignal(binary_semaphore_t *bsp)
Performs a signal operation on a binary semaphore.
static void chBSemReset(binary_semaphore_t *bsp, bool taken)
Reset operation on the binary semaphore.
static void chSysUnlock(void)
Leaves the kernel lock state.
static void chBSemResetI(binary_semaphore_t *bsp, bool taken)
Reset operation on the binary semaphore.
struct ch_binary_semaphore binary_semaphore_t
Binary semaphore type.
void chDbgCheckClassI(void)
I-class functions context check.
void chSchRescheduleS(void)
Performs a reschedule if a higher priority thread is runnable.
void chSemReset(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.
static msg_t chBSemWaitS(binary_semaphore_t *bsp)
Wait operation on the binary semaphore.
static msg_t chBSemWaitTimeoutS(binary_semaphore_t *bsp, sysinterval_t timeout)
Wait operation on the binary semaphore.
static void chBSemSignalI(binary_semaphore_t *bsp)
Performs a signal operation on a binary semaphore.
static msg_t chBSemWait(binary_semaphore_t *bsp)
Wait operation on the binary semaphore.
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.
void chSemSignalI(semaphore_t *sp)
Performs a signal operation on a semaphore.
void chSemResetI(semaphore_t *sp, cnt_t n)
Performs a reset operation on the semaphore.