4646//! @endcond
4747
4848//============================================================================
49- //! pre -defined QS record IDs (for QS_GLB_FILTER())
50- enum QS_GlbPre {
49+ //! Pre -defined QS record IDs (for QS_GLB_FILTER())
50+ enum QS_GlbPredef {
5151 // [0] QS session (not maskable)
5252 QS_EMPTY , //!< QS record for cleanly starting a session
5353
@@ -199,10 +199,10 @@ enum QS_GlbPre {
199199#define QS_USER4 ((enum_t)(QS_USER + 20))
200200
201201// QS ID group offsets (for QS_LOC_FILTER())
202- #define QS_ID_AO ((int_fast16_t )0)
203- #define QS_ID_EP ((int_fast16_t )64)
204- #define QS_ID_EQ ((int_fast16_t )80)
205- #define QS_ID_AP ((int_fast16_t )96)
202+ #define QS_ID_AO ((uint_fast16_t )0)
203+ #define QS_ID_EP ((uint_fast16_t )64)
204+ #define QS_ID_EQ ((uint_fast16_t )80)
205+ #define QS_ID_AP ((uint_fast16_t )96)
206206
207207// QS ID groups (for QS_LOC_FILTER())
208208#define QS_IDS_ALL ((int_fast16_t)0xF0)
@@ -262,7 +262,9 @@ typedef void (* QSpyFunPtr )(void);
262262#define QS_FLUSH () (QS_onFlush())
263263
264264#define QS_BEGIN_ID (rec_ , qsId_ ) \
265- if (QS_fltCheck_((rec_) >> 5U, (uint32_t)1U << ((rec_) & 0x1FU), (qsId_))) { \
265+ if (QS_fltCheck_((uint32_t)(rec_) >> 5U, \
266+ (uint32_t)1U << ((uint32_t)(rec_) & 0x1FU), \
267+ (qsId_))) { \
266268 QS_CRIT_STAT \
267269 QS_CRIT_ENTRY(); \
268270 QS_beginRec_((uint_fast8_t)(rec_)); \
@@ -274,8 +276,8 @@ if (QS_fltCheck_((rec_) >> 5U, (uint32_t)1U << ((rec_) & 0x1FU), (qsId_))) { \
274276}
275277
276278#define QS_BEGIN_INCRIT (rec_ , qsId_ ) \
277- if (QS_fltCheck_((rec_) >> 5U, \
278- (uint_fast32_t)1U << ((rec_) & 0x1FU), (qsId_))) \
279+ if (QS_fltCheck_((uint32_t)( rec_) >> 5U, \
280+ (uint_fast32_t)1U << ((uint32_t) (rec_) & 0x1FU), (qsId_))) \
279281{ \
280282 QS_beginRec_((uint_fast8_t)(rec_)); \
281283 QS_TIME_PRE(); {
@@ -285,7 +287,8 @@ if (QS_fltCheck_((rec_) >> 5U, \
285287}
286288
287289#define QS_GLB_CHECK_ (rec_ ) \
288- (QS_glbCheck_((rec_) >> 5U, (uint_fast32_t)1U << ((rec_) & 0x1FU)))
290+ (QS_glbCheck_((uint32_t)(rec_) >> 5U, \
291+ (uint32_t)1U << ((uint32_t)(rec_) & 0x1FU)))
289292#define QS_LOC_CHECK_ (qsId_ ) (QS_locCheck_((qsId_)))
290293
291294#ifndef QS_REC_DONE
@@ -411,18 +414,23 @@ if (QS_fltCheck_((rec_) >> 5U, \
411414//============================================================================
412415//! @class QS
413416typedef struct {
414- //! @cond INTERNAL
415- uint8_t dummy ;
416- //! @endcond
417+ uint8_t * buf ; //!< @private @memberof QS
418+ QSCtr end ; //!< @private @memberof QS
419+ QSCtr head ; //!< @private @memberof QS
420+ QSCtr tail ; //!< @private @memberof QS
421+ QSCtr used ; //!< @private @memberof QS
422+ uint8_t seq ; //!< @private @memberof QS
423+ uint8_t chksum ; //!< @private @memberof QS
424+ uint8_t critNest ; //!< @private @memberof QS
425+ uint8_t flags ; //!< @private @memberof QS
417426} QS ;
418427
419- //! @cond INTERNAL
420-
421- #if defined(QS_MEM_SYS ) || defined(QS_MEM_APP )
422- #error Memory isolation not supported in this QP edition, need SafeQP
423- #endif
428+ //! @static @private @memberof QS
429+ extern QS QS_priv_ ;
424430
425431//----------------------------------------------------------------------------
432+ //! @cond INTERNAL
433+
426434//! @struct QS_Filter
427435typedef struct {
428436 uint32_t glb [4 ];
@@ -432,22 +440,6 @@ typedef struct {
432440//! @static @private @memberof QS
433441extern QS_Filter QS_filt_ ;
434442
435- //! @struct QS_Attr
436- typedef struct {
437- uint8_t * buf ; //!< @private @memberof QS
438- QSCtr end ; //!< @private @memberof QS
439- QSCtr head ; //!< @private @memberof QS
440- QSCtr tail ; //!< @private @memberof QS
441- QSCtr used ; //!< @private @memberof QS
442- uint8_t seq ; //!< @private @memberof QS
443- uint8_t chksum ; //!< @private @memberof QS
444- uint8_t critNest ; //!< @private @memberof QS
445- uint8_t flags ; //!< @private @memberof QS
446- } QS_Attr ;
447-
448- //! @static @private @memberof QS
449- extern QS_Attr QS_priv_ ;
450-
451443void QS_glbFilter_ (int_fast16_t const filterSpec );
452444void QS_locFilter_ (int_fast16_t const filterSpec );
453445
@@ -512,6 +504,9 @@ void QS_assertion_pre_(char const * const module, int_t const id,
512504#define QS_U64_FMT ((uint8_t)0xEU)
513505#define QS_HEX_FMT ((uint8_t)0xFU)
514506
507+ //! @endcond
508+ //----------------------------------------------------------------------------
509+
515510// @struct TProbe
516511struct QS_TProbe {
517512 QSFun addr ;
@@ -533,17 +528,11 @@ typedef struct {
533528
534529extern QSTestAttr QS_tstPriv_ ;
535530
536- void QS_test_pause_ (void );
537- uint32_t QS_getTestProbe_ (QSpyFunPtr const api );
538-
539531struct QS_RxAttr ; // forward declaration
540532
541533//! @static @private @memberof QS
542534extern struct QS_RxAttr * const QS_rxPriv_ ;
543535
544- //! @endcond
545- //----------------------------------------------------------------------------
546-
547536//! @static @public @memberof QS
548537void QS_initBuf (
549538 uint8_t * const sto ,
@@ -630,14 +619,12 @@ void QS_onCommand(
630619 uint32_t param2 ,
631620 uint32_t param3 );
632621
633- //! @cond INTERNAL
634622typedef enum {
635623 QS_TARGET_NO_RESET ,
636624 QS_TARGET_RESET
637625} QS_ResetAction ;
638626
639627void QS_target_info_pre_ (QS_ResetAction const act );
640- //! @endcond
641628
642629//============================================================================
643630#ifdef Q_UTEST
@@ -661,6 +648,10 @@ void QS_onTestPost(
661648//! @static @public @memberof QS
662649void QS_onTestLoop (void );
663650
651+ void QS_test_pause_ (void );
652+
653+ uint32_t QS_getTestProbe_ (QSpyFunPtr const api );
654+
664655//============================================================================
665656// QP-stub for QUTest
666657// NOTE: The QP-stub is needed for unit testing QP applications,
@@ -765,6 +756,13 @@ void QF_schedUnlock(QSchedStatus const prevCeil);
765756#define QS_TEST_PROBE_ID (id_ , code_ )
766757#define QS_TEST_PAUSE () ((void)0)
767758
759+ //----------------------------------------------------------------------------
760+ // memory protection facilities
761+
762+ #ifdef QF_MEM_ISOLATE
763+ #error Memory isolation not supported in this QP edition, need SafeQP
764+ #endif
765+
768766#endif // Q_UTEST
769767
770768#endif // QS_H_
0 commit comments