40Q_DEFINE_THIS_MODULE(
"qf_qeq")
44void QEQueue_init(
QEQueue * const me,
45 struct
QEvt const * * const qSto,
46 uint_fast16_t const qLen)
51#if (QF_EQUEUE_CTR_SIZE == 1U)
55 me->frontEvt = (
QEvt *)0;
71 struct QEvt const *
const e,
72 uint_fast16_t
const margin,
73 uint_fast8_t
const qsId)
87 bool const status = ((margin ==
QF_NO_MARGIN) && (tmp > 0U))
153 struct QEvt const *
const e,
154 uint_fast8_t
const qsId)
178 if (me->
nMin > tmp) {
197 if (tmp == me->
end) {
210 uint_fast8_t
const qsId)
221 if (e != (
QEvt *)0) {
229 if (tmp <= me->
end) {
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define QF_NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64)
Internal (package scope) QP/C interface.
#define QS_2U8_PRE(data1_, data2_)
#define QS_BEGIN_PRE(rec_, qsId_)
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
General-purpose assertion with user-specified ID number (in critical section)
#define Q_REQUIRE_INCRIT(id_, expr_)
Assertion for checking a precondition (in critical section)
QEQueueCtr volatile tail
Offset of where next event will be extracted from the buffer.
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.
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_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)
QSignal sig
Signal of the event (see Event Signal)
uint8_t volatile refCtr_
Event reference counter.
uint8_t poolNum_
Event pool number of this event.