QP/C  8.0.2
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qp_pkg.h
Go to the documentation of this file.
1//============================================================================
2// QP/C Real-Time Embedded Framework (RTEF)
3// Version 8.0.2
4//
5// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
6//
7// Q u a n t u m L e a P s
8// ------------------------
9// Modern Embedded Software
10//
11// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
12//
13// This software is dual-licensed under the terms of the open-source GNU
14// General Public License (GPL) or under the terms of one of the closed-
15// source Quantum Leaps commercial licenses.
16//
17// Redistributions in source code must retain this top-level comment block.
18// Plagiarizing this software to sidestep the license obligations is illegal.
19//
20// NOTE:
21// The GPL does NOT permit the incorporation of this code into proprietary
22// programs. Please contact Quantum Leaps for commercial licensing options,
23// which expressly supersede the GPL and are designed explicitly for
24// closed-source distribution.
25//
26// Quantum Leaps contact information:
27// <www.state-machine.com/licensing>
28// <info@state-machine.com>
29//============================================================================
30#ifndef QP_PKG_H_
31#define QP_PKG_H_
32
33//============================================================================
34#define QACTIVE_CAST_(ptr_) ((QActive *)(ptr_))
35#define Q_PTR2UINT_CAST_(ptr_) ((uintptr_t)(ptr_))
36
37//============================================================================
38typedef struct {
39#if (QF_MAX_EPOOL > 0U)
40 QF_EPOOL_TYPE_ ePool_[QF_MAX_EPOOL]; //!< @private @memberof QF_Attr
41 uint_fast8_t maxPool_; //!< @private @memberof QF_Attr
42#else
43 uint8_t dummy; //!< @private @memberof QF_Attr
44#endif // (QF_MAX_EPOOL == 0U)
45} QF_Attr;
46
47extern QF_Attr QF_priv_; //!< @static @private @memberof QF
48
49//! @static @private @memberof QF
50void QF_bzero_(
51 void * const start,
52 uint_fast16_t const len);
53
54//============================================================================
55// Bitmasks are for the QTimeEvt::flags attribute
56#define QTE_FLAG_IS_LINKED (1U << 7U)
57#define QTE_FLAG_WAS_DISARMED (1U << 6U)
58
59//============================================================================
60//! @private @memberof QEvt
61static inline void QEvt_refCtr_inc_(QEvt const * const me) {
62 // NOTE: this function must be called inside a critical section
63 uint8_t const rc = me->refCtr_ + 1U;
64 ((QEvt *)me)->refCtr_ = rc; // cast away 'const'
65}
66
67//! @private @memberof QEvt
68static inline void QEvt_refCtr_dec_(QEvt const * const me) {
69 // NOTE: this function must be called inside a critical section
70 uint8_t const rc = me->refCtr_ - 1U;
71 ((QEvt *)me)->refCtr_ = rc; // cast away 'const'
72}
73
74#endif // QP_PKG_H_
void QF_bzero_(void *const start, uint_fast16_t const len)
Definition qf_act.c:53
QF_Attr QF_priv_
Definition qp_pkg.h:47
#define QF_EPOOL_TYPE_
Definition qk.h:109
#define QF_MAX_EPOOL
Maximum # event pools in the system (0..15)
Definition qp_config.h:133
Event class.
Definition qp.h:115
static void QEvt_refCtr_dec_(QEvt const *const me)
Definition qp_pkg.h:68
uint8_t volatile refCtr_
Event reference counter.
Definition qp.h:118
static void QEvt_refCtr_inc_(QEvt const *const me)
Definition qp_pkg.h:61
Private attributes of the QF framework.
Definition qp_pkg.h:38
uint_fast8_t maxPool_
Definition qp_pkg.h:41
QF_EPOOL_TYPE_ ePool_[QF_MAX_EPOOL]
Definition qp_pkg.h:40