QP/C
8.1.1
Real-Time Event Framework
Loading...
Searching...
No Matches
qpc.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 QPC_H_
30
#define QPC_H_
31
32
#include "
qp_port.h
"
// QP port from the port directory
33
#include "
qsafe.h
"
// QP Functional Safety (FuSa) Subsystem
34
#ifdef Q_SPY
// software tracing enabled?
35
#include "
qs_port.h
"
// QS/C port from the port directory
36
#else
37
#include "qs_dummy.h"
// QS/C dummy (inactive) interface
38
#endif
39
40
#ifndef QP_API_VERSION
41
#define QP_API_VERSION 0
42
#endif
43
44
// QP API compatibility layer...
45
46
#ifdef Q_SIGNAL_SIZE
47
_Static_assert
(Q_SIGNAL_SIZE == 2U,
48
"Q_SIGNAL_SIZE must be 2 bytes (16-bit signal space)"
);
49
#endif
50
51
// version 8.1.0 -------------------------------------------------------------
52
#if (QP_API_VERSION < 810)
53
54
#ifdef Q_SPY
55
56
//! @deprecated instead use: QS_Groups
57
enum
QS_Groups_old
{
58
QS_ALL_RECORDS
=
QS_GRP_ALL
,
59
QS_SM_RECORDS
=
QS_GRP_SM
,
60
QS_AO_RECORDS
=
QS_GRP_AO
,
61
QS_EQ_RECORDS
=
QS_GRP_EQ
,
62
QS_MP_RECORDS
=
QS_GRP_MP
,
63
QS_TE_RECORDS
=
QS_GRP_TE
,
64
QS_QF_RECORDS
=
QS_GRP_QF
,
65
QS_SC_RECORDS
=
QS_GRP_SC
,
66
QS_SEM_RECORDS
=
QS_GRP_SEM
,
67
QS_MTX_RECORDS
=
QS_GRP_MTX
,
68
QS_U0_RECORDS
=
QS_GRP_U0
,
69
QS_U1_RECORDS
=
QS_GRP_U1
,
70
QS_U2_RECORDS
=
QS_GRP_U2
,
71
QS_U3_RECORDS
=
QS_GRP_U3
,
72
QS_U4_RECORDS
=
QS_GRP_U4
,
73
QS_UA_RECORDS
=
QS_GRP_UA
,
74
};
75
76
//! @deprecated instead use: QS_LocGroups
77
enum
QS_LocGroups_old
{
78
QS_ALL_IDS
=
QS_IDS_ALL
,
79
QS_AO_IDS
=
QS_IDS_AO
,
80
QS_EP_IDS
=
QS_IDS_EP
,
81
QS_EQ_IDS
=
QS_IDS_EQ
,
82
QS_AP_IDS
=
QS_IDS_AP
,
83
};
84
#define QS_AO_ID QS_ID_AO
85
#define QS_EP_ID QS_ID_EP
86
#define QS_EQ_ID QS_ID_EQ
87
#define QS_AP_ID QS_ID_AP
88
89
//! @deprecated instead use: enum QS_ObjKind
90
enum
QS_ObjKind_old
{
91
SM_OBJ
=
QS_OBJ_SM
,
92
AO_OBJ
=
QS_OBJ_AO
,
93
MP_OBJ
=
QS_OBJ_MP
,
94
EQ_OBJ
=
QS_OBJ_EQ
,
95
TE_OBJ
=
QS_OBJ_TE
,
96
AP_OBJ
=
QS_OBJ_AP
,
97
SM_AO_OBJ
=
QS_OBJ_SM_AO
,
98
};
99
100
#endif
// Q_SPY
101
102
// version 8.0.0 -------------------------------------------------------------
103
#if (QP_API_VERSION < 800)
104
105
//! @deprecated QM_SUPER_SUB(), submachines no longer supported
106
#define QM_SUPER_SUB(host_) error "submachines no longer supported"
107
108
//! @deprecated QM_TRAN_EP(), submachines no longer supported
109
#define QM_TRAN_EP(tatbl_) error "submachines no longer supported"
110
111
//! @deprecated QM_TRAN_XP(), submachines no longer supported
112
#define QM_TRAN_XP(xp_, tatbl_) error "submachines no longer supported"
113
114
#ifdef QEVT_DYN_CTOR
115
//! @deprecated QEVT_DYN_CTOR(), please use #QEVT_PAR_INIT
116
#define QEVT_PAR_INIT
117
#endif
118
119
//! @deprecated plain 'char' is no longer forbidden in MISRA-C:2023
120
typedef
char
char_t
;
121
122
//! @deprecated Macro for starting an Active Object.
123
//! Use QActive::QActive_start() instead.
124
#define QACTIVE_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) \
125
(QActive_start((QActive *)(me_), (prioSpec_), \
126
(qSto_), (qLen_), (stkSto_), (stkSize_), (par_)))
127
128
//! @deprecated Macro for starting an eXtended Thread.
129
//! Use QXThread::QXThread_start() instead.
130
#define QXTHREAD_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) \
131
(QXThread_start((QXThread *)(me_), (prioSpec_), \
132
(qSto_), (qLen_), (stkSto_), (stkSize_), (par_)))
133
134
//! @deprecated assertion failure handler.
135
//! Use Q_onError() instead.
136
#define Q_onAssert(module_, id_) Q_onError(module_, id_)
137
138
//! @deprecated #Q_NASSERT preprocessor switch to disable QP assertions
139
#ifdef Q_NASSERT
140
141
// #Q_UNSAFE now replaces the functionality of Q_NASSERT
142
#define Q_UNSAFE
143
144
//! @deprecated general purpose assertion with user-specified ID
145
//! number that **always** evaluates the `expr_` expression.
146
#define Q_ALLEGE_ID(id_, expr_) ((void)(expr_))
147
148
#elif defined Q_UNSAFE
149
150
//! @deprecated general purpose assertion with user-specified ID
151
//! number that **always** evaluates the `expr_` expression.
152
#define Q_ALLEGE_ID(id_, expr_) ((void)(expr_))
153
154
#else
// QP FuSa Subsystem enabled
155
156
//! @deprecated general purpose assertion with user-specified ID
157
//! number that **always** evaluates the `expr_` expression.
158
//! @note
159
//! The use of this macro is no longer recommended.
160
#define Q_ALLEGE_ID(id_, expr_) if (!(expr_)) { \
161
QF_CRIT_STAT \
162
QF_CRIT_ENTRY(); \
163
Q_onError(&Q_this_module_[0], (id_)); \
164
QF_CRIT_EXIT(); \
165
} else ((void)0)
166
167
#endif
168
169
//! @deprecated general purpose assertion without ID number
170
//! that **always** evaluates the `expr_` expression.
171
//! Instead of ID number, this macro is based on the standard
172
//! `__LINE__` macro.
173
//!
174
//! @note The use of this macro is no longer recommended.
175
#define Q_ALLEGE(expr_) Q_ALLEGE_ID(__LINE__, (expr_))
176
177
//! Static (compile-time) assertion.
178
//! @deprecated
179
//! Use Q_ASSERT_STATIC() or better yet `_Static_assert()` instead.
180
#define Q_ASSERT_COMPILE(expr_) Q_ASSERT_STATIC(expr_)
181
182
//! @static @public @memberof QF
183
//! @deprecated
184
static
inline
void
QF_psInit
(
185
QSubscrList
*
const
subscrSto,
186
enum_t
const
maxSignal)
187
{
188
QActive_psInit(subscrSto, maxSignal);
189
}
190
191
//! @deprecated instead use: QASM_INIT()
192
#define QHSM_INIT(me_, par_, qsId_) QASM_INIT((me_), (par_), (qsId_))
193
194
//! @deprecated instead use: QASM_DISPATCH()
195
#define QHSM_DISPATCH(me_, e_, qsId_) QASM_DISPATCH((me_), (e_), (qsId_))
196
197
//! @deprecated instead use: QASM_IS_IN()
198
#define QHsm_isIn(me_, state_) QASM_IS_IN((QAsm *)(me_), (state_))
199
200
#define QF_PUBLISH(e_, sender_) QACTIVE_PUBLISH((e_), (sender_))
201
#define QF_TICK_X(tickRate_, sender_) QTIMEEVT_TICK_X((tickRate_), (sender_))
202
#define QF_TICK(sender_) QTIMEEVT_TICK(sender_)
203
204
//! @deprecated instead use: QActive::QActive_getQueueMin()
205
#define QF_getQueueMin(prio_) (QActive_getQueueMin((prio_)))
206
207
#endif
// QP_API_VERSION < 800
208
#endif
// QP_API_VERSION < 810
209
210
#endif
// QPC_H_
QF::QF_psInit
static void QF_psInit(QSubscrList *const subscrSto, enum_t const maxSignal)
Definition
qpc.h:184
enum_t
int enum_t
Definition
qp.h:88
qp_port.h
Sample QP/C port.
QS_LocGroups_old
QS_LocGroups_old
Definition
qpc.h:77
QS_EP_IDS
@ QS_EP_IDS
Definition
qpc.h:80
QS_AO_IDS
@ QS_AO_IDS
Definition
qpc.h:79
QS_EQ_IDS
@ QS_EQ_IDS
Definition
qpc.h:81
QS_ALL_IDS
@ QS_ALL_IDS
Definition
qpc.h:78
QS_AP_IDS
@ QS_AP_IDS
Definition
qpc.h:82
char_t
char char_t
Definition
qpc.h:120
QS_ObjKind_old
QS_ObjKind_old
Definition
qpc.h:90
SM_OBJ
@ SM_OBJ
Definition
qpc.h:91
EQ_OBJ
@ EQ_OBJ
Definition
qpc.h:94
AO_OBJ
@ AO_OBJ
Definition
qpc.h:92
TE_OBJ
@ TE_OBJ
Definition
qpc.h:95
AP_OBJ
@ AP_OBJ
Definition
qpc.h:96
SM_AO_OBJ
@ SM_AO_OBJ
Definition
qpc.h:97
MP_OBJ
@ MP_OBJ
Definition
qpc.h:93
QS_Groups_old
QS_Groups_old
Definition
qpc.h:57
QS_U2_RECORDS
@ QS_U2_RECORDS
Definition
qpc.h:70
QS_MP_RECORDS
@ QS_MP_RECORDS
Definition
qpc.h:62
QS_TE_RECORDS
@ QS_TE_RECORDS
Definition
qpc.h:63
QS_SM_RECORDS
@ QS_SM_RECORDS
Definition
qpc.h:59
QS_U0_RECORDS
@ QS_U0_RECORDS
Definition
qpc.h:68
QS_U3_RECORDS
@ QS_U3_RECORDS
Definition
qpc.h:71
QS_MTX_RECORDS
@ QS_MTX_RECORDS
Definition
qpc.h:67
QS_U4_RECORDS
@ QS_U4_RECORDS
Definition
qpc.h:72
QS_AO_RECORDS
@ QS_AO_RECORDS
Definition
qpc.h:60
QS_SEM_RECORDS
@ QS_SEM_RECORDS
Definition
qpc.h:66
QS_QF_RECORDS
@ QS_QF_RECORDS
Definition
qpc.h:64
QS_SC_RECORDS
@ QS_SC_RECORDS
Definition
qpc.h:65
QS_U1_RECORDS
@ QS_U1_RECORDS
Definition
qpc.h:69
QS_EQ_RECORDS
@ QS_EQ_RECORDS
Definition
qpc.h:61
QS_ALL_RECORDS
@ QS_ALL_RECORDS
Definition
qpc.h:58
QS_UA_RECORDS
@ QS_UA_RECORDS
Definition
qpc.h:73
QS_GRP_U0
#define QS_GRP_U0
Definition
qs.h:186
QS_IDS_EQ
#define QS_IDS_EQ
Definition
qs.h:211
QS_IDS_AP
#define QS_IDS_AP
Definition
qs.h:212
QS_GRP_MTX
#define QS_GRP_MTX
Definition
qs.h:185
QS_GRP_SC
#define QS_GRP_SC
Definition
qs.h:183
QS_GRP_U2
#define QS_GRP_U2
Definition
qs.h:188
QS_GRP_ALL
#define QS_GRP_ALL
Definition
qs.h:176
QS_GRP_TE
#define QS_GRP_TE
Definition
qs.h:181
QS_GRP_U1
#define QS_GRP_U1
Definition
qs.h:187
QS_GRP_U3
#define QS_GRP_U3
Definition
qs.h:189
QS_IDS_AO
#define QS_IDS_AO
Definition
qs.h:209
QS_GRP_EQ
#define QS_GRP_EQ
Definition
qs.h:179
QS_GRP_MP
#define QS_GRP_MP
Definition
qs.h:180
QS_GRP_SM
#define QS_GRP_SM
Definition
qs.h:177
QS_GRP_AO
#define QS_GRP_AO
Definition
qs.h:178
QS_IDS_ALL
#define QS_IDS_ALL
Definition
qs.h:208
QS_GRP_U4
#define QS_GRP_U4
Definition
qs.h:190
QS_GRP_UA
#define QS_GRP_UA
Definition
qs.h:191
QS_IDS_EP
#define QS_IDS_EP
Definition
qs.h:210
QS_GRP_SEM
#define QS_GRP_SEM
Definition
qs.h:184
QS_GRP_QF
#define QS_GRP_QF
Definition
qs.h:182
QS_OBJ_SM_AO
@ QS_OBJ_SM_AO
state machine AND active object
Definition
qs.h:576
QS_OBJ_SM
@ QS_OBJ_SM
State Machine.
Definition
qs.h:570
QS_OBJ_AP
@ QS_OBJ_AP
generic Application-specific object
Definition
qs.h:575
QS_OBJ_EQ
@ QS_OBJ_EQ
Event Queue.
Definition
qs.h:573
QS_OBJ_AO
@ QS_OBJ_AO
Active Object.
Definition
qs.h:571
QS_OBJ_TE
@ QS_OBJ_TE
Time Event.
Definition
qs.h:574
QS_OBJ_MP
@ QS_OBJ_MP
Event Pool.
Definition
qs.h:572
qs_port.h
Sample QS/C port.
qsafe.h
QP Functional Safety (FuSa) Subsystem.
QSubscrList
Subscriber List (for publish-subscribe).
Definition
qp.h:419
qpc
include
qpc.h
© 2005-
Quantum Leaps
|
Using Online Help
|
QP/C 8.1.1
| created with
Spexygen
© 2005-
Quantum Leaps
|
Using Online Help
|
QP/C 8.1.1
| created with
Spexygen