Counting Semaphore of the QXK preemptive kernel.
QXSemaphore is a blocking mechanism intended primarily for signaling extended threads. The semaphore is initialized with the maximum count (see QXSemaphore_init()), which allows you to create a binary semaphore (when the maximum count is 1) and counting semaphore when the maximum count is > 1.
- Usage
- The following example illustrates how to instantiate and use the semaphore in your application.
int main() {
. . .
0U,
1U);
. . .
}
void main_threadXYZ(
QXThread *
const me) {
while (1) {
. . .
. . .
}
}
void GPIO_Handler(void) {
. . .
. . .
}
#define QXTHREAD_NO_TIMEOUT
Counting Semaphore of the QXK preemptive kernel.
bool QXSemaphore_signal(QXSemaphore *const me)
bool QXSemaphore_wait(QXSemaphore *const me, QTimeEvtCtr const nTicks)
void QXSemaphore_init(QXSemaphore *const me, uint_fast8_t const count, uint_fast8_t const max_count)
eXtended (blocking) thread of the QXK preemptive kernel
Definition at line 208 of file qxk.h.