QP/C++  8.0.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qf_time.cpp
Go to the documentation of this file.
1//$file${src::qf::qf_time.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpcpp.qm
4// File: ${src::qf::qf_time.cpp}
5//
6// This code has been generated by QM 7.0.0 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
10//
11// Q u a n t u m L e a P s
12// ------------------------
13// Modern Embedded Software
14//
15// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
16//
17// The QP/C++ software is dual-licensed under the terms of the open-source
18// GNU General Public License (GPL) or under the terms of one of the closed-
19// source Quantum Leaps commercial licenses.
20//
21// Redistributions in source code must retain this top-level comment block.
22// Plagiarizing this software to sidestep the license obligations is illegal.
23//
24// NOTE:
25// The GPL does NOT permit the incorporation of this code into proprietary
26// programs. Please contact Quantum Leaps for commercial licensing options,
27// which expressly supersede the GPL and are designed explicitly for
28// closed-source distribution.
29//
30// Quantum Leaps contact information:
31// <www.state-machine.com/licensing>
32// <info@state-machine.com>
33//
34//$endhead${src::qf::qf_time.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35#define QP_IMPL // this is QP implementation
36#include "qp_port.hpp" // QP port
37#include "qp_pkg.hpp" // QP package-scope interface
38#include "qsafe.h" // QP Functional Safety (FuSa) Subsystem
39#ifdef Q_SPY // QS software tracing enabled?
40 #include "qs_port.hpp" // QS port
41 #include "qs_pkg.hpp" // QS facilities for pre-defined trace records
42#else
43 #include "qs_dummy.hpp" // disable the QS software tracing
44#endif // Q_SPY
45
46// unnamed namespace for local definitions with internal linkage
47namespace {
48Q_DEFINE_THIS_MODULE("qf_time")
49} // unnamed namespace
50
51//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
52// Check for the minimum required QP version
53#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
54#error qpcpp version 7.3.0 or higher required
55#endif
56//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57//$define${QF::QTimeEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
58namespace QP {
59
60//${QF::QTimeEvt} ............................................................
62
63#ifndef Q_UNSAFE
65#endif // ndef Q_UNSAFE
66
67//${QF::QTimeEvt::QTimeEvt} ..................................................
69 QActive * const act,
70 QSignal const sig,
71 std::uint_fast8_t const tickRate) noexcept
72 : QEvt(sig),
73 m_next(nullptr),
74#ifndef Q_UNSAFE
75 m_next_dis(static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(nullptr))),
76#endif
77 m_act(act),
78 m_ctr(0U),
79#ifndef Q_UNSAFE
80 m_ctr_dis(static_cast<QTimeEvtCtr>(~static_cast<QTimeEvtCtr>(0U))),
81#endif
82 m_interval(0U),
83 m_tickRate(0U),
84 m_flags(0U)
85{
88 Q_REQUIRE_INCRIT(300, (sig != 0U)
89 && (tickRate < QF_MAX_TICK_RATE));
91
92 // adjust the settings from the QEvt(sig) ctor
93 evtTag_ = 0x0FU;
94 refCtr_ = 0U;
95}
96
97//${QF::QTimeEvt::armX} ......................................................
99 std::uint32_t const nTicks,
100 std::uint32_t const interval) noexcept
101{
104 QF_MEM_SYS();
105
106 // dynamic range checks
107 #if (QF_TIMEEVT_CTR_SIZE == 1U)
108 Q_REQUIRE_INCRIT(400, (nTicks < 0xFFU) && (interval < 0xFFU));
109 #elif (QF_TIMEEVT_CTR_SIZE == 2U)
110 Q_REQUIRE_INCRIT(400, (nTicks < 0xFFFFU) && (interval < 0xFFFFU));
111 #endif
112
113 Q_REQUIRE_INCRIT(401, verify_() && (nTicks != 0U));
114
115 QTimeEvtCtr const ctr = m_ctr;
116 std::uint8_t const tickRate = m_tickRate;
117 #ifdef Q_SPY
118 std::uint_fast8_t const qsId =
119 static_cast<QActive const *>(m_act)->m_prio;
120 #endif // def Q_SPY
121
122 Q_REQUIRE_INCRIT(410, (ctr == 0U)
123 && (m_act != nullptr)
124 && (tickRate < QF_MAX_TICK_RATE));
125
126 #ifndef Q_UNSAFE
127 Q_INVARIANT_INCRIT(411, ctr == static_cast<QTimeEvtCtr>(~m_ctr_dis));
128 #else
129 Q_UNUSED_PAR(ctr);
130 #endif // ndef Q_UNSAFE
131
132 m_ctr = static_cast<QTimeEvtCtr>(nTicks);
133 m_interval = static_cast<QTimeEvtCtr>(interval);
134 #ifndef Q_UNSAFE
135 m_ctr_dis = static_cast<QTimeEvtCtr>(~nTicks);
136 #endif // ndef Q_UNSAFE
137
138 // is the time event unlinked?
139 // NOTE: For the duration of a single clock tick of the specified tick
140 // rate a time event can be disarmed and yet still linked into the list
141 // because un-linking is performed exclusively in the QF_tickX() function.
142 if ((m_flags & QTE_FLAG_IS_LINKED) == 0U) {
143 m_flags |= QTE_FLAG_IS_LINKED; // mark as linked
144
145 // The time event is initially inserted into the separate
146 // "freshly armed" list based on timeEvtHead_[tickRate].act.
147 // Only later, inside QTimeEvt::tick(), the "freshly armed"
148 // list is appended to the main list of armed time events based on
149 // timeEvtHead_[tickRate].next. Again, this is to keep any
150 // changes to the main list exclusively inside QTimeEvt::tick().
151 #ifndef Q_UNSAFE
153 Q_PTR2UINT_CAST_(m_next) ==
154 static_cast<std::uintptr_t>(~m_next_dis));
156 Q_PTR2UINT_CAST_(timeEvtHead_[tickRate].m_act) ==
157 static_cast<std::uintptr_t>(~timeEvtHead_dis_[tickRate].m_ptr_dis));
158 #endif
159 m_next = timeEvtHead_[tickRate].toTimeEvt();
160 timeEvtHead_[tickRate].m_act = this;
161 #ifndef Q_UNSAFE
162 m_next_dis =
163 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(m_next));
164 timeEvtHead_dis_[tickRate].m_ptr_dis =
165 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(this));
166 #endif // ndef Q_UNSAFE
167 }
168
169 QS_BEGIN_PRE(QS_QF_TIMEEVT_ARM, qsId)
170 QS_TIME_PRE(); // timestamp
171 QS_OBJ_PRE(this); // this time event object
172 QS_OBJ_PRE(m_act); // the active object
173 QS_TEC_PRE(nTicks); // the # ticks
174 QS_TEC_PRE(interval); // the interval
175 QS_U8_PRE(tickRate); // tick rate
176 QS_END_PRE()
177
178 QF_MEM_APP();
179 QF_CRIT_EXIT();
180}
181
182//${QF::QTimeEvt::disarm} ....................................................
183bool QTimeEvt::disarm() noexcept {
186 QF_MEM_SYS();
187
189
190 QTimeEvtCtr const ctr = m_ctr;
191 #ifndef Q_UNSAFE
192 Q_INVARIANT_INCRIT(501, ctr == static_cast<QTimeEvtCtr>(~m_ctr_dis));
193 #endif // ndef Q_UNSAFE
194
195 #ifdef Q_SPY
196 std::uint_fast8_t const qsId = static_cast<QActive *>(m_act)->m_prio;
197 #endif
198
199 // was the time event actually armed?
200 bool wasArmed;
201 if (ctr != 0U) {
202 wasArmed = true;
204 m_ctr = 0U; // schedule removal from the list
205 #ifndef Q_UNSAFE
206 m_ctr_dis = static_cast<QTimeEvtCtr>(~static_cast<QTimeEvtCtr>(0U));
207 #endif // ndef Q_UNSAFE
208
209 QS_BEGIN_PRE(QS_QF_TIMEEVT_DISARM, qsId)
210 QS_TIME_PRE(); // timestamp
211 QS_OBJ_PRE(this); // this time event object
212 QS_OBJ_PRE(m_act); // the target AO
213 QS_TEC_PRE(ctr); // the # ticks
214 QS_TEC_PRE(m_interval); // the interval
215 QS_U8_PRE(m_tickRate); // tick rate
216 QS_END_PRE()
217 }
218 else { // the time event was already disarmed automatically
219 wasArmed = false;
220 m_flags &= static_cast<std::uint8_t>(~QTE_FLAG_WAS_DISARMED);
221
222 QS_BEGIN_PRE(QS_QF_TIMEEVT_DISARM_ATTEMPT, qsId)
223 QS_TIME_PRE(); // timestamp
224 QS_OBJ_PRE(this); // this time event object
225 QS_OBJ_PRE(m_act); // the target AO
226 QS_U8_PRE(m_tickRate); // tick rate
227 QS_END_PRE()
228 }
229
230 QF_MEM_APP();
231 QF_CRIT_EXIT();
232
233 return wasArmed;
234}
235
236//${QF::QTimeEvt::rearm} .....................................................
237bool QTimeEvt::rearm(std::uint32_t const nTicks) noexcept {
240 QF_MEM_SYS();
241
242 // dynamic range checks
243 #if (QF_TIMEEVT_CTR_SIZE == 1U)
244 Q_REQUIRE_INCRIT(600, nTicks < 0xFFU);
245 #elif (QF_TIMEEVT_CTR_SIZE == 2U)
246 Q_REQUIRE_INCRIT(600, nTicks < 0xFFFFU);
247 #endif
248
249 Q_REQUIRE_INCRIT(601, verify_() && (nTicks != 0U));
250
251 QTimeEvtCtr const ctr = m_ctr;
252 std::uint8_t const tickRate = m_tickRate;
253 #ifdef Q_SPY
254 std::uint_fast8_t const qsId = static_cast<QActive *>(m_act)->m_prio;
255 #endif
256
257 Q_REQUIRE_INCRIT(610, (m_act != nullptr)
258 && (tickRate < QF_MAX_TICK_RATE));
259
260 #ifndef Q_UNSAFE
261 Q_INVARIANT_INCRIT(602, ctr == static_cast<QTimeEvtCtr>(~m_ctr_dis));
262 #endif // ndef Q_UNSAFE
263 m_ctr = static_cast<QTimeEvtCtr>(nTicks);
264 #ifndef Q_UNSAFE
265 m_ctr_dis = static_cast<QTimeEvtCtr>(~nTicks);
266 #endif // ndef Q_UNSAFE
267
268 // is the time evt not running?
269 bool wasArmed;
270 if (ctr == 0U) {
271 wasArmed = false;
272
273 // NOTE: For a duration of a single clock tick of the specified
274 // tick rate a time event can be disarmed and yet still linked into
275 // the list, because unlinking is performed exclusively in the
276 // QTimeEvt::tick() function.
277
278 // was the time event unlinked?
279 if ((m_flags & QTE_FLAG_IS_LINKED) == 0U) {
280 m_flags |= QTE_FLAG_IS_LINKED; // mark as linked
281
282 // The time event is initially inserted into the separate
283 // "freshly armed" list based on timeEvtHead_[tickRate].act.
284 // Only later, inside QTimeEvt::tick(), the "freshly armed"
285 // list is appended to the main list of armed time events based on
286 // timeEvtHead_[tickRate].next. Again, this is to keep any
287 // changes to the main list exclusively inside QTimeEvt::tick().
288 #ifndef Q_UNSAFE
290 Q_PTR2UINT_CAST_(m_next) ==
291 static_cast<std::uintptr_t>(~m_next_dis));
293 Q_PTR2UINT_CAST_(timeEvtHead_[tickRate].m_act) ==
294 static_cast<std::uintptr_t>(~timeEvtHead_dis_[tickRate].m_ptr_dis));
295 #endif
296 m_next = timeEvtHead_[tickRate].toTimeEvt();
297 timeEvtHead_[tickRate].m_act = this;
298 #ifndef Q_UNSAFE
299 m_next_dis =
300 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(m_next));
301 timeEvtHead_dis_[tickRate].m_ptr_dis =
302 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(this));
303 #endif // ndef Q_UNSAFE
304 }
305 }
306 else { // the time event was armed
307 wasArmed = true;
308 }
309
310 QS_BEGIN_PRE(QS_QF_TIMEEVT_REARM, qsId)
311 QS_TIME_PRE(); // timestamp
312 QS_OBJ_PRE(this); // this time event object
313 QS_OBJ_PRE(m_act); // the target AO
314 QS_TEC_PRE(nTicks); // the # ticks
315 QS_TEC_PRE(m_interval); // the interval
316 QS_2U8_PRE(tickRate, (wasArmed ? 1U : 0U));
317 QS_END_PRE()
318
319 QF_MEM_APP();
320 QF_CRIT_EXIT();
321
322 return wasArmed;
323}
324
325//${QF::QTimeEvt::wasDisarmed} ...............................................
326bool QTimeEvt::wasDisarmed() noexcept {
329 QF_MEM_SYS();
330
331 bool const wasDisarmed = (m_flags & QTE_FLAG_WAS_DISARMED) != 0U;
333
334 QF_MEM_APP();
335 QF_CRIT_EXIT();
336
337 return wasDisarmed;
338}
339
340//${QF::QTimeEvt::tick} ......................................................
342 std::uint_fast8_t const tickRate,
343 void const * const sender) noexcept
344{
345 #ifndef Q_SPY
346 Q_UNUSED_PAR(sender);
347 #endif
348
351 QF_MEM_SYS();
352
353 Q_REQUIRE_INCRIT(800, tickRate < Q_DIM(timeEvtHead_));
354
355 QTimeEvt *prev = &timeEvtHead_[tickRate];
356
357 QS_BEGIN_PRE(QS_QF_TICK, 0U)
358 prev->m_ctr = (prev->m_ctr + 1U);
359 QS_TEC_PRE(prev->m_ctr); // tick ctr
360 QS_U8_PRE(tickRate); // tick rate
361 QS_END_PRE()
362
363 // scan the linked-list of time events at this rate...
364 std::uint_fast8_t lbound = 2U*QF_MAX_ACTIVE; // fixed upper loop bound
365 for (; lbound > 0U; --lbound) {
366 Q_ASSERT_INCRIT(810, prev != nullptr); // sanity check
367
368 QTimeEvt *te = prev->m_next; // advance down the time evt. list
369 #ifndef Q_UNSAFE
371 Q_PTR2UINT_CAST_(te) ==
372 static_cast<std::uintptr_t>(~prev->m_next_dis));
373 #endif // ndef Q_UNSAFE
374
375 if (te == nullptr) { // end of the list?
376
377 // any new time events armed since the last QTimeEvt_tick_()?
378 if (timeEvtHead_[tickRate].m_act != nullptr) {
379 #ifndef Q_UNSAFE
381 Q_PTR2UINT_CAST_(timeEvtHead_[tickRate].m_act) ==
382 static_cast<std::uintptr_t>(
383 ~timeEvtHead_dis_[tickRate].m_ptr_dis));
384 #endif // ndef Q_UNSAFE
385 prev->m_next = timeEvtHead_[tickRate].toTimeEvt();
386 timeEvtHead_[tickRate].m_act = nullptr;
387 #ifndef Q_UNSAFE
388 prev->m_next_dis =
389 static_cast<std::uintptr_t>(
390 ~Q_PTR2UINT_CAST_(prev->m_next));
391 timeEvtHead_dis_[tickRate].m_ptr_dis =
392 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(nullptr));
393 #endif // ndef Q_UNSAFE
394
395 te = prev->m_next; // switch to the new list
396 }
397 else { // all currently armed time events are processed
398 break; // terminate the for-loop
399 }
400 }
401
402 // the time event 'te' must be valid
403 Q_ASSERT_INCRIT(820, te != nullptr);
404 Q_INVARIANT_INCRIT(821, te->verify_());
405
406 QTimeEvtCtr ctr = te->m_ctr;
407 #ifndef Q_UNSAFE
408 Q_INVARIANT_INCRIT(822, ctr ==
409 static_cast<QTimeEvtCtr>(~te->m_ctr_dis));
410 #endif // ndef Q_UNSAFE
411
412 if (ctr == 0U) { // time event scheduled for removal?
413 prev->m_next = te->m_next;
414 #ifndef Q_UNSAFE
415 prev->m_next_dis =
416 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(te->m_next));
417 #endif // ndef Q_UNSAFE
418
419 // mark time event 'te' as NOT linked
420 te->m_flags &= static_cast<std::uint8_t>(~QTE_FLAG_IS_LINKED);
421
422 // do NOT advance the prev pointer
423 QF_MEM_APP();
424 QF_CRIT_EXIT(); // exit crit. section to reduce latency
425
426 // NOTE: prevent merging critical sections
427 // In some QF ports the critical section exit takes effect only
428 // on the next machine instruction. If the next instruction is
429 // another entry to a critical section, the critical section
430 // might not be really exited, but rather the two adjacent
431 // critical sections would be MERGED. The QF_CRIT_EXIT_NOP()
432 // macro contains minimal code required to prevent such merging
433 // of critical sections in QF ports, in which it can occur.
435 }
436 else if (ctr == 1U) { // is time evt about to expire?
437 QActive * const act = te->toActive();
438 if (te->m_interval != 0U) { // periodic time evt?
439 te->m_ctr = te->m_interval; // rearm the time event
440 #ifndef Q_UNSAFE
441 te->m_ctr_dis = static_cast<QTimeEvtCtr>(~te->m_interval);
442 #endif // ndef Q_UNSAFE
443 prev = te; // advance to this time event
444 }
445 else { // one-shot time event: automatically disarm
446 te->m_ctr = 0U;
447 prev->m_next = te->m_next;
448 #ifndef Q_UNSAFE
449 te->m_ctr_dis =
450 static_cast<QTimeEvtCtr>(~static_cast<QTimeEvtCtr>(0U));
451 prev->m_next_dis =
452 static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(te->m_next));
453 #endif // ndef Q_UNSAFE
454
455 // mark time event 'te' as NOT linked
456 te->m_flags &=
457 static_cast<std::uint8_t>(~QTE_FLAG_IS_LINKED);
458 // do NOT advance the prev pointer
459
460 QS_BEGIN_PRE(QS_QF_TIMEEVT_AUTO_DISARM, act->m_prio)
461 QS_OBJ_PRE(te); // this time event object
462 QS_OBJ_PRE(act); // the target AO
463 QS_U8_PRE(tickRate); // tick rate
464 QS_END_PRE()
465 }
466
467 QS_BEGIN_PRE(QS_QF_TIMEEVT_POST, act->m_prio)
468 QS_TIME_PRE(); // timestamp
469 QS_OBJ_PRE(te); // the time event object
470 QS_SIG_PRE(te->sig); // signal of this time event
471 QS_OBJ_PRE(act); // the target AO
472 QS_U8_PRE(tickRate); // tick rate
473 QS_END_PRE()
474
475 #ifdef QXK_HPP_
476 if (te->sig < Q_USER_SIG) {
477 QXThread::timeout_(act);
478 QF_MEM_APP();
479 QF_CRIT_EXIT();
480 }
481 else {
482 QF_MEM_APP();
483 QF_CRIT_EXIT(); // exit crit. section before posting
484
485 // act->POST() asserts if the queue overflows
486 act->POST(te, sender);
487 }
488 #else
489 QF_MEM_APP();
490 QF_CRIT_EXIT(); // exit crit. section before posting
491
492 // act->POST() asserts if the queue overflows
493 act->POST(te, sender);
494 #endif
495 }
496 else { // time event keeps timing out
497 --ctr; // decrement the tick counter
498 te->m_ctr = ctr; // update the original
499 #ifndef Q_UNSAFE
500 te->m_ctr_dis = static_cast<QTimeEvtCtr>(~ctr);
501 #endif // ndef Q_UNSAFE
502
503 prev = te; // advance to this time event
504
505 QF_MEM_APP();
506 QF_CRIT_EXIT(); // exit crit. section to reduce latency
507
508 // prevent merging critical sections, see NOTE above
510 }
511 QF_CRIT_ENTRY(); // re-enter crit. section to continue the loop
512 QF_MEM_SYS();
513 }
514
515 Q_ENSURE_INCRIT(890, lbound > 0U);
516 QF_MEM_APP();
517 QF_CRIT_EXIT();
518}
519
520//${QF::QTimeEvt::noActive} ..................................................
521bool QTimeEvt::noActive(std::uint_fast8_t const tickRate) noexcept {
524 Q_REQUIRE_INCRIT(900, tickRate < QF_MAX_TICK_RATE);
525 QF_CRIT_EXIT();
526
527 bool inactive;
528 if (timeEvtHead_[tickRate].m_next != nullptr) {
529 inactive = false;
530 }
531 else if (timeEvtHead_[tickRate].m_act != nullptr) {
532 inactive = false;
533 }
534 else {
535 inactive = true;
536 }
537 return inactive;
538}
539
540//${QF::QTimeEvt::QTimeEvt} ..................................................
542 : QEvt(0U),
543 m_next(nullptr),
544#ifndef Q_UNSAFE
545 m_next_dis(static_cast<std::uintptr_t>(~Q_PTR2UINT_CAST_(nullptr))),
546#endif
547 m_act(nullptr),
548 m_ctr(0U),
549#ifndef Q_UNSAFE
550 m_ctr_dis(static_cast<QTimeEvtCtr>(~static_cast<QTimeEvtCtr>(0U))),
551#endif
552 m_interval(0U),
553 m_tickRate(0U),
554 m_flags(0U)
555{}
556
557} // namespace QP
558//$enddef${QF::QTimeEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Active object class (based on the QHsm implementation strategy)
Definition qp.hpp:699
std::uint8_t m_prio
Definition qp.hpp:701
Event class.
Definition qp.hpp:131
QSignal sig
Signal of the event (see Event Signal)
Definition qp.hpp:133
bool verify_() const noexcept
Internal function to verify the internal integrity of the event instance (QP FuSa Subsystem)
Definition qp.hpp:154
Time Event class.
Definition qp.hpp:927
static void tick(std::uint_fast8_t const tickRate, void const *const sender) noexcept
Definition qf_time.cpp:341
QTimeEvt * toTimeEvt() noexcept
Definition qp.hpp:997
static QTimeEvt timeEvtHead_[QF_MAX_TICK_RATE]
Definition qp.hpp:945
bool disarm() noexcept
Definition qf_time.cpp:183
std::uint8_t m_flags
Definition qp.hpp:942
QTimeEvt() noexcept
Definition qf_time.cpp:541
static QPtrDis timeEvtHead_dis_[QF_MAX_TICK_RATE]
Definition qp.hpp:948
std::uintptr_t m_next_dis
Definition qp.hpp:932
static bool noActive(std::uint_fast8_t const tickRate) noexcept
Definition qf_time.cpp:521
void * m_act
Active object that receives the time events.
Definition qp.hpp:934
QTimeEvt *volatile m_next
Link to the next time event in the list.
Definition qp.hpp:929
QActive * toActive() noexcept
Definition qp.hpp:994
std::uint8_t m_tickRate
Definition qp.hpp:941
void armX(std::uint32_t const nTicks, std::uint32_t const interval=0U) noexcept
Definition qf_time.cpp:98
bool rearm(std::uint32_t const nTicks) noexcept
Definition qf_time.cpp:237
QTimeEvtCtr volatile m_ctr
Down-counter of the time event.
Definition qp.hpp:935
QTimeEvtCtr m_interval
Interval for periodic time event (zero for one-shot time event)
Definition qp.hpp:940
bool wasDisarmed() noexcept
Definition qf_time.cpp:326
QTimeEvtCtr m_ctr_dis
Definition qp.hpp:938
QP/C++ framework.
Definition qequeue.hpp:42
constexpr enum_t Q_USER_SIG
Definition qp.hpp:209
std::uint32_t QTimeEvtCtr
Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE.
Definition qp.hpp:548
constexpr std::uint8_t QTE_FLAG_WAS_DISARMED
Definition qp_pkg.hpp:79
std::uint16_t QSignal
The signal of event QP::QEvt.
Definition qp.hpp:122
constexpr std::uint8_t QTE_FLAG_IS_LINKED
Definition qp_pkg.hpp:78
#define QF_MEM_APP()
Definition qp.hpp:1322
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
Definition qp.hpp:498
#define QF_MEM_SYS()
Definition qp.hpp:1317
#define Q_DIM(array_)
Definition qp.hpp:501
#define QF_CRIT_EXIT_NOP()
Definition qp.hpp:1312
#define QF_MAX_TICK_RATE
Maximum # clock tick rates in the system (0..15)
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64)
Internal (package scope) QP/C++ interface.
#define Q_PTR2UINT_CAST_(ptr_)
Internal helper macro to cast pointers to integers.
Definition qp_pkg.hpp:72
Sample QP/C++ port.
#define QS_OBJ_PRE(obj_)
Definition qs_dummy.hpp:158
#define QS_TEC_PRE(ctr_)
Definition qs_dummy.hpp:163
#define QS_SIG_PRE(sig_)
Definition qs_dummy.hpp:156
#define QS_TIME_PRE()
Definition qs_dummy.hpp:155
#define QS_2U8_PRE(data1_, data2_)
Definition qs_dummy.hpp:152
#define QS_U8_PRE(data_)
Definition qs_dummy.hpp:151
#define QS_END_PRE()
Definition qs_dummy.hpp:150
#define QS_BEGIN_PRE(rec_, qsId_)
Definition qs_dummy.hpp:149
QS/C++ port to a 32-bit CPU, generic C++ compiler.
QP Functional Safety (FuSa) Subsystem.
#define QF_CRIT_ENTRY()
Definition qsafe.h:58
#define Q_ASSERT_INCRIT(id_, expr_)
Definition qsafe.h:72
#define Q_INVARIANT_INCRIT(id_, expr_)
Definition qsafe.h:154
#define Q_ENSURE_INCRIT(id_, expr_)
Definition qsafe.h:145
#define QF_CRIT_EXIT()
Definition qsafe.h:62
#define Q_REQUIRE_INCRIT(id_, expr_)
Definition qsafe.h:136
#define QF_CRIT_STAT
Definition qsafe.h:54