QP/C++  7.3.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
QP::QXK Namespace Reference

preemptive, dual-mode (non-blocking / blocking) kernel More...

Enumerations

enum  TimeoutSigs : QSignal { DELAY_SIG = 1U , TIMEOUT_SIG }
 

Functions

void onIdle ()
 
QSchedStatus schedLock (std::uint_fast8_t const ceiling) noexcept
 
void schedUnlock (QSchedStatus const stat) noexcept
 
QP::QActivecurrent () noexcept
 

Detailed Description

preemptive, dual-mode (non-blocking / blocking) kernel

Enumeration Type Documentation

◆ TimeoutSigs

Enumerator
DELAY_SIG 
TIMEOUT_SIG 

Definition at line 333 of file qxk.hpp.

Function Documentation

◆ onIdle()

QP::QXK::onIdle ( )

QXK idle callback (customized in BSPs for QXK)

QXK::onIdle() is called continuously by the QXK idle thread. This callback gives the application an opportunity to enter a power-saving CPU mode, or perform some other idle processing.

Note
QXK::onIdle() is invoked with interrupts enabled and must also return with interrupts enabled.

◆ schedLock()

QSchedStatus QP::QXK::schedLock ( std::uint_fast8_t const  ceiling)
noexcept

QXK Scheduler lock

This function locks the QXK scheduler to the specified ceiling.

Parameters
[in]ceilingpreemption ceiling to which the QXK scheduler needs to be locked
Returns
The previous QXK Scheduler lock status, which is to be used to unlock the scheduler by restoring its previous lock status in QXK_schedUnlock().
Precondition qxk:100
  • the QXK scheduler lock cannot be called from an ISR
Note
A QXK scheduler can be locked from both basic threads (AOs) and extended threads and the scheduler locks can nest.
QXK::schedLock() must be always followed by the corresponding QXK::schedUnlock().
Attention
QXK will fire an assertion if a thread holding the lock attempts to block.
See also
QXK::schedUnlock()
Usage
The following example shows how to lock and unlock the QXK scheduler:
std::uint32_t BSP::random() {
QP::QSchedStatus lockStat = QP::QXK::schedLock(N_PHILO); // <== lock
std::uint32_rnd = ...
. . . // access/manipulate the shared random seed resource
return rnd;
}
QSchedStatus schedLock(std::uint_fast8_t const ceiling) noexcept
Definition qxk.cpp:76
void schedUnlock(QSchedStatus const stat) noexcept
Definition qxk.cpp:114
std::uint_fast16_t QSchedStatus
Definition qk.hpp:50

Definition at line 76 of file qxk.cpp.

◆ schedUnlock()

void QP::QXK::schedUnlock ( QSchedStatus const  stat)
noexcept

Definition at line 114 of file qxk.cpp.

◆ current()

QP::QActive * QP::QXK::current ( )
noexcept

Definition at line 146 of file qxk.cpp.