QP/C  7.3.4
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qpc.h
Go to the documentation of this file.
1//$file${include::qpc.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpc.qm
4// File: ${include::qpc.h}
5//
6// This code has been generated by QM 6.1.1 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// This code is covered by the following QP license:
10// License # : LicenseRef-QL-dual
11// Issued to : Any user of the QP/C real-time embedded framework
12// Framework(s) : qpc
13// Support ends : 2024-12-31
14// License scope:
15//
16// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17//
18// Q u a n t u m L e a P s
19// ------------------------
20// Modern Embedded Software
21//
22// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
23//
24// This software is dual-licensed under the terms of the open source GNU
25// General Public License version 3 (or any later version), or alternatively,
26// under the terms of one of the closed source Quantum Leaps commercial
27// licenses.
28//
29// The terms of the open source GNU General Public License version 3
30// can be found at: <www.gnu.org/licenses/gpl-3.0>
31//
32// The terms of the closed source Quantum Leaps commercial licenses
33// can be found at: <www.state-machine.com/licensing>
34//
35// Redistributions in source code must retain this top-level comment block.
36// Plagiarizing this software to sidestep the license obligations is illegal.
37//
38// Contact information:
39// <www.state-machine.com/licensing>
40// <info@state-machine.com>
41//
42//$endhead${include::qpc.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43#ifndef QPC_H_
44#define QPC_H_
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50//============================================================================
51#include "qp_port.h" // QP port from the port directory
52#include "qsafe.h" // QP Functional Safety (FuSa) Subsystem
53#ifdef Q_SPY // software tracing enabled?
54 #include "qs_port.h" // QS/C port from the port directory
55#else
56 #include "qs_dummy.h" // QS/C dummy (inactive) interface
57#endif
58
59//============================================================================
60#ifndef QP_API_VERSION
61
62#define QP_API_VERSION 0
63
64#endif // #ifndef QP_API_VERSION
65
66//============================================================================
67// QP API compatibility layer...
68
69#if (QP_API_VERSION < 730)
70
71//! @deprecated plain 'char' is no longer forbidden in MISRA-C:2023
72typedef char char_t;
73
74//! @deprecated assertion failure handler
75//! Use Q_onError() instead.
76#define Q_onAssert(module_, id_) Q_onError(module_, id_)
77
78//! @deprecated #Q_NASSERT preprocessor switch to disable QP assertions
79#ifdef Q_NASSERT
80
81 // #Q_UNSAFE now replaces the functionality of Q_NASSERT
82 #define Q_UNSAFE
83
84 //! @deprecated general purpose assertion with user-specified ID
85 //! number that **always** evaluates the `expr_` expression.
86 #define Q_ALLEGE_ID(id_, expr_) ((void)(expr_))
87
88#else // QP FuSa Subsystem enabled
89
90 //! @deprecated general purpose assertion with user-specified ID
91 //! number that **always** evaluates the `expr_` expression.
92 //! @note
93 //! The use of this macro is no longer recommended.
94 #define Q_ALLEGE_ID(id_, expr_) if (!(expr_)) { \
95 QF_CRIT_STAT \
96 QF_CRIT_ENTRY(); \
97 Q_onError(&Q_this_module_[0], (id_)); \
98 QF_CRIT_EXIT(); \
99 } else ((void)0)
100
101#endif
102
103//! @deprecated general purpose assertion without ID number
104//! that **always** evaluates the `expr_` expression.
105//! Instead of ID number, this macro is based on the standard
106//! `__LINE__` macro.
107//!
108//! @note The use of this macro is no longer recommended.
109#define Q_ALLEGE(expr_) Q_ALLEGE_ID(__LINE__, (expr_))
110
111//! Static (compile-time) assertion.
112//! @deprecated
113//! Use Q_ASSERT_STATIC() or better yet `_Static_assert()` instead.
114#define Q_ASSERT_COMPILE(expr_) Q_ASSERT_STATIC(expr_)
115
116//! @static @public @memberof QF
117//! @deprecated
118static inline void QF_psInit(
119 QSubscrList * const subscrSto,
120 enum_t const maxSignal)
121{
122 QActive_psInit(subscrSto, maxSignal);
123}
124
125//! @deprecated instead use: QASM_INIT()
126#define QHSM_INIT(me_, par_, qsId_) QASM_INIT((me_), (par_), (qsId_))
127
128//! @deprecated instead use: QASM_DISPATCH()
129#define QHSM_DISPATCH(me_, e_, qsId_) QASM_DISPATCH((me_), (e_), (qsId_))
130
131//! @deprecated instead use: QASM_IS_IN()
132#define QHsm_isIn(me_, state_) QHsm_isIn_((QAsm *)(me_), (state_))
133
134//============================================================================
135#if (QP_API_VERSION < 691)
136
137//! @deprecated enable the QS global filter
138#define QS_FILTER_ON(rec_) QS_GLB_FILTER((rec_))
139
140//! @deprecated disable the QS global filter
141#define QS_FILTER_OFF(rec_) QS_GLB_FILTER(-(rec_))
142
143//! @deprecated enable the QS local filter for SM (state machine) object
144#define QS_FILTER_SM_OBJ(obj_) ((void)0)
145
146//! @deprecated enable the QS local filter for AO (active objects)
147#define QS_FILTER_AO_OBJ(obj_) ((void)0)
148
149//! @deprecated enable the QS local filter for MP (memory pool) object
150#define QS_FILTER_MP_OBJ(obj_) ((void)0)
151
152//! @deprecated enable the QS local filter for EQ (event queue) object
153#define QS_FILTER_EQ_OBJ(obj_) ((void)0)
154
155//! @deprecated enable the QS local filter for TE (time event) object
156#define QS_FILTER_TE_OBJ(obj_) ((void)0)
157
158#ifdef Q_SPY
159
160//! @deprecated local Filter for a generic application object `obj_`.
161#define QS_FILTER_AP_OBJ(obj_) (QS_filt_.loc_AP = (obj_))
162
163//! @deprecated begin of a user QS record, instead use QS_BEGIN_ID()
164#define QS_BEGIN(rec_, obj_) \
165 if (((QS_filt_.glb[(uint_fast8_t)(rec_) >> 3U] \
166 & (1U << ((uint_fast8_t)(rec_) & 7U))) != 0U) \
167 && ((QS_priv_.locFilter_AP == (void *)0) \
168 || (QS_priv_.locFilter_AP == (obj_)))) \
169 { \
170 QS_CRIT_STAT \
171 QS_CRIT_ENTRY(); \
172 QS_beginRec_((uint_fast8_t)(rec_)); \
173 QS_TIME_PRE_(); {
174
175//! @deprecated Output formatted uint32_t to the QS record
176#define QS_U32_HEX(width_, data_) \
177 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | QS_HEX_FMT, (data_)))
178
179#else
180
181#define QS_FILTER_AP_OBJ(obj_) ((void)0)
182#define QS_BEGIN(rec_, obj_) if (false) {
183#define QS_U32_HEX(width_, data_) ((void)0)
184
185#endif
186
187//============================================================================
188#if (QP_API_VERSION < 660)
189
190//! @deprecated casting to QXThreadHandler
191//! instead use: the new signature of QXThreadHandler and don't cast
192#define Q_XTHREAD_CAST(handler_) ((QXThreadHandler)(handler_))
193
194//============================================================================
195#if (QP_API_VERSION < 580)
196
197//! @deprecated instead use: QASM_INIT()
198#define QMSM_INIT(me_, par_, qsId_) QASM_INIT((me_), (par_), (qsId_))
199
200//! @deprecated instead use: QASM_DISPATCH()
201#define QMSM_DISPATCH(me_, e_, qsId_) QASM_DISPATCH((me_), (e_), (qsId_))
202
203#endif // QP_API_VERSION < 580
204#endif // QP_API_VERSION < 660
205#endif // QP_API_VERSION < 691
206#endif // QP_API_VERSION < 700
207
208#ifdef __cplusplus
209}
210#endif
211
212#endif // QPC_H_
static void QF_psInit(QSubscrList *const subscrSto, enum_t const maxSignal)
Definition qpc.h:118
int enum_t
Definition qp.h:109
Sample QP/C port.
char char_t
Definition qpc.h:72
Sample QS/C port.
QP Functional Safety (FuSa) Subsystem.
Subscriber List (for publish-subscribe)
Definition qp.h:779