QP/C  8.0.3
Real-Time Event Framework
Loading...
Searching...
No Matches
qs_dummy.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 QS_DUMMY_H_
30#define QS_DUMMY_H_
31
32#ifdef Q_SPY
33 #error Q_SPY must NOT be defined to include qs_dummy.h
34#endif
35
36#ifdef Q_UTEST
37 #error Q_UTEST must NOT be defined to include qs_dummy.h
38#endif
39
40#define QS_INIT(arg_) ((uint8_t)1U)
41#define QS_EXIT() ((void)0)
42#define QS_DUMP() ((void)0)
43#define QS_GLB_FILTER(rec_) ((void)0)
44#define QS_LOC_FILTER(qsId_) ((void)0)
45
46#define QS_BEGIN_ID(rec_, qsId_) if (false) {
47#define QS_END() }
48#define QS_BEGIN_INCRIT(rec_, qsId_) if (false) {
49#define QS_END_INCRIT() }
50
51#define QS_I8(width_, data_) ((void)0)
52#define QS_U8(width_, data_) ((void)0)
53#define QS_I16(width_, data_) ((void)0)
54#define QS_U16(width_, data_) ((void)0)
55#define QS_I32(width_, data_) ((void)0)
56#define QS_U32(width_, data_) ((void)0)
57#define QS_F32(width_, data_) ((void)0)
58#define QS_F64(width_, data_) ((void)0)
59#define QS_I64(width_, data_) ((void)0)
60#define QS_U64(width_, data_) ((void)0)
61#define QS_ENUM(group_, value_) ((void)0)
62#define QS_STR(str_) ((void)0)
63#define QS_MEM(mem_, size_) ((void)0)
64#define QS_SIG(sig_, obj_) ((void)0)
65#define QS_OBJ(obj_) ((void)0)
66#define QS_FUN(fun_) ((void)0)
67
68#define QS_SIG_DICTIONARY(sig_, obj_) ((void)0)
69#define QS_OBJ_DICTIONARY(obj_) ((void)0)
70#define QS_OBJ_ARR_DICTIONARY(obj_, idx_) ((void)0)
71#define QS_FUN_DICTIONARY(fun_) ((void)0)
72#define QS_USR_DICTIONARY(rec_) ((void)0)
73#define QS_ENUM_DICTIONARY(value_, group_) ((void)0)
74#define QS_ASSERTION(module_, loc_, delay_) ((void)0)
75#define QS_FLUSH() ((void)0)
76
77#define QS_TEST_PROBE_DEF(fun_)
78#define QS_TEST_PROBE(code_)
79#define QS_TEST_PROBE_ID(id_, code_)
80#define QS_TEST_PAUSE() ((void)0)
81
82#define QS_OUTPUT() ((void)0)
83#define QS_RX_INPUT() ((void)0)
84#define QS_RX_PUT(b_) ((void)0)
85#define QS_ONLY(code_) ((void)0)
86
87//============================================================================
88// QS API used inside applications
89#ifndef QS_TIME_SIZE
90 typedef uint32_t QSTimeCtr;
91#elif (QS_TIME_SIZE == 2U)
92 typedef uint16_t QSTimeCtr;
93#else
94 typedef uint32_t QSTimeCtr;
95#endif
96
97void QS_initBuf(uint8_t * const sto, uint_fast32_t const stoSize);
98uint16_t QS_getByte(void);
99uint8_t const *QS_getBlock(uint16_t* const pNbytes);
100void QS_doOutput(void);
101uint8_t QS_onStartup(void const* arg);
102void QS_onCleanup(void);
103void QS_onFlush(void);
105
106void QS_rxInitBuf(uint8_t * const sto, uint16_t const stoSize);
107void QS_rxParse(void);
108
109//============================================================================
110// QS API used inside test fixtures
111#ifdef Q_UTEST
112
113#if (QS_FUN_PTR_SIZE == 2U)
114 typedef uint16_t QSFun;
115#elif (QS_FUN_PTR_SIZE == 4U)
116 typedef uint32_t QSFun;
117#elif (QS_FUN_PTR_SIZE == 8U)
118 typedef uint64_t QSFun;
119#endif
120
121struct QS_TProbe {
122 QSFun addr;
123 uint32_t data;
124 uint8_t idx;
125};
126
127void QS_onTestSetup(void);
130void QS_onTestPost(void const *sender, QActive *recipient,
131 QEvt const *e, bool status);
132void QS_onTestLoop(void);
133
134#endif // def Q_UTEST
135
136//============================================================================
137// interface used only for internal implementation, but not in applications
138#ifdef QP_IMPL
139 // predefined QS trace records
140 #define QS_BEGIN_PRE(rec_, qsId_) if (false) {
141 #define QS_END_PRE() }
142 #define QS_U8_PRE(data_) ((void)0)
143 #define QS_2U8_PRE(data1_, data2_) ((void)0)
144 #define QS_U16_PRE(data_) ((void)0)
145 #define QS_U32_PRE(data_) ((void)0)
146 #define QS_TIME_PRE() ((void)0)
147 #define QS_SIG_PRE(sig_) ((void)0)
148 #define QS_EVS_PRE(size_) ((void)0)
149 #define QS_OBJ_PRE(obj_) ((void)0)
150 #define QS_FUN_PRE(fun_) ((void)0)
151 #define QS_EQC_PRE(ctr_) ((void)0)
152 #define QS_MPC_PRE(ctr_) ((void)0)
153 #define QS_MPS_PRE(size_) ((void)0)
154 #define QS_TEC_PRE(ctr_) ((void)0)
155
156 #define QS_CRIT_STAT
157 #define QS_CRIT_ENTRY() ((void)0)
158 #define QS_CRIT_EXIT() ((void)0)
159
160 #define QS_TR_CRIT_ENTRY() ((void)0)
161 #define QS_TR_CRIT_EXIT() ((void)0)
162 #define QS_TR_ISR_ENTRY(isrnest_, prio_) ((void)0)
163 #define QS_TR_ISR_EXIT(isrnest_, prio_) ((void)0)
164#endif // QP_IMPL
165
166#endif // QS_DUMMY_H_
void QS_doOutput(void)
void QS_onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
void QS_onCleanup(void)
void QS_onTestSetup(void)
void QS_rxParse(void)
uint32_t QSTimeCtr
Unsigned integer type for QS timestamps.
Definition qs_dummy.h:94
void QS_rxInitBuf(uint8_t *const sto, uint16_t const stoSize)
uint8_t const * QS_getBlock(uint16_t *const pNbytes)
void QS_onTestLoop(void)
QSTimeCtr QS_onGetTime(void)
Return the current timestamp for QS trace records.
void QS_onFlush(void)
Flush the QS output buffer.
uint8_t QS_onStartup(void const *arg)
void QS_onTestTeardown(void)
uint16_t QS_getByte(void)
void QS_onTestEvt(QEvt *e)
void QS_initBuf(uint8_t *const sto, uint_fast32_t const stoSize)
Active object class (based on the QHsm implementation strategy)
Definition qp.h:504
Event class.
Definition qp.h:112
QUTest Test-Probe attributes.
Definition qs_dummy.h:121
uint8_t idx
Definition qs_dummy.h:124
QSFun addr
Definition qs_dummy.h:122
uint32_t data
Definition qs_dummy.h:123