QP/C  6.9.3
Real-Time Embedded Framework
qs_pkg.h
Go to the documentation of this file.
1 
40 #ifndef QS_PKG_H
41 #define QS_PKG_H
42 
43 /****************************************************************************/
51 #define QS_BEGIN_PRE_(rec_, qs_id_) \
52  if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
53  QS_CRIT_E_(); \
54  QS_beginRec_((uint_fast8_t)(rec_));
55 
63 #define QS_END_PRE_() \
64  QS_endRec_(); \
65  QS_CRIT_X_(); \
66  }
67 
75 #define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_) \
76  if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
77  QS_beginRec_((uint_fast8_t)(rec_));
78 
85 #define QS_END_NOCRIT_PRE_() QS_endRec_(); }
86 
88 #define QS_U8_PRE_(data_) (QS_u8_raw_((uint8_t)(data_)))
89 
91 #define QS_2U8_PRE_(data1_, data2_) \
92  (QS_2u8_raw_((uint8_t)(data1_), (uint8_t)(data2_)))
93 
95 #define QS_U16_PRE_(data_) (QS_u16_raw_((uint16_t)(data_)))
96 
98 #define QS_U32_PRE_(data_) (QS_u32_raw_((uint32_t)(data_)))
99 
101 #define QS_STR_PRE_(msg_) (QS_str_raw_((msg_)))
102 
103 
104 #if (Q_SIGNAL_SIZE == 1U)
109  #define QS_SIG_PRE_(sig_) (QS_u8_raw_((uint8_t)sig_))
110 #elif (Q_SIGNAL_SIZE == 2U)
111  #define QS_SIG_PRE_(sig_) (QS_u16_raw_((uint16_t)sig_))
112 #elif (Q_SIGNAL_SIZE == 4U)
113  #define QS_SIG_PRE_(sig_) (QS_u32_raw_((uint32_t)sig_))
114 #endif
115 
116 #define QS_OBJ_PRE_(obj_) (QS_obj_raw_(obj_))
117 
118 #if (QS_FUN_PTR_SIZE == 1U)
119  #define QS_FUN_PRE_(fun_) (QS_u8_raw_((uint8_t)(fun_)))
120 #elif (QS_FUN_PTR_SIZE == 2U)
121  #define QS_FUN_PRE_(fun_) (QS_u16_raw_((uint16_t)(fun_)))
122 #elif (QS_FUN_PTR_SIZE == 4U)
123  #define QS_FUN_PRE_(fun_) (QS_u32_raw_((uint32_t)(fun_)))
124 #elif (QS_FUN_PTR_SIZE == 8U)
125  #define QS_FUN_PRE_(fun_) (QS_u64_raw_((uint64_t)(fun_)))
126 #else
131  #define QS_FUN_PRE_(fun_) (QS_u32_raw_((uint32_t)(fun_)))
132 #endif
133 
134 
135 /****************************************************************************/
136 #if (QF_EQUEUE_CTR_SIZE == 1U)
137 
143  #define QS_EQC_PRE_(ctr_) QS_u8_raw_((uint8_t)(ctr_))
144 #elif (QF_EQUEUE_CTR_SIZE == 2U)
145  #define QS_EQC_PRE_(ctr_) QS_u16_raw_((uint16_t)(ctr_))
146 #elif (QF_EQUEUE_CTR_SIZE == 4U)
147  #define QS_EQC_PRE_(ctr_) QS_u32_raw_((uint32_t)(ctr_))
148 #endif
149 
150 
151 #if (QF_EVENT_SIZ_SIZE == 1U)
152 
158  #define QS_EVS_PRE_(size_) QS_u8_raw_((uint8_t)(size_))
159 #elif (QF_EVENT_SIZ_SIZE == 2U)
160  #define QS_EVS_PRE_(size_) QS_u16_raw_((uint16_t)(size_))
161 #elif (QF_EVENT_SIZ_SIZE == 4U)
162  #define QS_EVS_PRE_(size_) QS_u32_raw_((uint32_t)(size_))
163 #endif
164 
165 
166 #if (QF_MPOOL_SIZ_SIZE == 1U)
167 
173  #define QS_MPS_PRE_(size_) QS_u8_raw_((uint8_t)(size_))
174 #elif (QF_MPOOL_SIZ_SIZE == 2U)
175  #define QS_MPS_PRE_(size_) QS_u16_raw_((uint16_t)(size_))
176 #elif (QF_MPOOL_SIZ_SIZE == 4U)
177  #define QS_MPS_PRE_(size_) QS_u32_raw_((uint32_t)(size_))
178 #endif
179 
180 #if (QF_MPOOL_CTR_SIZE == 1U)
181 
187  #define QS_MPC_PRE_(ctr_) QS_u8_raw_((uint8_t)(ctr_))
188 #elif (QF_MPOOL_CTR_SIZE == 2U)
189  #define QS_MPC_PRE_(ctr_) QS_u16_raw_((uint16_t)(ctr_))
190 #elif (QF_MPOOL_CTR_SIZE == 4U)
191  #define QS_MPC_PRE_(ctr_) QS_u32_raw_((uint16_t)(ctr_))
192 #endif
193 
194 
195 #if (QF_TIMEEVT_CTR_SIZE == 1U)
196 
202  #define QS_TEC_PRE_(ctr_) QS_u8_raw_((uint8_t)(ctr_))
203 #elif (QF_TIMEEVT_CTR_SIZE == 2U)
204  #define QS_TEC_PRE_(ctr_) QS_u16_raw_((uint16_t)(ctr_))
205 #elif (QF_TIMEEVT_CTR_SIZE == 4U)
206  #define QS_TEC_PRE_(ctr_) QS_u32_raw_((uint32_t)(ctr_))
207 #endif
208 
209 
210 /****************************************************************************/
212 #define QS_INSERT_BYTE_(b_) \
213  buf[head] = (b_); \
214  ++head; \
215  if (head == end) { \
216  head = 0U; \
217  }
218 
219 /****************************************************************************/
221 #define QS_INSERT_ESC_BYTE_(b_) \
222  chksum = (uint8_t)(chksum + (b_)); \
223  if (((b_) != QS_FRAME) && ((b_) != QS_ESC)) { \
224  QS_INSERT_BYTE_(b_) \
225  } \
226  else { \
227  QS_INSERT_BYTE_(QS_ESC) \
228  QS_INSERT_BYTE_((uint8_t)((b_) ^ QS_ESC_XOR))\
229  ++QS_priv_.used; \
230  }
231 
232 /****************************************************************************/
234 #define QS_FRAME (0x7EU)
235 
236 /****************************************************************************/
238 #define QS_ESC (0x7DU)
239 
240 /****************************************************************************/
242 #define QS_GOOD_CHKSUM (0xFFU)
243 
244 /****************************************************************************/
251 #define QS_ESC_XOR (0x20U)
252 
253 /****************************************************************************/
256 void QS_target_info_pre_(uint8_t isReset);
257 
258 /****************************************************************************/
262 typedef struct {
263  void *currObj[MAX_OBJ];
268 #ifdef Q_UTEST
270  bool inTestLoop;
271 #endif
272 } QSrxPrivAttr;
273 
274 extern QSrxPrivAttr QS_rxPriv_; /* QS-RX private attributes */
275 
276 #endif /* QS_PKG_H */
277 
unsigned char uint8_t
Definition: 16bit/stdint.h:29
Definition: qpset.h:68
@ MAX_OBJ
Definition: qs.h:867
uint_fast16_t QSCtr
Definition: qs.h:857
QPSet readySet
Definition: qs_pkg.h:269
uint8_t * buf
Definition: qs_pkg.h:264
void QS_target_info_pre_(uint8_t isReset)
Definition: qs.c:433
QSCtr head
Definition: qs_pkg.h:266
bool inTestLoop
Definition: qs_pkg.h:270
QSCtr end
Definition: qs_pkg.h:265
QSCtr tail
Definition: qs_pkg.h:267
QSrxPrivAttr QS_rxPriv_
Definition: qs_rx.c:48