QV non-preemptive kernel.
More...
#include <qv.hpp>
QV non-preemptive kernel.
- See also
- Non-Preemptive Kernel
Definition at line 36 of file qv.hpp.
◆ schedDisable()
| void QP::QV::schedDisable |
( |
std::uint8_t const | ceiling | ) |
|
|
staticnoexcept |
QV selective scheduler disable
Details
This function disables the QV scheduler from scheduling threads below the specified ceiling. The main purpose of disabling the QV scheduler is to avoid scheduling threads that might take too long and overruon the next clock tick, for example.
- Parameters
-
| [in] | ceiling | preemption ceiling upto which the QV scheduler needs to be disabled |
- Note
- QV::schedDisable() must be unlocked with QV::schedEnable() at some point, but this is typically done in the system clock tick ISR.
- See also
- QV::schedEnable()
Usage
The following example shows how to disable the QV scheduler:
switch (e->sig) {
case REMINDER_SIG: {
std::uint16_t toggles = m_total - m_done;
if (toggles > m_per_rtc) {
toggles = m_per_rtc;
}
m_done += toggles;
for (; toggles > 0U; --toggles) {
BSP::d4on();
BSP::d4off();
}
static void schedDisable(std::uint8_t const ceiling) noexcept
std::uint_fast8_t QState
Type returned from state-handler functions.
#define QM_STATE_DEF(subclass_, state_)
Definition at line 56 of file qv.cpp.
◆ schedEnable()
| void QP::QV::schedEnable |
( |
| ) |
|
|
staticnoexcept |
QV scheduler enable
Details
This function re-enables the QV scheduler previously disabled with QV::schedDisable().
- Note
- QV::schedEnable() must be called (typically from the system clock tick ISR) when the application ever uses QV::schedDisable().
- See also
- QV::schedDisable()
Usage
The following example shows how to enable the QV scheduler:
void SysTick_Handler(void) {
QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler);
static void schedEnable() noexcept
Definition at line 75 of file qv.cpp.
◆ onIdle()
QV idle callback (customized in BSPs for QV)
QV::onIdle() is called by the non-preemptive QV kernel (from QF::run()) when the scheduler detects that no events are available for active objects (the idle condition). This callback gives the application an opportunity to enter a power-saving CPU mode, or perform some other idle processing (such as QS software tracing output).
- Attention
- QV::onIdle() is invoked with interrupts DISABLED because the idle condition can be asynchronously changed at any time by an interrupt. QV::onIdle() MUST enable the interrupts internally, but not before putting the CPU into the low-power mode. (Ideally, enabling interrupts and low-power mode should happen atomically). At the very least, the function MUST enable interrupts, otherwise interrupts will remain disabled permanently.
◆ readySet
Set of active-objects/threads that are ready to run in the QV kernel.
Definition at line 38 of file qv.hpp.
◆ schedCeil
| std::uint8_t QP::QV::schedCeil |
◆ priv_
The documentation for this class was generated from the following files: