QP/C
Functions
qa_get_.c File Reference

QActive_get_() and QF_getQueueMargin() definitions. More...

#include "qf_pkg.h"
#include "qassert.h"

Go to the source code of this file.

Functions

QEvent const * QActive_get_ (QActive *me)
 Get an event from the event queue of an active object.
uint32_t QF_getQueueMargin (uint8_t prio)
 This function returns the margin of the given event queue.

Detailed Description

QActive_get_() and QF_getQueueMargin() definitions.

Note:
this source file is only included in the QF library when the native QF active object queue is used (instead of a message queue of an RTOS).

Definition in file qa_get_.c.


Function Documentation

QEvent const* QActive_get_ ( QActive me)

Get an event from the event queue of an active object.

This function is used internally by a QF port to extract events from the event queue of an active object. This function depends on the event queue implementation and is sometimes implemented in the QF port (qf_port.c file). Depending on the underlying OS or kernel, the function might block the calling thread when no events are available.

See also:
QActive_postFIFO(), QActive_postLIFO()

Definition at line 43 of file qa_get_.c.

References QACTIVE_EQUEUE_ONEMPTY_, QACTIVE_EQUEUE_WAIT_, QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, QF_PTR_AT_, QS_aoObj_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_EQC_, QS_OBJ_, QS_QF_ACTIVE_GET, QS_QF_ACTIVE_GET_LAST, QS_TIME_, QS_U8_, and QEvent::sig.

Referenced by QF_run(), QK_sched_(), and QK_schedExt_().

uint32_t QF_getQueueMargin ( uint8_t  prio)

This function returns the margin of the given event queue.

This function returns the margin of the given event queue of an active object with priority prio. (QF priorities start with 1 and go up to QF_MAX_ACTIVE.) The margin is the minimal number of free events encountered in the given queue since system startup.

Note:
QF_getQueueMargin() is available only when the native QF event queue implementation is used. Requesting the queue margin of an unused priority level raises an assertion in the QF. (A priority level becomes used in QF after the call to the QF_add_() function.)

Definition at line 87 of file qa_get_.c.

References Q_REQUIRE, QF_active_, and QF_MAX_ACTIVE.