QP/C  8.0.4
Real-Time Event Framework
Loading...
Searching...
No Matches
qp_pkg.h
Go to the documentation of this file.
1//============================================================================
2// QP/C Real-Time Event Framework (RTEF)
3//
4// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
5//
6// Q u a n t u m L e a P s
7// ------------------------
8// Modern Embedded Software
9//
10// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
11//
12// This software is dual-licensed under the terms of the open-source GNU
13// General Public License (GPL) or under the terms of one of the closed-
14// source Quantum Leaps commercial licenses.
15//
16// Redistributions in source code must retain this top-level comment block.
17// Plagiarizing this software to sidestep the license obligations is illegal.
18//
19// NOTE:
20// The GPL does NOT permit the incorporation of this code into proprietary
21// programs. Please contact Quantum Leaps for commercial licensing options,
22// which expressly supersede the GPL and are designed explicitly for
23// closed-source distribution.
24//
25// Quantum Leaps contact information:
26// <www.state-machine.com/licensing>
27// <info@state-machine.com>
28//============================================================================
29#ifndef QP_PKG_H_
30#define QP_PKG_H_
31
32//============================================================================
33// helper macros...
34#define QACTIVE_CAST_(ptr_) ((QActive *)(ptr_))
35#define QP_DIS_UPDATE_(T_, org_) ((T_)~(org_))
36#define QP_DIS_VERIFY_(T_, org_, dis_) ((T_)(org_) == (T_)~(dis_))
37
38//============================================================================
39typedef struct {
40#if (QF_MAX_EPOOL > 0U)
41 QF_EPOOL_TYPE_ ePool_[QF_MAX_EPOOL]; //!< @private @memberof QF_Attr
42 uint_fast8_t maxPool_; //!< @private @memberof QF_Attr
43#else
44 uint8_t dummy; //!< @private @memberof QF_Attr
45#endif // (QF_MAX_EPOOL == 0U)
46} QF_Attr;
47
48extern QF_Attr QF_priv_; //!< @static @private @memberof QF
49
50//! @static @private @memberof QF
51void QF_bzero_(
52 void * const start,
53 uint_fast16_t const len);
54
55//! @static @private @memberof QActive
57
58//============================================================================
59//! @static @private @memberof QActive
61
62//! @static @private @memberof QActive
64
65//============================================================================
66//! @static @private @memberof QTimeEvt
68
69//============================================================================
70// Bitmasks are for the QTimeEvt::flags attribute
71#define QTE_FLAG_IS_LINKED (1U << 7U)
72#define QTE_FLAG_WAS_DISARMED (1U << 6U)
73
74//============================================================================
75//! @private @memberof QEvt
76static inline void QEvt_refCtr_inc_(QEvt const * const me) {
77 // NOTE: this function must be called inside a critical section
78 uint8_t const rc = me->refCtr_ + 1U;
79 ((QEvt *)me)->refCtr_ = rc; // cast away 'const'
80}
81
82//! @private @memberof QEvt
83static inline void QEvt_refCtr_dec_(QEvt const * const me) {
84 // NOTE: this function must be called inside a critical section
85 uint8_t const rc = me->refCtr_ - 1U;
86 ((QEvt *)me)->refCtr_ = rc; // cast away 'const'
87}
88
89#endif // QP_PKG_H_
void QF_bzero_(void *const start, uint_fast16_t const len)
Definition qf_act.c:52
QF_Attr QF_priv_
Definition qp_pkg.h:48
#define QF_EPOOL_TYPE_
Definition qk.h:108
uint16_t QSignal
The signal of event QEvt.
Definition qp.h:105
#define QF_MAX_TICK_RATE
Maximum # clock tick rates in the system (0..15)
Definition qp_config.h:143
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64)
Definition qp_config.h:123
#define QF_MAX_EPOOL
Maximum # event pools in the system (0..15)
Definition qp_config.h:133
Active object class (based on the QHsm implementation strategy)
Definition qp.h:505
QSubscrList * QActive_subscrList_
Static (one per-class) pointer to all subscriber AOs for a given event signal.
Definition qp_pkg.h:60
QSignal QActive_maxPubSignal_
Static (one per-class) maximum published signal (the size of the subscrList_ array)
Definition qp_pkg.h:63
QActive * QActive_registry_[QF_MAX_ACTIVE+1U]
Static (one per-class) array of registered active objects.
Definition qp_pkg.h:56
Event class.
Definition qp.h:112
static void QEvt_refCtr_dec_(QEvt const *const me)
Definition qp_pkg.h:83
uint8_t volatile refCtr_
Event reference counter.
Definition qp.h:115
static void QEvt_refCtr_inc_(QEvt const *const me)
Definition qp_pkg.h:76
Private attributes of the QF framework.
Definition qp_pkg.h:39
uint_fast8_t maxPool_
Definition qp_pkg.h:42
QF_EPOOL_TYPE_ ePool_[QF_MAX_EPOOL]
Definition qp_pkg.h:41
Subscriber List (for publish-subscribe)
Definition qp.h:496
Time Event class.
Definition qp.h:621
QTimeEvt QTimeEvt_timeEvtHead_[QF_MAX_TICK_RATE]
Static array of heads of linked lists of time events (one for every clock tick rate)
Definition qp_pkg.h:67