QP/C++  7.4.0-rc.1
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qs.hpp
Go to the documentation of this file.
1//$file${include::qs.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpcpp.qm
4// File: ${include::qs.hpp}
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) : qpcpp
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::qs.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43#ifndef QS_HPP_
44#define QS_HPP_
45
46#ifndef Q_SPY
47#error "Q_SPY must be defined to include qs.hpp"
48#endif
49
50//============================================================================
51//! @cond INTERNAL
52
53#ifndef QS_CTR_SIZE
54#define QS_CTR_SIZE 2U
55#endif
56
57#ifndef QS_TIME_SIZE
58#define QS_TIME_SIZE 4U
59#endif
60
61//! @endcond
62//============================================================================
63
64//$declare${QS::types} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
65namespace QP {
66
67//${QS::types::QSpyPre} ......................................................
68//! pre-defined QS record IDs
69enum QSpyPre : std::int8_t {
70 // [0] QS session (not maskable)
71 QS_EMPTY, //!< QS record for cleanly starting a session
72
73 // [1] SM records
74 QS_QEP_STATE_ENTRY, //!< a state was entered
75 QS_QEP_STATE_EXIT, //!< a state was exited
76 QS_QEP_STATE_INIT, //!< an initial transition was taken in a state
77 QS_QEP_INIT_TRAN, //!< the top-most initial transition was taken
78 QS_QEP_INTERN_TRAN, //!< an internal transition was taken
79 QS_QEP_TRAN, //!< a regular transition was taken
80 QS_QEP_IGNORED, //!< an event was ignored (silently discarded)
81 QS_QEP_DISPATCH, //!< an event was dispatched (begin of RTC step)
82 QS_QEP_UNHANDLED, //!< an event was un-handled due to a guard
83
84 // [10] Active Object (AO) records
85 QS_QF_ACTIVE_DEFER, //!< AO deferred an event
86 QS_QF_ACTIVE_RECALL, //!< AO recalled an event
87 QS_QF_ACTIVE_SUBSCRIBE, //!< an AO subscribed to an event
88 QS_QF_ACTIVE_UNSUBSCRIBE, //!< an AO unsubscribed to an event
89 QS_QF_ACTIVE_POST, //!< an event was posted (FIFO) directly to AO
90 QS_QF_ACTIVE_POST_LIFO, //!< an event was posted (LIFO) directly to AO
91 QS_QF_ACTIVE_GET, //!< AO got an event and its queue is not empty
92 QS_QF_ACTIVE_GET_LAST,//!< AO got an event and its queue is empty
93 QS_QF_ACTIVE_RECALL_ATTEMPT, //!< AO attempted to recall an event
94
95 // [19] Event Queue (EQ) records
96 QS_QF_EQUEUE_POST, //!< an event was posted (FIFO) to a raw queue
97 QS_QF_EQUEUE_POST_LIFO, //!< an event was posted (LIFO) to a raw queue
98 QS_QF_EQUEUE_GET, //!< get an event and queue still not empty
99 QS_QF_EQUEUE_GET_LAST,//!< get the last event from the queue
100
101 // [23] Framework (QF) records
102 QS_QF_NEW_ATTEMPT, //!< an attempt to allocate an event failed
103
104 // [24] Memory Pool (MP) records
105 QS_QF_MPOOL_GET, //!< a memory block was removed from memory pool
106 QS_QF_MPOOL_PUT, //!< a memory block was returned to memory pool
107
108 // [26] Additional Framework (QF) records
109 QS_QF_PUBLISH, //!< an event was published to active objects
110 QS_QF_NEW_REF, //!< new event reference was created
111 QS_QF_NEW, //!< new event was created
112 QS_QF_GC_ATTEMPT, //!< garbage collection attempt
113 QS_QF_GC, //!< garbage collection
114 QS_QF_TICK, //!< QTimeEvt tick was called
115
116 // [32] Time Event (TE) records
117 QS_QF_TIMEEVT_ARM, //!< a time event was armed
118 QS_QF_TIMEEVT_AUTO_DISARM, //!< a time event expired and was disarmed
119 QS_QF_TIMEEVT_DISARM_ATTEMPT,//!< attempt to disarm a disarmed QTimeEvt
120 QS_QF_TIMEEVT_DISARM, //!< true disarming of an armed time event
121 QS_QF_TIMEEVT_REARM, //!< rearming of a time event
122 QS_QF_TIMEEVT_POST, //!< a time event posted itself directly to an AO
123
124 // [38] Additional Framework (QF) records
125 QS_QF_DELETE_REF, //!< an event reference is about to be deleted
126 QS_QF_CRIT_ENTRY, //!< critical section was entered
127 QS_QF_CRIT_EXIT, //!< critical section was exited
128 QS_QF_ISR_ENTRY, //!< an ISR was entered
129 QS_QF_ISR_EXIT, //!< an ISR was exited
130 QS_QF_INT_DISABLE, //!< interrupts were disabled
131 QS_QF_INT_ENABLE, //!< interrupts were enabled
132
133 // [45] Additional Active Object (AO) records
134 QS_QF_ACTIVE_POST_ATTEMPT,//!< attempt to post an evt to AO failed
135
136 // [46] Additional Event Queue (EQ) records
137 QS_QF_EQUEUE_POST_ATTEMPT,//!< attempt to post evt to QEQueue failed
138
139 // [47] Additional Memory Pool (MP) records
140 QS_QF_MPOOL_GET_ATTEMPT, //!< attempt to get a memory block failed
141
142 // [48] Scheduler (SC) records
143 QS_SCHED_PREEMPT, //!< scheduler asynchronously preempted a task
144 QS_SCHED_RESTORE, //!< scheduler restored preempted task
145 QS_SCHED_LOCK, //!< scheduler was locked
146 QS_SCHED_UNLOCK, //!< scheduler was unlocked
147 QS_SCHED_NEXT, //!< scheduler started next task
148 QS_SCHED_IDLE, //!< scheduler restored the idle task
149
150 // [54] Miscellaneous QS records (not maskable)
151 QS_ENUM_DICT, //!< enumeration dictionary entry
152
153 // [55] Additional QEP records
154 QS_QEP_TRAN_HIST, //!< a tran to history was taken
155 QS_QEP_TRAN_EP, //!< a tran to entry point into a submachine
156 QS_QEP_TRAN_XP, //!< a tran to exit point out of a submachine
157
158 // [58] Miscellaneous QS records (not maskable)
159 QS_TEST_PAUSED, //!< test has been paused
160 QS_TEST_PROBE_GET, //!< reports that Test-Probe has been used
161 QS_SIG_DICT, //!< signal dictionary entry
162 QS_OBJ_DICT, //!< object dictionary entry
163 QS_FUN_DICT, //!< function dictionary entry
164 QS_USR_DICT, //!< user QS record dictionary entry
165 QS_TARGET_INFO, //!< reports the Target information
166 QS_TARGET_DONE, //!< reports completion of a user callback
167 QS_RX_STATUS, //!< reports QS data receive status
168 QS_QUERY_DATA, //!< reports the data from "current object" query
169 QS_PEEK_DATA, //!< reports the data from the PEEK query
170 QS_ASSERT_FAIL, //!< assertion failed in the code
171 QS_QF_RUN, //!< QF_run() was entered
172
173 // [71] Semaphore (SEM) records
174 QS_SEM_TAKE, //!< a semaphore was taken by a thread
175 QS_SEM_BLOCK, //!< a semaphore blocked a thread
176 QS_SEM_SIGNAL, //!< a semaphore was signaled
177 QS_SEM_BLOCK_ATTEMPT, //!< a semaphore blocked was attempted
178
179 // [75] Mutex (MTX) records
180 QS_MTX_LOCK, //!< a mutex was locked
181 QS_MTX_BLOCK, //!< a mutex blocked a thread
182 QS_MTX_UNLOCK, //!< a mutex was unlocked
183 QS_MTX_LOCK_ATTEMPT, //!< a mutex lock was attempted
184 QS_MTX_BLOCK_ATTEMPT, //!< a mutex blocking was attempted
185 QS_MTX_UNLOCK_ATTEMPT,//!< a mutex unlock was attempted
186
187 // [81]
188 QS_PRE_MAX //!< the # predefined signals
190
191//${QS::types::QSpyGroups} ...................................................
192//! QS-TX record groups for QS_GLB_FILTER()
193enum QSpyGroups : std::int16_t {
194 QS_ALL_RECORDS = 0xF0,//!< all maskable QS records
195 QS_SM_RECORDS, //!< State Machine QS records
196 QS_AO_RECORDS, //!< Active Object QS records
197 QS_EQ_RECORDS, //!< Event Queues QS records
198 QS_MP_RECORDS, //!< Memory Pools QS records
199 QS_TE_RECORDS, //!< Time Events QS records
200 QS_QF_RECORDS, //!< QF QS records
201 QS_SC_RECORDS, //!< Scheduler QS records
202 QS_SEM_RECORDS, //!< Semaphore QS records
203 QS_MTX_RECORDS, //!< Mutex QS records
204 QS_U0_RECORDS, //!< User Group 100-104 records
205 QS_U1_RECORDS, //!< User Group 105-109 records
206 QS_U2_RECORDS, //!< User Group 110-114 records
207 QS_U3_RECORDS, //!< User Group 115-119 records
208 QS_U4_RECORDS, //!< User Group 120-124 records
209 QS_UA_RECORDS //!< All User records
211
212//${QS::types::QSpyUserOffsets} ..............................................
213//! QS user record group offsets for QS_GLB_FILTER()
214enum QSpyUserOffsets : std::int16_t {
215 QS_USER = 100, //!< the first record available to QS users
216 QS_USER0 = QS_USER, //!< offset for User Group 0
217 QS_USER1 = QS_USER0 + 5, //!< offset for User Group 1
218 QS_USER2 = QS_USER1 + 5, //!< offset for User Group 2
219 QS_USER3 = QS_USER2 + 5, //!< offset for User Group 3
220 QS_USER4 = QS_USER3 + 5 //!< offset for User Group 4
222
223//${QS::types::QSpyIdOffsets} ................................................
224//! QS ID offsets for QS_LOC_FILTER()
225enum QSpyIdOffsets : std::int16_t {
226 QS_AO_ID = 0, //!< offset for AO priorities
227 QS_EP_ID = 64, //!< offset for event-pool IDs
228 QS_EQ_ID = 80, //!< offset for event-queue IDs
229 QS_AP_ID = 96 //!< offset for Application-specific IDs
231
232//${QS::types::QSpyIdGroups} .................................................
233//! QS ID groups for QS_LOC_FILTER()
234enum QSpyIdGroups : std::int16_t {
235 QS_ALL_IDS = 0xF0, //!< all QS IDs
236 QS_AO_IDS = 0x80 + QS_AO_ID, //!< AO IDs (priorities)
237 QS_EP_IDS = 0x80 + QS_EP_ID, //!< event-pool IDs
238 QS_EQ_IDS = 0x80 + QS_EQ_ID, //!< event-queue IDs
239 QS_AP_IDS = 0x80 + QS_AP_ID //!< Application-specific IDs
241
242//${QS::types::QSpyId} .......................................................
243struct QSpyId {
244 std::uint8_t m_prio; //!< prio. (qsId) for the QS "local filter"
245
246 // get the prio. (qsId) from the QSpyId object
247 std::uint_fast8_t getPrio() const noexcept {
248 return static_cast<std::uint_fast8_t>(m_prio);
249 }
250};
251
252//${QS::types::QSObj} ........................................................
253#if (QS_OBJ_PTR_SIZE == 2U)
254using QSObj = std::uint16_t;
255#endif // (QS_OBJ_PTR_SIZE == 2U)
256
257//${QS::types::QSObj} ........................................................
258#if (QS_OBJ_PTR_SIZE == 4U)
259using QSObj = std::uint32_t;
260#endif // (QS_OBJ_PTR_SIZE == 4U)
261
262//${QS::types::QSObj} ........................................................
263#if (QS_OBJ_PTR_SIZE == 8U)
264using QSObj = std::uint64_t;
265#endif // (QS_OBJ_PTR_SIZE == 8U)
266
267//${QS::types::QSFun} ........................................................
268#if (QS_FUN_PTR_SIZE == 2U)
269using QSFun = std::uint16_t;
270#endif // (QS_FUN_PTR_SIZE == 2U)
271
272//${QS::types::QSFun} ........................................................
273#if (QS_FUN_PTR_SIZE == 4U)
274using QSFun = std::uint32_t;
275#endif // (QS_FUN_PTR_SIZE == 4U)
276
277//${QS::types::QSFun} ........................................................
278#if (QS_FUN_PTR_SIZE == 8U)
279using QSFun = std::uint64_t;
280#endif // (QS_FUN_PTR_SIZE == 8U)
281
282//${QS::types::QSpyFunPtr} ...................................................
283using QSpyFunPtr = void (*)();
284
285//${QS::types::QSCtr} ........................................................
286#if (QS_CTR_SIZE == 2U)
287using QSCtr = std::uint16_t;
288#endif // (QS_CTR_SIZE == 2U)
289
290//${QS::types::QSCtr} ........................................................
291#if (QS_CTR_SIZE == 4U)
292using QSCtr = std::uint32_t;
293#endif // (QS_CTR_SIZE == 4U)
294
295//${QS::types::QSTimeCtr} ....................................................
296#if (QS_TIME_SIZE == 2U)
297using QSTimeCtr = std::uint16_t;
298#endif // (QS_TIME_SIZE == 2U)
299
300//${QS::types::QSTimeCtr} ....................................................
301#if (QS_TIME_SIZE == 4U)
302using QSTimeCtr = std::uint32_t;
303#endif // (QS_TIME_SIZE == 4U)
304
305} // namespace QP
306//$enddecl${QS::types} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
307//$declare${QS::filters} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
308namespace QP {
309namespace QS {
310
311//${QS::filters::Filter} .....................................................
312class Filter {
313public:
314 std::uint8_t glb[16];
315 std::uint8_t loc[16];
316}; // class Filter
317
318//${QS::filters::filt_} ......................................................
319extern Filter filt_;
320
321} // namespace QS
322} // namespace QP
323//$enddecl${QS::filters} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
324//$declare${QS-macros} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
325
326//${QS-macros::QS_INIT} ......................................................
327#define QS_INIT(arg_) (QP::QS::onStartup(arg_))
328
329//${QS-macros::QS_EXIT} ......................................................
330#define QS_EXIT() (QP::QS::onCleanup())
331
332//${QS-macros::QS_OUTPUT} ....................................................
333#define QS_OUTPUT() (QP::QS::doOutput())
334
335//${QS-macros::QS_RX_INPUT} ..................................................
336#define QS_RX_INPUT() (QP::QS::doInput())
337
338//${QS-macros::QS_GLB_FILTER} ................................................
339#define QS_GLB_FILTER(rec_) \
340 (QP::QS::glbFilter_(static_cast<std::int_fast16_t>(rec_)))
341
342//${QS-macros::QS_LOC_FILTER} ................................................
343#define QS_LOC_FILTER(qsId_) \
344 (QP::QS::locFilter_(static_cast<std::int_fast16_t>(qsId_)))
345
346//${QS-macros::QS_BEGIN_ID} ..................................................
347#define QS_BEGIN_ID(rec_, qsId_) \
348if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qsId_)) { \
349 QS_CRIT_STAT \
350 QS_CRIT_ENTRY(); \
351 QS_MEM_SYS(); \
352 QP::QS::beginRec_(static_cast<std::uint_fast8_t>(rec_)); \
353 QS_TIME_PRE_(); {
354
355//${QS-macros::QS_END} .......................................................
356#define QS_END() } \
357 QP::QS::endRec_(); \
358 QS_MEM_APP(); \
359 QS_CRIT_EXIT(); \
360}
361
362//${QS-macros::QS_FLUSH} .....................................................
363#define QS_FLUSH() (QP::QS::onFlush())
364
365//${QS-macros::QS_BEGIN_INCRIT} ..............................................
366#define QS_BEGIN_INCRIT(rec_, qsId_) \
367if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qsId_)) { \
368 QP::QS::beginRec_(rec_); \
369 QS_TIME_PRE_(); {
370
371//${QS-macros::QS_END_INCRIT} ................................................
372#define QS_END_INCRIT() } \
373 QP::QS::endRec_(); \
374}
375
376//${QS-macros::QS_GLB_CHECK_} ................................................
377#define QS_GLB_CHECK_(rec_) \
378((static_cast<std::uint_fast8_t>(QP::QS::filt_.glb[ \
379 static_cast<std::uint_fast8_t>(rec_) >> 3U]) \
380 & (static_cast<std::uint_fast8_t>(1U) \
381 << (static_cast<std::uint_fast8_t>(rec_) & 7U))) != 0U)
382
383//${QS-macros::QS_LOC_CHECK_} ................................................
384#define QS_LOC_CHECK_(qsId_) \
385((static_cast<std::uint_fast8_t>(QP::QS::filt_.loc \
386 [static_cast<std::uint_fast8_t>(qsId_) >> 3U]) \
387 & (static_cast<std::uint_fast8_t>(1U) \
388 << (static_cast<std::uint_fast8_t>(qsId_) & 7U))) != 0U)
389
390//${QS-macros::QS_REC_DONE} ..................................................
391#ifndef QS_REC_DONE
392#define QS_REC_DONE() (static_cast<void>(0))
393#endif // ndef QS_REC_DONE
394
395//${QS-macros::QS_I8} ........................................................
396#define QS_I8(width_, data_) \
397(QP::QS::u8_fmt_(static_cast<std::uint8_t>( \
398 (static_cast<std::uint8_t>(((width_) << 4U) & 0x7U)) \
399 | static_cast<std::uint8_t>(QP::QS::I8_ENUM_T)), (data_)))
400
401//${QS-macros::QS_U8} ........................................................
402#define QS_U8(width_, data_) \
403(QP::QS::u8_fmt_(static_cast<std::uint8_t>( \
404 (static_cast<std::uint8_t>((width_) << 4U)) \
405 | static_cast<std::uint8_t>(QP::QS::U8_T)), (data_)))
406
407//${QS-macros::QS_I16} .......................................................
408#define QS_I16(width_, data_) \
409(QP::QS::u16_fmt_(static_cast<std::uint8_t>( \
410 (static_cast<std::uint8_t>((width_) << 4U)) \
411 | static_cast<std::uint8_t>(QP::QS::I16_T)), (data_)))
412
413//${QS-macros::QS_U16} .......................................................
414#define QS_U16(width_, data_) \
415(QP::QS::u16_fmt_(static_cast<std::uint8_t>((((width_) << 4U)) \
416 | static_cast<std::uint8_t>(QP::QS::U16_T)), (data_)))
417
418//${QS-macros::QS_I32} .......................................................
419#define QS_I32(width_, data_) \
420(QP::QS::u32_fmt_( \
421 static_cast<std::uint8_t>((static_cast<std::uint8_t>((width_) << 4U)) \
422 | static_cast<std::uint8_t>(QP::QS::I32_T)), (data_)))
423
424//${QS-macros::QS_U32} .......................................................
425#define QS_U32(width_, data_) \
426(QP::QS::u32_fmt_(static_cast<std::uint8_t>( \
427 (static_cast<std::uint8_t>((width_) << 4U)) \
428 | static_cast<std::uint8_t>(QP::QS::U32_T)), (data_)))
429
430//${QS-macros::QS_I64} .......................................................
431#define QS_I64(width_, data_) \
432(QP::QS::u64_fmt_(static_cast<std::uint8_t>( \
433 (static_cast<std::uint8_t>((width_) << 4U)) \
434 | static_cast<std::uint8_t>(QP::QS::I64_T)), (data_)))
435
436//${QS-macros::QS_U64} .......................................................
437#define QS_U64(width_, data_) \
438(QP::QS::u64_fmt_(static_cast<std::uint8_t>( \
439 (static_cast<std::uint8_t>((width_) << 4U)) \
440 | static_cast<std::uint8_t>(QP::QS::U64_T)), (data_)))
441
442//${QS-macros::QS_F32} .......................................................
443#define QS_F32(width_, data_) \
444(QP::QS::f32_fmt_(static_cast<std::uint8_t>( \
445 (static_cast<std::uint8_t>((width_) << 4U)) \
446 | static_cast<std::uint8_t>(QP::QS::F32_T)), (data_)))
447
448//${QS-macros::QS_F64} .......................................................
449#define QS_F64(width_, data_) \
450(QP::QS::f64_fmt_(static_cast<std::uint8_t>( \
451 (static_cast<std::uint8_t>((width_) << 4U)) \
452 | static_cast<std::uint8_t>(QP::QS::F64_T)), (data_)))
453
454//${QS-macros::QS_STR} .......................................................
455#define QS_STR(str_) (QP::QS::str_fmt_(str_))
456
457//${QS-macros::QS_MEM} .......................................................
458#define QS_MEM(mem_, size_) (QP::QS::mem_fmt_((mem_), (size_)))
459
460//${QS-macros::QS_ENUM} ......................................................
461#define QS_ENUM(group_, value_) \
462 (QP::QS::u8_fmt_(static_cast<std::uint8_t>(0x80U | ((group_) << 4U)) \
463 | static_cast<std::uint8_t>(QP::QS::I8_ENUM_T),\
464 static_cast<std::uint8_t>(value_)))
465
466//${QS-macros::QS_TIME_PRE_} .................................................
467#if (QS_TIME_SIZE == 2U)
468#define QS_TIME_PRE_() (QP::QS::u16_raw_(QP::QS::onGetTime()))
469#endif // (QS_TIME_SIZE == 2U)
470
471//${QS-macros::QS_TIME_PRE_} .................................................
472#if (QS_TIME_SIZE == 4U)
473#define QS_TIME_PRE_() (QP::QS::u32_raw_(QP::QS::onGetTime()))
474#endif // (QS_TIME_SIZE == 4U)
475
476//${QS-macros::QS_OBJ} .......................................................
477#if (QS_OBJ_PTR_SIZE == 2U)
478#define QS_OBJ(obj_) (QP::QS::u16_fmt_(QP::QS::OBJ_T, \
479 reinterpret_cast<std::uint16_t>(obj_)))
480#endif // (QS_OBJ_PTR_SIZE == 2U)
481
482//${QS-macros::QS_OBJ} .......................................................
483#if (QS_OBJ_PTR_SIZE == 4U)
484#define QS_OBJ(obj_) (QP::QS::u32_fmt_(QP::QS::OBJ_T, \
485 reinterpret_cast<std::uint32_t>(obj_)))
486#endif // (QS_OBJ_PTR_SIZE == 4U)
487
488//${QS-macros::QS_OBJ} .......................................................
489#if (QS_OBJ_PTR_SIZE == 8U)
490#define QS_OBJ(obj_) (QP::QS::u64_fmt_(QP::QS::OBJ_T, \
491 reinterpret_cast<std::uint64_t>(obj_)))
492#endif // (QS_OBJ_PTR_SIZE == 8U)
493
494//${QS-macros::QS_FUN} .......................................................
495#if (QS_FUN_PTR_SIZE == 2U)
496#define QS_FUN(fun_) (QP::QS::u16_fmt_(QP::QS::FUN_T, \
497 reinterpret_cast<std::uint16_t>(fun_)))
498#endif // (QS_FUN_PTR_SIZE == 2U)
499
500//${QS-macros::QS_FUN} .......................................................
501#if (QS_FUN_PTR_SIZE == 4U)
502#define QS_FUN(fun_) (QP::QS::u32_fmt_(QP::QS::FUN_T, \
503 reinterpret_cast<std::uint32_t>(fun_)))
504#endif // (QS_FUN_PTR_SIZE == 4U)
505
506//${QS-macros::QS_FUN} .......................................................
507#if (QS_FUN_PTR_SIZE == 8U)
508#define QS_FUN(fun_) (QP::QS::u64_fmt_(QP::QS::FUN_T, \
509 reinterpret_cast<std::uint64_t>(fun_)))
510#endif // (QS_FUN_PTR_SIZE == 8U)
511
512//${QS-macros::QS_SIG} .......................................................
513#if (Q_SIGNAL_SIZE == 1U)
514#define QS_SIG(sig_, obj_) \
515 QP::QS::u8_fmt_(QP::QS::SIG_T, static_cast<std::uint8_t>(sig_)); \
516 QP::QS::obj_raw_(obj_)
517#endif // (Q_SIGNAL_SIZE == 1U)
518
519//${QS-macros::QS_SIG} .......................................................
520#if (Q_SIGNAL_SIZE == 2U)
521#define QS_SIG(sig_, obj_) \
522 QP::QS::u16_fmt_(QP::QS::SIG_T, static_cast<std::uint16_t>(sig_)); \
523 QP::QS::obj_raw_(obj_)
524#endif // (Q_SIGNAL_SIZE == 2U)
525
526//${QS-macros::QS_SIG} .......................................................
527#if (Q_SIGNAL_SIZE == 4U)
528#define QS_SIG(sig_, obj_) \
529 QP::QS::u32_fmt_(QP::QS::SIG_T, static_cast<std::uint32_t>(sig_)); \
530 QP::QS::obj_raw_(obj_)
531#endif // (Q_SIGNAL_SIZE == 4U)
532
533//${QS-macros::QS_SIG_DICTIONARY} ............................................
534#define QS_SIG_DICTIONARY(sig_, obj_) \
535 (QP::QS::sig_dict_pre_((sig_), (obj_), #sig_))
536
537//${QS-macros::QS_OBJ_DICTIONARY} ............................................
538#define QS_OBJ_DICTIONARY(obj_) \
539 (QP::QS::obj_dict_pre_((obj_), #obj_))
540
541//${QS-macros::QS_OBJ_ARR_DICTIONARY} ........................................
542#define QS_OBJ_ARR_DICTIONARY(obj_, idx_) \
543 (QP::QS::obj_arr_dict_pre_((obj_), (idx_), #obj_))
544
545//${QS-macros::QS_FUN_DICTIONARY} ............................................
546#define QS_FUN_DICTIONARY(fun_) \
547 (QP::QS::fun_dict_pre_( \
548 QP::QS::force_cast<void (*)()>(fun_), #fun_))
549
550//${QS-macros::QS_USR_DICTIONARY} ............................................
551#define QS_USR_DICTIONARY(rec_) \
552 (QP::QS::usr_dict_pre_((rec_), #rec_))
553
554//${QS-macros::QS_ENUM_DICTIONARY} ...........................................
555#define QS_ENUM_DICTIONARY(value_, group_) \
556 (QP::QS::enum_dict_pre_((value_), (group_), #value_))
557
558//${QS-macros::QS_QF_CRIT_ENTRY} .............................................
559#define QS_QF_CRIT_ENTRY() (QP::QS::crit_entry_pre_())
560
561//${QS-macros::QS_QF_CRIT_EXIT} ..............................................
562#define QS_QF_CRIT_EXIT() (QP::QS::crit_exit_pre_())
563
564//${QS-macros::QS_QF_ISR_ENTRY} ..............................................
565#define QS_QF_ISR_ENTRY(isrnest_, prio_) \
566 (QP::QS::isr_entry_pre_((isrnest_), (prio_)))
567
568//${QS-macros::QS_QF_ISR_EXIT} ...............................................
569#define QS_QF_ISR_EXIT(isrnest_, prio_) \
570 (QP::QS::isr_exit_pre_((isrnest_), (prio_)))
571
572//${QS-macros::QS_ONLY} ......................................................
573#define QS_ONLY(code_) (code_)
574
575//${QS-macros::QS_ASSERTION} .................................................
576#define QS_ASSERTION(module_, id_, delay_) \
577 (QP::QS::assertion_pre_((module_), (id_), (delay_)))
578
579//${QS-macros::QS_EOD} .......................................................
580#define QS_EOD (static_cast<std::uint16_t>(0xFFFFU))
581
582//${QS-macros::QS_CMD} .......................................................
583#define QS_CMD (static_cast<std::uint8_t>(7U))
584
585//${QS-macros::QS_HEX_FMT} ...................................................
586#define QS_HEX_FMT (static_cast<std::uint8_t>(0x0FU))
587
588//${QS-macros::QS_CRIT_STAT} .................................................
589#ifndef QS_CRIT_STAT
590#define QS_CRIT_STAT QF_CRIT_STAT
591#endif // ndef QS_CRIT_STAT
592
593//${QS-macros::QS_CRIT_ENTRY} ................................................
594#ifndef QS_CRIT_ENTRY
595#define QS_CRIT_ENTRY() QF_CRIT_ENTRY()
596#endif // ndef QS_CRIT_ENTRY
597
598//${QS-macros::QS_CRIT_EXIT} .................................................
599#ifndef QS_CRIT_EXIT
600#define QS_CRIT_EXIT() QF_CRIT_EXIT()
601#endif // ndef QS_CRIT_EXIT
602
603//${QS-macros::QS_MEM_SYS} ...................................................
604#ifndef QS_MEM_SYS
605#define QS_MEM_SYS() QF_MEM_SYS()
606#endif // ndef QS_MEM_SYS
607
608//${QS-macros::QS_MEM_APP} ...................................................
609#ifndef QS_MEM_APP
610#define QS_MEM_APP() QF_MEM_APP()
611#endif // ndef QS_MEM_APP
612//$enddecl${QS-macros} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
613
614//============================================================================
615//! @cond INTERNAL
616
617namespace QP {
618namespace QS {
619
620struct Attr {
621 void const * locFilter_AP; //!< @deprecated
622 std::uint8_t * buf;
623 QSCtr end;
624 QSCtr volatile head;
625 QSCtr volatile tail;
626 QSCtr volatile used;
627 std::uint8_t volatile seq;
628 std::uint8_t volatile chksum;
629 std::uint8_t volatile critNest;
630 std::uint8_t flags;
631};
632
633extern Attr priv_;
634
635void glbFilter_(std::int_fast16_t const filter) noexcept;
636void locFilter_(std::int_fast16_t const filter) noexcept;
637
638void beginRec_(std::uint_fast8_t const rec) noexcept;
639void endRec_() noexcept;
640
641void u8_raw_(std::uint8_t const d) noexcept;
642void u8u8_raw_(std::uint8_t const d1, std::uint8_t const d2) noexcept;
643void u16_raw_(std::uint16_t d) noexcept;
644void u32_raw_(std::uint32_t d) noexcept;
645void u64_raw_(std::uint64_t d) noexcept;
646void obj_raw_(void const * const obj) noexcept;
647void str_raw_(char const * s) noexcept;
648
649void u8_fmt_(std::uint8_t const format, std::uint8_t const d) noexcept;
650void u16_fmt_(std::uint8_t format, std::uint16_t d) noexcept;
651void u32_fmt_(std::uint8_t format,
652 std::uint32_t d) noexcept;
653void u64_fmt_(std::uint8_t format, std::uint64_t d) noexcept;
654void f32_fmt_(std::uint8_t format, float32_t f) noexcept;
655void f64_fmt_(std::uint8_t format, float64_t d) noexcept;
656void str_fmt_(char const * s) noexcept;
657void mem_fmt_(std::uint8_t const * blk, std::uint8_t size) noexcept;
658
659void sig_dict_pre_(QSignal const sig, void const * const obj,
660 char const * const name) noexcept;
661void obj_dict_pre_(void const * const obj,
662 char const * const name) noexcept;
663void obj_arr_dict_pre_(void const * const obj,
664 std::uint_fast16_t const idx,
665 char const * const name) noexcept;
666void fun_dict_pre_(QSpyFunPtr fun,
667 char const * const name) noexcept;
668void usr_dict_pre_(enum_t const rec, char const * const name) noexcept;
669void enum_dict_pre_(enum_t const value, std::uint8_t const group,
670 char const * const name) noexcept;
671
672void assertion_pre_(char const * const module, int_t const id,
673 std::uint32_t const delay) noexcept;
674void crit_entry_pre_() noexcept;
675void crit_exit_pre_() noexcept;
676void isr_entry_pre_(std::uint8_t const isrnest,
677 std::uint8_t const prio) noexcept;
678void isr_exit_pre_(std::uint8_t const isrnest,
679 std::uint8_t const prio) noexcept;
680
681void target_info_pre_(std::uint8_t const isReset);
682
683} // namespace QS
684} // namespace QP
685
686//! @endcond
687//============================================================================
688
689//$declare${QS::QS-TX} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
690namespace QP {
691namespace QS {
692
693//${QS::QS-TX::preType} ......................................................
694//! Enumerates data elements for app-specific trace records
695enum preType : std::uint8_t {
696 I8_ENUM_T, //!< signed 8-bit integer or enum format
697 U8_T, //!< unsigned 8-bit integer format
698 I16_T, //!< signed 16-bit integer format
699 U16_T, //!< unsigned 16-bit integer format
700 I32_T, //!< signed 32-bit integer format
701 U32_T, //!< unsigned 32-bit integer format
702 F32_T, //!< 32-bit floating point format
703 F64_T, //!< 64-bit floating point format
704 STR_T, //!< zero-terminated ASCII string format
705 MEM_T, //!< up to 255-bytes memory block format
706 SIG_T, //!< event signal format
707 OBJ_T, //!< object pointer format
708 FUN_T, //!< function pointer format
709 I64_T, //!< signed 64-bit integer format
710 U64_T //!< unsigned 64-bit integer format
712
713//${QS::QS-TX::force_cast} ...................................................
714template<typename T_OUT, typename T_IN>
715inline T_OUT force_cast(T_IN in) {
716 union TCast {
717 T_IN in;
718 T_OUT out;
719 } u = { in };
720 return u.out;
721}
722
723//${QS::QS-TX::initBuf} ......................................................
724void initBuf(
725 std::uint8_t * const sto,
726 std::uint_fast32_t const stoSize) noexcept;
727
728//${QS::QS-TX::getByte} ......................................................
729std::uint16_t getByte() noexcept;
730
731//${QS::QS-TX::getBlock} .....................................................
732std::uint8_t const * getBlock(std::uint16_t * const pNbytes) noexcept;
733
734//${QS::QS-TX::doOutput} .....................................................
735void doOutput();
736
737//${QS::QS-TX::onStartup} ....................................................
738bool onStartup(void const * arg);
739
740//${QS::QS-TX::onCleanup} ....................................................
742
743//${QS::QS-TX::onFlush} ......................................................
744void onFlush();
745
746//${QS::QS-TX::onGetTime} ....................................................
748
749} // namespace QS
750} // namespace QP
751//$enddecl${QS::QS-TX} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
752
753//============================================================================
754#ifdef Q_UTEST
755
756//$declare${QS::QUTest} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
757namespace QP {
758namespace QS {
759
760//${QS::QUTest::TProbe} ......................................................
761struct TProbe {
762 QSFun addr;
763 std::uint32_t data;
764 std::uint8_t idx;
765};
766
767//${QS::QUTest::onTestSetup} .................................................
769
770//${QS::QUTest::onTestTeardown} ..............................................
772
773//${QS::QUTest::onTestEvt} ...................................................
774void onTestEvt(QEvt * e);
775
776//${QS::QUTest::onTestPost} ..................................................
778 void const * sender,
779 QActive * recipient,
780 QEvt const * e,
781 bool status);
782
783//${QS::QUTest::onTestLoop} ..................................................
785
786} // namespace QS
787} // namespace QP
788//$enddecl${QS::QUTest} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
789
790#define QUTEST_ON_POST 124
791
792//============================================================================
793//! @cond INTERNAL
794
795namespace QP {
796namespace QS {
797
798struct TestAttr {
799 TProbe tpBuf[16];
800 std::uint8_t tpNum;
801 QSTimeCtr testTime;
802 QPSet readySet;
803 QPSet readySet_dis;
804 std::uint_fast8_t intLock;
805};
806
807extern TestAttr tstPriv_;
808
809void test_pause_();
810std::uint32_t getTestProbe_(QSpyFunPtr const api) noexcept;
811
812} // namespace QS
813} // namespace QP
814
815//! @endcond
816//============================================================================
817
818// QP-stub for QUTest
819// NOTE: The QP-stub is needed for unit testing QP applications,
820// but might NOT be needed for testing QP itself.
821#if (Q_UTEST != 0)
822
823//$declare${QS::QUTest-stub::QHsmDummy} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
824namespace QP {
825
826//${QS::QUTest-stub::QHsmDummy} ..............................................
827class QHsmDummy : public QP::QAsm {
828public:
829 QHsmDummy();
830 void init(
831 void const * const e,
832 std::uint_fast8_t const qsId) override;
833 void dispatch(
834 QEvt const * const e,
835 std::uint_fast8_t const qsId) override;
836}; // class QHsmDummy
837
838} // namespace QP
839//$enddecl${QS::QUTest-stub::QHsmDummy} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
840//$declare${QS::QUTest-stub::QActiveDummy} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
841namespace QP {
842
843//${QS::QUTest-stub::QActiveDummy} ...........................................
844class QActiveDummy : public QP::QActive {
845private:
846 friend class QActive;
847
848public:
849 QActiveDummy();
850 void init(
851 void const * const e,
852 std::uint_fast8_t const qsId) override;
853 void dispatch(
854 QEvt const * const e,
855 std::uint_fast8_t const qsId) override;
856
857private:
858 bool fakePost(
859 QEvt const * const e,
860 std::uint_fast16_t const margin,
861 void const * const sender) noexcept;
862 void fakePostLIFO(QEvt const * const e) noexcept;
863}; // class QActiveDummy
864
865} // namespace QP
866//$enddecl${QS::QUTest-stub::QActiveDummy} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
867
868#endif // Q_UTEST != 0
869
870#define QS_TEST_PROBE_DEF(fun_) \
871 std::uint32_t const qs_tp_ = \
872 QP::QS::getTestProbe_(QP::QS::force_cast<void (*)()>(fun_));
873
874#define QS_TEST_PROBE(code_) \
875 if (qs_tp_ != 0U) { code_ }
876
877#define QS_TEST_PROBE_ID(id_, code_) \
878 if (qs_tp_ == static_cast<std::uint32_t>(id_)) { code_ }
879
880#define QS_TEST_PAUSE() (QP::QS::test_pause_())
881
882#else // Q_UTEST not defined
883
884// dummy definitions when not building for QUTEST
885#define QS_TEST_PROBE_DEF(fun_)
886#define QS_TEST_PROBE(code_)
887#define QS_TEST_PROBE_ID(id_, code_)
888#define QS_TEST_PAUSE() (static_cast<void>(0))
889
890#endif // Q_UTEST
891
892//============================================================================
893//! @cond INTERNAL
894
895namespace QP {
896namespace QS {
897
898//............................................................................
899struct CmdVar {
900 std::uint32_t param1;
901 std::uint32_t param2;
902 std::uint32_t param3;
903 std::uint8_t idx;
904 std::uint8_t cmdId;
905};
906
907struct TickVar {
908 std::uint_fast8_t rate;
909};
910
911struct PeekVar {
912 std::uint16_t offs;
913 std::uint8_t size;
914 std::uint8_t num;
915 std::uint8_t idx;
916};
917
918struct PokeVar {
919 std::uint32_t data;
920 std::uint16_t offs;
921 std::uint8_t size;
922 std::uint8_t num;
923 std::uint8_t idx;
924 std::uint8_t fill;
925};
926
927struct FltVar {
928 std::uint8_t data[16];
929 std::uint8_t idx;
930 std::uint8_t recId; // global/local
931};
932
933struct ObjVar {
934 QSObj addr;
935 std::uint8_t idx;
936 std::uint8_t kind; // see qs.hpp, enum QSpyObjKind
937 std::uint8_t recId;
938};
939
940struct EvtVar {
941 QP::QEvt *e;
942 std::uint8_t *p;
943 QP::QSignal sig;
944 std::uint16_t len;
945 std::uint8_t prio;
946 std::uint8_t idx;
947};
948
949struct RxAttr {
950 void * currObj[8];
951 std::uint8_t * buf;
952 QSCtr end;
953 QSCtr volatile head;
954 QSCtr volatile tail;
955 std::uint8_t state;
956 std::uint8_t esc;
957 std::uint8_t seq;
958 std::uint8_t chksum;
959#ifdef Q_UTEST
960 bool inTestLoop;
961#endif
962 union Variant {
963 CmdVar cmd;
964 TickVar tick;
965 PeekVar peek;
966 PokeVar poke;
967 FltVar flt;
968 ObjVar obj;
969 EvtVar evt;
970#ifdef Q_UTEST
972#endif // Q_UTEST
973 } var;
974} ;
975
976extern RxAttr rxPriv_;
977
978} // namespace QS
979} // namespace QP
980
981//! @endcond
982//============================================================================
983
984//$declare${QS::QS-RX} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
985namespace QP {
986namespace QS {
987
988//${QS::QS-RX::QSpyObjKind} ..................................................
989//! Kinds of objects used QS-RX
990enum QSpyObjKind : std::uint8_t {
991 SM_OBJ, //!< state machine object
992 AO_OBJ, //!< active object
993 MP_OBJ, //!< event pool object
994 EQ_OBJ, //!< raw queue object
995 TE_OBJ, //!< time event object
996 AP_OBJ, //!< generic Application-specific object
997 MAX_OBJ
999
1000//${QS::QS-RX::OSpyObjCombnation} ............................................
1001//! Object combinations for QS-RX
1002enum OSpyObjCombnation : std::uint8_t {
1003 SM_AO_OBJ = MAX_OBJ //!< combination of SM and AO
1005
1006//${QS::QS-RX::rxInitBuf} ....................................................
1007void rxInitBuf(
1008 std::uint8_t * const sto,
1009 std::uint16_t const stoSize) noexcept;
1010
1011//${QS::QS-RX::rxPut} ........................................................
1012inline bool rxPut(std::uint8_t const b) noexcept {
1013 // NOTE: does not need critical section
1014 // But requires system-level memory access (QF_MEM_SYS()).
1015
1016 QSCtr head = rxPriv_.head + 1U;
1017 if (head == rxPriv_.end) {
1018 head = 0U;
1019 }
1020 if (head != rxPriv_.tail) { // buffer NOT full?
1021 rxPriv_.buf[rxPriv_.head] = b;
1022 rxPriv_.head = head;
1023 return true; // byte placed in the buffer
1024 }
1025 else {
1026 return false; // byte NOT placed in the buffer
1027 }
1028}
1029
1030//${QS::QS-RX::rxParse} ......................................................
1031void rxParse();
1032
1033//${QS::QS-RX::setCurrObj} ...................................................
1034void setCurrObj(
1035 std::uint8_t const obj_kind,
1036 void * const obj_ptr);
1037
1038//${QS::QS-RX::rxGetNfree} ...................................................
1039std::uint16_t rxGetNfree() noexcept;
1040
1041//${QS::QS-RX::doInput} ......................................................
1042void doInput();
1043
1044//${QS::QS-RX::onReset} ......................................................
1045void onReset();
1046
1047//${QS::QS-RX::onCommand} ....................................................
1048void onCommand(
1049 std::uint8_t cmdId,
1050 std::uint32_t param1,
1051 std::uint32_t param2,
1052 std::uint32_t param3);
1053
1054} // namespace QS
1055} // namespace QP
1056//$enddecl${QS::QS-RX} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1057
1058#endif // QS_HPP_
Dummy Active Object for testing.
Definition qs.hpp:844
Active object class (based on the QHsm implementation strategy)
Definition qp.hpp:722
Abstract State Machine class (state machine interface)
Definition qp.hpp:218
Event class.
Definition qp.hpp:137
Dummy HSM class for testing.
Definition qs.hpp:827
QS type for output filters (global and local)
Definition qs.hpp:312
std::uint8_t glb[16]
Definition qs.hpp:314
std::uint8_t loc[16]
Definition qs.hpp:315
void onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
std::uint8_t const * getBlock(std::uint16_t *const pNbytes) noexcept
Definition qs.cpp:117
std::uint16_t getByte() noexcept
Definition qs.cpp:94
void onTestSetup()
preType
Enumerates data elements for app-specific trace records.
Definition qs.hpp:695
@ OBJ_T
object pointer format
Definition qs.hpp:707
@ U8_T
unsigned 8-bit integer format
Definition qs.hpp:697
@ U32_T
unsigned 32-bit integer format
Definition qs.hpp:701
@ I64_T
signed 64-bit integer format
Definition qs.hpp:709
@ F32_T
32-bit floating point format
Definition qs.hpp:702
@ I8_ENUM_T
signed 8-bit integer or enum format
Definition qs.hpp:696
@ FUN_T
function pointer format
Definition qs.hpp:708
@ U64_T
unsigned 64-bit integer format
Definition qs.hpp:710
@ STR_T
zero-terminated ASCII string format
Definition qs.hpp:704
@ U16_T
unsigned 16-bit integer format
Definition qs.hpp:699
@ MEM_T
up to 255-bytes memory block format
Definition qs.hpp:705
@ I32_T
signed 32-bit integer format
Definition qs.hpp:700
@ I16_T
signed 16-bit integer format
Definition qs.hpp:698
@ F64_T
64-bit floating point format
Definition qs.hpp:703
@ SIG_T
event signal format
Definition qs.hpp:706
OSpyObjCombnation
Object combinations for QS-RX.
Definition qs.hpp:1002
@ SM_AO_OBJ
combination of SM and AO
Definition qs.hpp:1003
void onTestLoop()
Filter filt_
Definition qs.cpp:163
T_OUT force_cast(T_IN in)
Definition qs.hpp:715
void initBuf(std::uint8_t *const sto, std::uint_fast32_t const stoSize) noexcept
Definition qs.cpp:66
bool rxPut(std::uint8_t const b) noexcept
Definition qs.hpp:1012
void onTestTeardown()
void onCleanup()
void onTestEvt(QEvt *e)
QSpyObjKind
Kinds of objects used QS-RX.
Definition qs.hpp:990
@ SM_OBJ
state machine object
Definition qs.hpp:991
@ TE_OBJ
time event object
Definition qs.hpp:995
@ MAX_OBJ
Definition qs.hpp:997
@ EQ_OBJ
raw queue object
Definition qs.hpp:994
@ AP_OBJ
generic Application-specific object
Definition qs.hpp:996
@ AO_OBJ
active object
Definition qs.hpp:992
@ MP_OBJ
event pool object
Definition qs.hpp:993
void doOutput()
void onFlush()
QSTimeCtr onGetTime()
bool onStartup(void const *arg)
QP/C++ framework.
Definition qequeue.hpp:50
std::uint32_t QSTimeCtr
Definition qs.hpp:302
QSpyUserOffsets
QS user record group offsets for QS_GLB_FILTER()
Definition qs.hpp:214
@ QS_USER4
offset for User Group 4
Definition qs.hpp:220
@ QS_USER2
offset for User Group 2
Definition qs.hpp:218
@ QS_USER0
offset for User Group 0
Definition qs.hpp:216
@ QS_USER1
offset for User Group 1
Definition qs.hpp:217
@ QS_USER3
offset for User Group 3
Definition qs.hpp:219
@ QS_USER
the first record available to QS users
Definition qs.hpp:215
void(*)() QSpyFunPtr
Definition qs.hpp:283
QSpyIdOffsets
QS ID offsets for QS_LOC_FILTER()
Definition qs.hpp:225
@ QS_EQ_ID
offset for event-queue IDs
Definition qs.hpp:228
@ QS_EP_ID
offset for event-pool IDs
Definition qs.hpp:227
@ QS_AP_ID
offset for Application-specific IDs
Definition qs.hpp:229
@ QS_AO_ID
offset for AO priorities
Definition qs.hpp:226
QSpyIdGroups
QS ID groups for QS_LOC_FILTER()
Definition qs.hpp:234
@ QS_EQ_IDS
event-queue IDs
Definition qs.hpp:238
@ QS_EP_IDS
event-pool IDs
Definition qs.hpp:237
@ QS_AP_IDS
Application-specific IDs.
Definition qs.hpp:239
@ QS_ALL_IDS
all QS IDs
Definition qs.hpp:235
@ QS_AO_IDS
AO IDs (priorities)
Definition qs.hpp:236
QSpyGroups
QS-TX record groups for QS_GLB_FILTER()
Definition qs.hpp:193
@ QS_MTX_RECORDS
Mutex QS records.
Definition qs.hpp:203
@ QS_UA_RECORDS
All User records.
Definition qs.hpp:209
@ QS_SEM_RECORDS
Semaphore QS records.
Definition qs.hpp:202
@ QS_ALL_RECORDS
all maskable QS records
Definition qs.hpp:194
@ QS_U0_RECORDS
User Group 100-104 records.
Definition qs.hpp:204
@ QS_EQ_RECORDS
Event Queues QS records.
Definition qs.hpp:197
@ QS_SC_RECORDS
Scheduler QS records.
Definition qs.hpp:201
@ QS_U2_RECORDS
User Group 110-114 records.
Definition qs.hpp:206
@ QS_SM_RECORDS
State Machine QS records.
Definition qs.hpp:195
@ QS_U4_RECORDS
User Group 120-124 records.
Definition qs.hpp:208
@ QS_U3_RECORDS
User Group 115-119 records.
Definition qs.hpp:207
@ QS_AO_RECORDS
Active Object QS records.
Definition qs.hpp:196
@ QS_TE_RECORDS
Time Events QS records.
Definition qs.hpp:199
@ QS_U1_RECORDS
User Group 105-109 records.
Definition qs.hpp:205
@ QS_MP_RECORDS
Memory Pools QS records.
Definition qs.hpp:198
@ QS_QF_RECORDS
QF QS records.
Definition qs.hpp:200
std::uint16_t QSignal
Definition qp.hpp:128
QSpyPre
pre-defined QS record IDs
Definition qs.hpp:69
@ QS_QEP_DISPATCH
an event was dispatched (begin of RTC step)
Definition qs.hpp:81
@ QS_FUN_DICT
function dictionary entry
Definition qs.hpp:163
@ QS_ASSERT_FAIL
assertion failed in the code
Definition qs.hpp:170
@ QS_TARGET_DONE
reports completion of a user callback
Definition qs.hpp:166
@ QS_QUERY_DATA
reports the data from "current object" query
Definition qs.hpp:168
@ QS_RX_STATUS
reports QS data receive status
Definition qs.hpp:167
@ QS_SCHED_LOCK
scheduler was locked
Definition qs.hpp:145
@ QS_QEP_STATE_ENTRY
a state was entered
Definition qs.hpp:74
@ QS_QF_TICK
QTimeEvt tick was called.
Definition qs.hpp:114
@ QS_QF_ACTIVE_RECALL
AO recalled an event.
Definition qs.hpp:86
@ QS_QF_ACTIVE_GET_LAST
AO got an event and its queue is empty.
Definition qs.hpp:92
@ QS_SEM_SIGNAL
a semaphore was signaled
Definition qs.hpp:176
@ QS_QF_RUN
QF_run() was entered.
Definition qs.hpp:171
@ QS_QF_ACTIVE_UNSUBSCRIBE
an AO unsubscribed to an event
Definition qs.hpp:88
@ QS_MTX_LOCK_ATTEMPT
a mutex lock was attempted
Definition qs.hpp:183
@ QS_QF_TIMEEVT_ARM
a time event was armed
Definition qs.hpp:117
@ QS_QF_ACTIVE_RECALL_ATTEMPT
AO attempted to recall an event.
Definition qs.hpp:93
@ QS_QF_TIMEEVT_POST
a time event posted itself directly to an AO
Definition qs.hpp:122
@ QS_QEP_STATE_EXIT
a state was exited
Definition qs.hpp:75
@ QS_SEM_TAKE
a semaphore was taken by a thread
Definition qs.hpp:174
@ QS_TEST_PAUSED
test has been paused
Definition qs.hpp:159
@ QS_USR_DICT
user QS record dictionary entry
Definition qs.hpp:164
@ QS_QF_TIMEEVT_AUTO_DISARM
a time event expired and was disarmed
Definition qs.hpp:118
@ QS_QF_EQUEUE_POST_ATTEMPT
attempt to post evt to QEQueue failed
Definition qs.hpp:137
@ QS_QEP_TRAN_HIST
a tran to history was taken
Definition qs.hpp:154
@ QS_QF_TIMEEVT_REARM
rearming of a time event
Definition qs.hpp:121
@ QS_QF_INT_ENABLE
interrupts were enabled
Definition qs.hpp:131
@ QS_ENUM_DICT
enumeration dictionary entry
Definition qs.hpp:151
@ QS_TEST_PROBE_GET
reports that Test-Probe has been used
Definition qs.hpp:160
@ QS_SCHED_NEXT
scheduler started next task
Definition qs.hpp:147
@ QS_QF_NEW
new event was created
Definition qs.hpp:111
@ QS_QEP_IGNORED
an event was ignored (silently discarded)
Definition qs.hpp:80
@ QS_PEEK_DATA
reports the data from the PEEK query
Definition qs.hpp:169
@ QS_QEP_UNHANDLED
an event was un-handled due to a guard
Definition qs.hpp:82
@ QS_SEM_BLOCK
a semaphore blocked a thread
Definition qs.hpp:175
@ QS_QF_EQUEUE_GET_LAST
get the last event from the queue
Definition qs.hpp:99
@ QS_MTX_BLOCK_ATTEMPT
a mutex blocking was attempted
Definition qs.hpp:184
@ QS_QF_TIMEEVT_DISARM
true disarming of an armed time event
Definition qs.hpp:120
@ QS_QF_EQUEUE_GET
get an event and queue still not empty
Definition qs.hpp:98
@ QS_QF_EQUEUE_POST_LIFO
an event was posted (LIFO) to a raw queue
Definition qs.hpp:97
@ QS_QF_GC
garbage collection
Definition qs.hpp:113
@ QS_SIG_DICT
signal dictionary entry
Definition qs.hpp:161
@ QS_QF_ACTIVE_DEFER
AO deferred an event.
Definition qs.hpp:85
@ QS_QF_DELETE_REF
an event reference is about to be deleted
Definition qs.hpp:125
@ QS_QF_ACTIVE_POST_ATTEMPT
attempt to post an evt to AO failed
Definition qs.hpp:134
@ QS_OBJ_DICT
object dictionary entry
Definition qs.hpp:162
@ QS_MTX_BLOCK
a mutex blocked a thread
Definition qs.hpp:181
@ QS_QF_CRIT_ENTRY
critical section was entered
Definition qs.hpp:126
@ QS_QF_CRIT_EXIT
critical section was exited
Definition qs.hpp:127
@ QS_QF_ACTIVE_SUBSCRIBE
an AO subscribed to an event
Definition qs.hpp:87
@ QS_MTX_UNLOCK_ATTEMPT
a mutex unlock was attempted
Definition qs.hpp:185
@ QS_QF_ISR_ENTRY
an ISR was entered
Definition qs.hpp:128
@ QS_TARGET_INFO
reports the Target information
Definition qs.hpp:165
@ QS_QF_NEW_ATTEMPT
an attempt to allocate an event failed
Definition qs.hpp:102
@ QS_QF_MPOOL_GET
a memory block was removed from memory pool
Definition qs.hpp:105
@ QS_QF_GC_ATTEMPT
garbage collection attempt
Definition qs.hpp:112
@ QS_QF_INT_DISABLE
interrupts were disabled
Definition qs.hpp:130
@ QS_QEP_TRAN_XP
a tran to exit point out of a submachine
Definition qs.hpp:156
@ QS_QF_ACTIVE_POST_LIFO
an event was posted (LIFO) directly to AO
Definition qs.hpp:90
@ QS_SCHED_UNLOCK
scheduler was unlocked
Definition qs.hpp:146
@ QS_SCHED_PREEMPT
scheduler asynchronously preempted a task
Definition qs.hpp:143
@ QS_QF_ACTIVE_GET
AO got an event and its queue is not empty.
Definition qs.hpp:91
@ QS_MTX_UNLOCK
a mutex was unlocked
Definition qs.hpp:182
@ QS_QF_ACTIVE_POST
an event was posted (FIFO) directly to AO
Definition qs.hpp:89
@ QS_QF_ISR_EXIT
an ISR was exited
Definition qs.hpp:129
@ QS_QF_EQUEUE_POST
an event was posted (FIFO) to a raw queue
Definition qs.hpp:96
@ QS_EMPTY
QS record for cleanly starting a session.
Definition qs.hpp:71
@ QS_SCHED_RESTORE
scheduler restored preempted task
Definition qs.hpp:144
@ QS_QF_PUBLISH
an event was published to active objects
Definition qs.hpp:109
@ QS_PRE_MAX
the # predefined signals
Definition qs.hpp:188
@ QS_QEP_TRAN_EP
a tran to entry point into a submachine
Definition qs.hpp:155
@ QS_SCHED_IDLE
scheduler restored the idle task
Definition qs.hpp:148
@ QS_QEP_STATE_INIT
an initial transition was taken in a state
Definition qs.hpp:76
@ QS_QEP_TRAN
a regular transition was taken
Definition qs.hpp:79
@ QS_SEM_BLOCK_ATTEMPT
a semaphore blocked was attempted
Definition qs.hpp:177
@ QS_QEP_INIT_TRAN
the top-most initial transition was taken
Definition qs.hpp:77
@ QS_QF_TIMEEVT_DISARM_ATTEMPT
attempt to disarm a disarmed QTimeEvt
Definition qs.hpp:119
@ QS_QEP_INTERN_TRAN
an internal transition was taken
Definition qs.hpp:78
@ QS_QF_MPOOL_GET_ATTEMPT
attempt to get a memory block failed
Definition qs.hpp:140
@ QS_MTX_LOCK
a mutex was locked
Definition qs.hpp:180
@ QS_QF_NEW_REF
new event reference was created
Definition qs.hpp:110
@ QS_QF_MPOOL_PUT
a memory block was returned to memory pool
Definition qs.hpp:106
int enum_t
Definition qp.hpp:106
int int_t
Definition qp.hpp:103
float float32_t
Definition qp.hpp:109
double float64_t
Definition qp.hpp:112
QUTest Test-Probe attributes.
Definition qs.hpp:761
QSFun addr
Definition qs.hpp:762
std::uint8_t idx
Definition qs.hpp:764
std::uint32_t data
Definition qs.hpp:763
QS ID type for applying local filtering.
Definition qs.hpp:243
std::uint_fast8_t getPrio() const noexcept
Definition qs.hpp:247
std::uint8_t m_prio
prio. (qsId) for the QS "local filter"
Definition qs.hpp:244