83 priv_.locFilter_AP =
nullptr;
86 priv_.end =
static_cast<QSCtr>(stoSize);
122 bool const isRemove = (filter < 0);
131 for (i = 0U; i <
Q_DIM(priv_.glbFilter); i += 4U) {
132 priv_.glbFilter[i ] = tmp;
133 priv_.glbFilter[i + 1U] = tmp;
134 priv_.glbFilter[i + 2U] = tmp;
135 priv_.glbFilter[i + 3U] = tmp;
141 priv_.glbFilter[0] = 0x01U;
142 priv_.glbFilter[7] = 0xFCU;
143 priv_.glbFilter[8] = 0x7FU;
147 priv_.glbFilter[15] = 0x1FU;
153 priv_.glbFilter[0] &=
155 priv_.glbFilter[1] &=
157 priv_.glbFilter[6] &=
159 priv_.glbFilter[7] &=
163 priv_.glbFilter[0] |= 0xFEU;
164 priv_.glbFilter[1] |= 0x03U;
165 priv_.glbFilter[6] |= 0x80U;
166 priv_.glbFilter[7] |= 0x03U;
171 priv_.glbFilter[1] &=
173 priv_.glbFilter[2] &=
175 priv_.glbFilter[5] &=
179 priv_.glbFilter[1] |= 0xFCU;
180 priv_.glbFilter[2] |= 0x07U;
181 priv_.glbFilter[5] |= 0x20U;
186 priv_.glbFilter[2] &=
188 priv_.glbFilter[5] &=
192 priv_.glbFilter[2] |= 0x78U;
193 priv_.glbFilter[5] |= 0x40U;
198 priv_.glbFilter[3] &=
200 priv_.glbFilter[5] &=
204 priv_.glbFilter[3] |= 0x03U;
205 priv_.glbFilter[5] |= 0x80U;
210 priv_.glbFilter[2] &=
212 priv_.glbFilter[3] &=
214 priv_.glbFilter[4] &=
216 priv_.glbFilter[5] &=
220 priv_.glbFilter[2] |= 0x80U;
221 priv_.glbFilter[3] |= 0xFCU;
222 priv_.glbFilter[4] |= 0xC0U;
223 priv_.glbFilter[5] |= 0x1FU;
228 priv_.glbFilter[4] &=
232 priv_.glbFilter[4] |= 0x3FU;
237 priv_.glbFilter[6] &=
241 priv_.glbFilter[6] |= 0x7FU;
246 priv_.glbFilter[12] &=
248 priv_.glbFilter[13] &=
252 priv_.glbFilter[12] |= 0xF0U;
253 priv_.glbFilter[13] |= 0x01U;
258 priv_.glbFilter[13] &=
262 priv_.glbFilter[13] |= 0x3EU;
267 priv_.glbFilter[13] &=
269 priv_.glbFilter[14] &=
273 priv_.glbFilter[13] |= 0xC0U;
274 priv_.glbFilter[14] |= 0x07U;
279 priv_.glbFilter[14] &=
283 priv_.glbFilter[14] |= 0xF8U;
288 priv_.glbFilter[15] &= 0x1FU;
291 priv_.glbFilter[15] |= 0x1FU;
296 priv_.glbFilter[12] &=
298 priv_.glbFilter[13] = 0U;
299 priv_.glbFilter[14] = 0U;
300 priv_.glbFilter[15] &=
304 priv_.glbFilter[12] |= 0xF0U;
305 priv_.glbFilter[13] |= 0xFFU;
306 priv_.glbFilter[14] |= 0xFFU;
307 priv_.glbFilter[15] |= 0x1FU;
315 priv_.glbFilter[rec >> 3U]
316 &=
static_cast<std::uint8_t>(~(1U << (rec & 7U)) & 0xFFU);
319 priv_.glbFilter[rec >> 3U]
322 priv_.glbFilter[15] &= 0x1FU;
347 bool const isRemove = (filter < 0);
356 for (i = 0U; i <
Q_DIM(priv_.locFilter); i += 4U) {
357 priv_.locFilter[i ] = tmp;
358 priv_.locFilter[i + 1U] = tmp;
359 priv_.locFilter[i + 2U] = tmp;
360 priv_.locFilter[i + 3U] = tmp;
364 for (i = 0U; i < 8U; i += 4U) {
365 priv_.locFilter[i ] = tmp;
366 priv_.locFilter[i + 1U] = tmp;
367 priv_.locFilter[i + 2U] = tmp;
368 priv_.locFilter[i + 3U] = tmp;
373 priv_.locFilter[i ] = tmp;
374 priv_.locFilter[i + 1U] = tmp;
378 priv_.locFilter[i ] = tmp;
379 priv_.locFilter[i + 1U] = tmp;
380 priv_.locFilter[i + 2U] = tmp;
381 priv_.locFilter[i + 3U] = tmp;
386 priv_.locFilter[qs_id >> 3U] &=
388 ~(1U << (qs_id & 7U)) & 0xFFU);
391 priv_.locFilter[qs_id >> 3U]
392 |= (1U << (qs_id & 7U));
400 priv_.locFilter[0] |= 0x01U;
414 QSCtr head_ = priv_.head;
415 QSCtr const end_ = priv_.end;
426 priv_.chksum = chksum_;
438 QSCtr head_ = priv_.head;
439 QSCtr const end_ = priv_.end;
457 if (priv_.used > end_) {
478 endian_test.u16 = 0x0102U;
488 #ifdef QF_EQUEUE_CTR_SIZE
495 #ifdef QF_MPOOL_CTR_SIZE
510 QS::u8_raw_((10U * (TIME[6] - ZERO)) + (TIME[7] - ZERO));
511 QS::u8_raw_((10U * (TIME[3] - ZERO)) + (TIME[4] - ZERO));
516 QS::u8_raw_((10U * (TIME[0] - ZERO)) + (TIME[1] - ZERO));
524 QS::u8_raw_((10U * (DATE[4] - ZERO)) + (DATE[5] - ZERO));
528 switch (DATE[0] + DATE[1] + DATE[2]) {
532 case 'F' +
'e' +
'b':
538 case 'A' +
'p' +
'r':
541 case 'M' +
'a' +
'y':
544 case 'J' +
'u' +
'n':
547 case 'J' +
'u' +
'l':
550 case 'A' +
'u' +
'g':
553 case 'S' +
'e' +
'p':
556 case 'O' +
'c' +
't':
559 case 'N' +
'o' +
'v':
562 case 'D' +
'e' +
'c':
570 QS::u8_raw_((10U * (DATE[9] - ZERO)) + (DATE[10] - ZERO));
582 QSCtr head_ = priv_.head;
583 QSCtr const end_= priv_.end;
591 priv_.chksum = chksum_;
602 QSCtr head_ = priv_.head;
603 QSCtr const end_= priv_.end;
617 priv_.chksum = chksum_;
627 QSCtr head_ = priv_.head;
628 QSCtr const end_= priv_.end;
630 priv_.used +=
static_cast<QSCtr>(5);
640 priv_.chksum = chksum_;
647 char_t const *
const name) noexcept
667 QSCtr head_ = priv_.head;
668 QSCtr const end_= priv_.end;
677 for (; size != 0U; --size) {
684 priv_.chksum = chksum_;
696 QSCtr head_ = priv_.head;
697 QSCtr const end_= priv_.end;
698 QSCtr used_ = priv_.used;
714 priv_.chksum = chksum_;
725 QSCtr head_ = priv_.head;
726 QSCtr const end_= priv_.end;
732 priv_.chksum = chksum_;
742 QSCtr head_ = priv_.head;
743 QSCtr const end_= priv_.end;
750 priv_.chksum = chksum_;
761 QSCtr head_ = priv_.head;
762 QSCtr const end_= priv_.end;
773 priv_.chksum = chksum_;
783 QSCtr head_ = priv_.head;
784 QSCtr const end_= priv_.end;
794 priv_.chksum = chksum_;
802 #if (QS_OBJ_PTR_SIZE == 1U)
804 #elif (QS_OBJ_PTR_SIZE == 2U)
806 #elif (QS_OBJ_PTR_SIZE == 4U)
808 #elif (QS_OBJ_PTR_SIZE == 8U)
823 QSCtr head_ = priv_.head;
824 QSCtr const end_= priv_.end;
825 QSCtr used_ = priv_.used;
838 priv_.chksum = chksum_;
854 if (priv_.used == 0U) {
859 QSCtr tail_ = priv_.tail;
865 if (tail_ == priv_.end) {
898 QSCtr const used_ = priv_.used;
907 QSCtr tail_ = priv_.tail;
908 QSCtr const end_ = priv_.end;
913 if (n >
static_cast<QSCtr>(*pNbytes)) {
914 n =
static_cast<QSCtr>(*pNbytes);
934 char_t const *name) noexcept
955 char_t const *name) noexcept
975 char_t const *name) noexcept
unsigned int uint16_t
exact-width 16-bit unsigned int
unsigned int uint_fast16_t
fast at-least 16-bit unsigned int
unsigned long int uint32_t
exact-width 32-bit unsigned int
signed int int_fast16_t
fast at-least 16-bit signed int
unsigned long long uint64_t
exact-width 64-bit unsigned int
unsigned char uint8_t
exact-width 8-bit unsigned int
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
static void assertion_pre_(char_t const *const module, int_t const loc, std::uint32_t delay)
internal function to produce the assertion failure trace record
static void usr_dict_pre_(enum_t const rec, char_t const *const name) noexcept
Output user dictionary record.
static void crit_entry_pre_(void)
internal function to produce the critical section entry record
static std::uint16_t getByte(void) noexcept
Byte-oriented interface to the QS data buffer.
static void onCleanup(void)
Callback to cleanup the QS facility.
static void crit_exit_pre_(void)
internal function to produce the critical section exit record
static void u16_raw_(std::uint16_t d) noexcept
Output std::uint16_t data element without format information.
static void str_raw_(char_t const *s) noexcept
Output zero-terminated ASCII string element without format information.
static std::uint8_t const * getBlock(std::uint16_t *const pNbytes) noexcept
Block-oriented interface to the QS data buffer.
static void onFlush(void)
Callback to flush the QS trace data to the host.
static void u32_fmt_(std::uint8_t format, std::uint32_t d) noexcept
Output std::uint32_t data element with format information.
static void isr_exit_pre_(std::uint8_t const isrnest, std::uint8_t const prio)
internal function to produce the ISR exit record
static void str_fmt_(char_t const *s) noexcept
Output zero-terminated ASCII string element with format information.
static void glbFilter_(std::int_fast16_t const filter) noexcept
Set/clear the global Filter for a given QS record.
static void beginRec_(std::uint_fast8_t const rec) noexcept
Mark the begin of a QS record rec.
static void fun_dict_pre_(void(*const fun)(void), char_t const *name) noexcept
Output function dictionary record.
static void sig_dict_pre_(enum_t const sig, void const *const obj, char_t const *name) noexcept
Output signal dictionary record.
static void isr_entry_pre_(std::uint8_t const isrnest, std::uint8_t const prio)
internal function to produce the ISR entry record
static void u8_fmt_(std::uint8_t const format, std::uint8_t const d) noexcept
Output std::uint8_t data element with format information.
static void obj_raw_(void const *const obj) noexcept
Output obj pointer data element without format information.
static void endRec_(void) noexcept
Mark the end of a QS record rec.
static void u8_raw_(std::uint8_t const d) noexcept
output std::uint8_t data element without format information
static void locFilter_(std::int_fast16_t const filter) noexcept
Set/clear the local Filter for a given object-id.
static void u8u8_raw_(std::uint8_t const d1, std::uint8_t const d2) noexcept
output two std::uint8_t data elements without format information
static void u32_raw_(std::uint32_t d) noexcept
Output std::uint32_t data element without format information.
static void obj_dict_pre_(void const *const obj, char_t const *name) noexcept
Output object dictionary record.
static void mem_fmt_(std::uint8_t const *blk, std::uint8_t size) noexcept
Output memory block of up to 255-bytes with format information.
static void u16_fmt_(std::uint8_t format, std::uint16_t d) noexcept
output std::uint16_t data element with format information
std::uint_fast8_t critNest
critical section nesting level
namespace associated with the QP/C++ framework
char const BUILD_DATE[12]
the calendar date of the last translation of the form: "Mmm dd yyyy"
constexpr std::uint8_t QS_ESC
Escape character of the QS output protocol.
void QS_target_info_(std::uint8_t const isReset) noexcept
send the Target info (object sizes, build time-stamp, QP version)
@ QS_ASSERT_FAIL
assertion failed in the code
@ QS_FUN_DICT
function dictionary entry
@ QS_QF_CRIT_ENTRY
critical section was entered
@ QS_QF_CRIT_EXIT
critical section was exited
@ QS_OBJ_DICT
object dictionary entry
@ QS_TARGET_INFO
reports the Target information
@ QS_QF_ISR_ENTRY
an ISR was entered
@ QS_QF_ISR_EXIT
an ISR was exited
@ QS_EMPTY
QS record for cleanly starting a session.
@ QS_SIG_DICT
signal dictionary entry
@ QS_USR_DICT
user QS record dictionary entry
constexpr std::uint16_t QS_EOD
Constant representing End-Of-Data condition returned from the QP::QS::getByte() function.
char const BUILD_TIME[9]
the time of the last translation of the form: "hh:mm:ss"
constexpr std::uint8_t QS_ESC_XOR
Escape modifier of the QS output protocol.
@ QS_EP_IDS
event-pool IDs
@ QS_AO_IDS
AO IDs (priorities)
@ QS_AP_IDS
Application-specific IDs.
std::uint_fast16_t QSCtr
QS ring buffer counter and offset type.
constexpr std::uint8_t QS_FRAME
Frame character of the QS output protocol.
@ QS_U2_RECORDS
User Group 110-114 records.
@ QS_MP_RECORDS
Memory Pools QS records.
@ QS_TE_RECORDS
Time Events QS records.
@ QS_SM_RECORDS
State Machine QS records.
@ QS_U0_RECORDS
User Group 100-104 records.
@ QS_U3_RECORDS
User Group 115-119 records.
@ QS_U4_RECORDS
User Group 120-124 records.
@ QS_AO_RECORDS
Active Object QS records.
@ QS_QF_RECORDS
QF QS records.
@ QS_SC_RECORDS
Scheduler QS records.
@ QS_U1_RECORDS
User Group 105-109 records.
@ QS_EQ_RECORDS
Event Queues QS records.
@ QS_ALL_RECORDS
all QS records
@ QS_UA_RECORDS
All User records.
Customizable and memory-efficient assertions for embedded systems.
#define Q_DEFINE_THIS_MODULE(name_)
Define the user-specified module name for assertions in this file.
char char_t
typedef for character strings.
#define Q_ASSERT_ID(id_, test_)
General purpose assertion with user-specified assertion-id.
int int_t
typedef for assertions-ids and line numbers in assertions.
#define Q_REQUIRE_ID(id_, test_)
Assertion for checking preconditions with user-specified assertion-id.
#define Q_DIM(array_)
Helper macro to calculate static dimension of a 1-dim array_.
#define Q_ERROR_ID(id_)
Assertion with user-specified assertion-id for a wrong path.
int enum_t
alias for enumerations used for event signals
#define QP_VERSION
The current QP version as a decimal constant XXYZ, where XX is a 2-digit.
#define Q_SIGNAL_SIZE
The size (in bytes) of the signal of an event. Valid values: 1U, 2U, or 4U; default 2U.
#define QS_CRIT_STAT_
This is an internal macro for defining the critical section status type.
#define QS_CRIT_X_()
This is an internal macro for exiting a critical section.
#define QS_CRIT_E_()
This is an internal macro for entering a critical section.
#define QS_U8_PRE_(data_)
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
#define QS_OBJ_PRE_(obj_)
#define QS_FUN_PRE_(fun_)
#define QS_END_NOCRIT_PRE_()
#define QS_U16_PRE_(data_)
#define QS_SIG_PRE_(sig_)
Internal (package scope) QS/C++ interface.
#define QS_INSERT_ESC_BYTE_(b_)
Internal QS macro to insert an escaped byte into the QS buffer.
#define QS_REC_NUM_(enum_)
Internal QS macro to cast enumerated QS record number to uint8_t.
#define QS_INSERT_BYTE_(b_)
Internal QS macro to insert an un-escaped byte into the QS buffer.
#define QS_STR_PRE_(msg_)
Internal QS macro to output a zero-terminated ASCII string data element.
QS/C++ port to a 32-bit CPU, generic compiler.
Application build time-stamp interface.
#define QF_EVENT_SIZ_SIZE
The size (in bytes) of the event-size representation in the QF. Valid values: 1U, 2U,...
#define QF_EQUEUE_CTR_SIZE
The size (in bytes) of the ring-buffer counters used in the native QF event queue implementation....
#define QF_MAX_ACTIVE
The maximum number of active objects in the application.
#define QF_TIMEEVT_CTR_SIZE
The size (in bytes) of the time event -counter representation in the QP::QTimeEvt class....
#define QF_MPOOL_SIZ_SIZE
The size (in bytes) of the block-size representation in the native QF event pool. Valid values: 1U,...
#define QF_MPOOL_CTR_SIZE
The size (in bytes) of the block-counter representation in the native QF event pool....
#define QF_MAX_EPOOL
The maximum number of event pools in the application.