preemptive, non-blocking kernel
More...
preemptive, non-blocking kernel
- Details
- The QK namespace contains only QK facilities callable from C++. The following other QK facilities are defined in the global namespace to be callable from assembly (as
extern "C"
):
◆ schedLock()
QSchedStatus QP::QK::schedLock |
( |
std::uint_fast8_t const | ceiling | ) |
|
|
noexcept |
QK selective scheduler lock
- Details
- This function locks the QK scheduler to the specified ceiling.
- Parameters
-
[in] | ceiling | preemption ceiling to which the QK scheduler needs to be locked |
- Returns
- The previous QK Scheduler lock status, which is to be used to unlock the scheduler by restoring its previous lock status in QK::schedUnlock().
- Precondition
qk:100
- The QK scheduler lock cannot be called from an ISR
- Note
- QK::schedLock() must be always followed by the corresponding QK::schedUnlock().
- See also
- QK::schedUnlock()
- Usage
- The following example shows how to lock and unlock the QK scheduler:
std::uint32_t BSP::random() {
std::uint32_rnd;
. . .
return rnd;
}
QSchedStatus schedLock(std::uint_fast8_t const ceiling) noexcept
void schedUnlock(QSchedStatus const prevCeil) noexcept
std::uint_fast8_t QSchedStatus
Definition at line 67 of file qk.cpp.
◆ schedUnlock()
QK selective scheduler unlock
- Details
- This function unlocks the QK scheduler to the previous status.
- Parameters
-
- Precondition
qk:200
- the QK scheduler cannot be unlocked: from the ISR context
- the current lock ceiling must be greater than the previous
- Note
- QK::schedUnlock() must always follow the corresponding QK::schedLock().
- See also
- QK::schedLock()
- Usage
- The following example shows how to lock and unlock the QK scheduler:
std::uint32_t BSP::random() {
std::uint32_rnd;
. . .
return rnd;
}
Definition at line 106 of file qk.cpp.
◆ onIdle()
QK idle callback (customized in BSPs for QK)
- Details
- QK::onIdle() is called continuously by the QK idle loop. This callback gives the application an opportunity to enter a power-saving CPU mode, or perform some other idle processing.
- Note
- QK::onIdle() is invoked with interrupts enabled and must also return with interrupts enabled.