40 #include "qf_port.hpp"
52 #error "Source file included in a project NOT based on the QK kernel"
83 bzero(&QF::timeEvtHead_[0],
sizeof(QF::timeEvtHead_));
84 bzero(&active_[0],
sizeof(active_));
111 void QF::stop(
void) {
176 void const *
const par)
178 static_cast<void>(stkSize);
185 && (stkSto ==
nullptr));
187 m_eQueue.init(qSto, qLen);
192 this->init(par, m_prio);
291 && (lockPrio > prevPrio));
368 #if (defined QK_ON_CONTEXT_SW) || (defined Q_SPY)
384 #if (defined QK_ON_CONTEXT_SW) || (defined Q_SPY)
387 #ifdef QK_ON_CONTEXT_SW
413 if (a->m_eQueue.isEmpty()) {
434 #if (defined QK_ON_CONTEXT_SW) || (defined Q_SPY)
453 #ifdef QK_ON_CONTEXT_SW
unsigned int uint_fast16_t
fast at-least 16-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
QActive active object (based on QP::QHsm implementation)
std::uint8_t m_prio
QF priority (1..QF_MAX_ACTIVE) of this active object.
QEvt const * get_(void) noexcept
Get an event from the event queue of an active object.
static void gc(QEvt const *const e) noexcept
Recycle a dynamic event.
static QActive * active_[QF_MAX_ACTIVE+1U]
array of registered active objects
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id)
Dispatches an event to QHsm.
namespace associated with the QP/C++ framework
@ QS_QF_RUN
QF_run() was entered.
@ QS_SCHED_IDLE
scheduler became idle
@ QS_SCHED_LOCK
scheduler was locked
@ QS_SCHED_UNLOCK
scheduler was unlocked
@ QS_SCHED_NEXT
scheduler found next task to execute
@ QS_SCHED_RESUME
scheduler resumed previous task (not idle)
enum_t QF_maxPubSignal_
the maximum published signal
std::uint_fast8_t QF_maxPool_
static void initial_events(void)
process all events posted during initialization */
std::uint_fast16_t QSchedStatus
The scheduler lock status.
QSubscrList * QF_subscrList_
the subscriber list array
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.
#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.
Internal (package scope) QF/C++ interface.
#define QF_CRIT_STAT_
This is an internal macro for defining the critical section status type.
#define QF_CRIT_X_()
This is an internal macro for exiting a critical section.
#define QF_CRIT_E_()
This is an internal macro for entering a critical section.
QK_Attr QK_attr_
global attributes of the QK kernel
void QK_activate_(void) noexcept
QK activator activates the next active object. The activated AO preempts.
std::uint_fast8_t QK_sched_(void) noexcept
QK scheduler finds the highest-priority thread ready to run.
std::uint8_t volatile lockPrio
lock prio (0 == no-lock)
std::uint8_t volatile lockHolder
prio of the lock holder
#define QK_ISR_CONTEXT_()
Internal port-specific macro that reports the execution context.
std::uint8_t volatile actPrio
prio of the active AO
QP::QPSet readySet
QK ready-set of AOs and "naked" threads.
void QK_onContextSw(QP::QActive *prev, QP::QActive *next)
QK context switch callback (customized in BSPs for QK)
std::uint8_t volatile nextPrio
prio of the next AO to execute
attributes of the QK kernel (in C for easy access in assembly)
#define QS_FLUSH()
Flush the QS trace data to the host.
Dummy definitions of the QS macros that avoid code generation from the QS instrumentation.
#define QS_U8_PRE_(data_)
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
#define QS_END_NOCRIT_PRE_()
#define QS_2U8_PRE_(data1_, data2_)
Internal (package scope) QS/C++ interface.
QS/C++ port to a 32-bit CPU, generic compiler.
#define QF_MAX_ACTIVE
The maximum number of active objects in the application.
void rmove(std::uint_fast8_t const n) noexcept
remove element n from the set, n = 1..QF_MAX_ACTIVE
std::uint_fast8_t findMax(void) const noexcept