32#ifndef QF_EQUEUE_CTR_SIZE
33 #define QF_EQUEUE_CTR_SIZE 1U
36#if (QF_EQUEUE_CTR_SIZE == 1U)
38#elif (QF_EQUEUE_CTR_SIZE == 2U)
41 #error QF_EQUEUE_CTR_SIZE defined incorrectly, expected 1U or 2U
60 struct QEvt const * *
const qSto,
61 uint_fast16_t
const qLen);
65 struct QEvt const *
const e,
66 uint_fast16_t
const margin,
67 uint_fast8_t
const qsId);
71 struct QEvt const *
const e,
72 uint_fast8_t
const qsId);
76 uint_fast8_t
const qsId);
QEQueueCtr volatile tail
Offset of where next event will be extracted from the buffer.
static bool QEQueue_isEmpty(QEQueue const *const me)
Find out if the queue is empty.
QEQueueCtr volatile head
Offset to where next event will be inserted into the buffer.
QEQueueCtr end
Offset of the end of the ring buffer from the start of the buffer.
static QEQueueCtr QEQueue_getNFree(QEQueue const *const me)
Obtain the number of free entries still available in the queue.
struct QEvt const * QEQueue_get(QEQueue *const me, uint_fast8_t const qsId)
Obtain an event from the "raw" thread-safe queue.
QEQueueCtr nMin
Minimum number of free events ever in the ring buffer.
QEQueueCtr volatile nFree
Number of free events in the ring buffer.
struct QEvt const ** ring
Pointer to the start of the ring buffer.
void QEQueue_init(QEQueue *const me, struct QEvt const **const qSto, uint_fast16_t const qLen)
Initialize the native QF event queue.
void QEQueue_postLIFO(QEQueue *const me, struct QEvt const *const e, uint_fast8_t const qsId)
Post an event to the "raw" thread-safe event queue (LIFO)
struct QEvt const *volatile frontEvt
Pointer to event at the front of the queue.
bool QEQueue_post(QEQueue *const me, struct QEvt const *const e, uint_fast16_t const margin, uint_fast8_t const qsId)
Post an event to the "raw" thread-safe event queue (FIFO)
static QEQueueCtr QEQueue_getNMin(QEQueue const *const me)
Obtain the minimum number of free entries ever in the queue (a.k.a. "low-watermark")