QP/C
Functions
qf_pspub.c File Reference

QF_publish() implementation. More...

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

Go to the source code of this file.

Functions

void QF_publish (QEvent const *e, void const *sender)
 Publish event to the framework.

Detailed Description

QF_publish() implementation.

Definition in file qf_pspub.c.


Function Documentation

void QF_publish ( QEvent const *  e,
void const *  sender 
)

Publish event to the framework.

This function posts (using the FIFO policy) the event e to ALL active objects that have subscribed to the signal e->sig. This function is designed to be callable from any part of the system, including ISRs, device drivers, and active objects.

In the general case, event publishing requires multi-casting the event to multiple subscribers. This happens in the caller's thread with the scheduler locked to prevent preemptions during the multi-casting process. (Please note that the interrupts are not locked.)

Note:
this function should be called only via the macro QF_PUBLISH

Definition at line 43 of file qf_pspub.c.

References QSubscrList::bits, Q_ASSERT, Q_DIM, Q_REQUIRE, QACTIVE_POST, QF_active_, QF_EVT_POOL_ID_, QF_EVT_REF_CTR_, QF_EVT_REF_CTR_INC_, QF_gc(), QF_invPwr2Lkup, QF_log2Lkup, QF_maxSignal_, QF_PTR_AT_, QF_subscrList_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_OBJ_, QS_QF_PUBLISH, QS_TIME_, QS_U8_, and QEvent::sig.