36 #include "qs_port.hpp"
39 #include "qs_dummy.hpp"
44 #error "Source file included in a project NOT based on the QK kernel"
115 QEvt const * *
const qSto, std::uint_fast16_t
const qLen,
116 void *
const stkSto, std::uint_fast16_t
const stkSize,
117 void const *
const par)
119 static_cast<void>(stkSize);
126 && (stkSto ==
nullptr));
128 m_eQueue.init(qSto, qLen);
130 m_prio =
static_cast<std::uint8_t
>(prio);
183 std::uint_fast8_t
const lockPrio =
185 std::uint_fast8_t
const prevPrio =
186 static_cast<std::uint_fast8_t
>(stat >> 8U);
194 && (lockPrio > prevPrio));
242 std::uint_fast8_t
const pin =
252#if (defined QK_ON_CONTEXT_SW) || (defined Q_SPY)
253 std::uint_fast8_t pprev = pin;
269#if (defined QK_ON_CONTEXT_SW) || (defined Q_SPY)
272#ifdef QK_ON_CONTEXT_SW
298 if (a->m_eQueue.isEmpty()) {
319#if (defined QK_ON_CONTEXT_SW) || (defined Q_SPY)
338#ifdef QK_ON_CONTEXT_SW
QActive active object class (based on QP::QHsm implementation strategy)
std::uint8_t m_prio
QF priority (1..QF_MAX_ACTIVE) of this active object.
virtual void start(std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par)
Starts execution of an active object and registers the object with the framework.
QEvt const * get_(void) noexcept
Get an event from the event queue of an active object.
static void onStartup(void)
Startup QF callback.
static void init(void)
QF initialization.
static void onCleanup(void)
Cleanup QF callback.
static int_t run(void)
Transfers control to QF to run the application.
static QTimeEvt timeEvtHead_[QF_MAX_TICK_RATE]
heads of linked lists of time events, one for every clock tick rate
static void gc(QEvt const *const e) noexcept
Recycle a dynamic event.
static void bzero(void *const start, std::uint_fast16_t const len) noexcept
Clear a specified region of memory to zero.
static void add_(QActive *const a) noexcept
Register an active object to be managed by the framework.
static void stop(void)
Function invoked by the application layer to stop the QF application and return control to the OS/Ker...
static QActive * active_[QF_MAX_ACTIVE+1U]
Internal array of registered active objects.
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id)
Dispatches an event to QHsm.
virtual void init(void const *const e, std::uint_fast8_t const qs_id)
executes the top-most initial transition in QP::QHsm
static QSchedStatus schedLock(std::uint_fast8_t const ceiling) noexcept
QK selective scheduler lock.
static void schedUnlock(QSchedStatus const stat) noexcept
QK selective scheduler unlock.
static void onIdle(void)
QK idle callback (customized in BSPs for QK)
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 Q_ASSERT_ID(id_, test_)
#define Q_REQUIRE_ID(id_, test_)
int int_t
alias for line numbers in assertions and return from QF::run()
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 (extern "C" to be accessible from C)
void QK_activate_(void) noexcept
QK activator activates the next active object.
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_TIME_PRE_()
Internal macro to output time stamp to a QS record.
#define QS_FLUSH()
Flush the QS trace data to the host.
Internal (package scope) QS/C++ interface.
#define QS_U8_PRE_(data_)
Internal QS macro to output an unformatted uint8_t data element.
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
Internal QS macro to begin a predefined QS record without critical section.
#define QS_END_NOCRIT_PRE_()
Internal QS macro to end a predefiend QS record without critical section.
#define QS_2U8_PRE_(data1_, data2_)
Internal QS macro to output 2 unformatted uint8_t data elements.
void rmove(std::uint_fast8_t const n) noexcept
remove element n from the set, n = 1..64
std::uint_fast8_t findMax(void) const noexcept
find the maximum element in the set, returns zero if the set is empty