QK preemptive non-blocking kernel (QK namespace emulated as a "class" in C.
More...
#include <qk.h>
|
| uint_fast8_t | QK_sched_ (void) |
| | QK scheduler finds the highest-priority AO ready to run.
|
| uint_fast8_t | QK_sched_act_ (QActive const *const act, uint_fast8_t const pthre_in) |
| | QK internal helper function to determine whether activation is needed.
|
| void | QK_activate_ (void) |
| | QK activator activates the next active object. The activated AO preempts the currently executing AOs.
|
QK preemptive non-blocking kernel (QK namespace emulated as a "class" in C.
- See also
- Preemptive Non-Blocking Kernel
Definition at line 38 of file qk.h.
◆ QK_sched_()
| uint_fast8_t QK_sched_ |
( |
void | | ) |
|
|
staticprivate |
QK scheduler finds the highest-priority AO ready to run.
Details
The QK scheduler finds out the priority of the highest-priority AO that (1) has events to process and (2) has priority that is above the current priority.
- Returns
- The QF-priority of the next active object to activate, or zero if no activation of AO is needed.
- Attention
- QK_sched_() must be always called with interrupts disabled and returns with interrupts disabled.
Definition at line 113 of file qk.c.
◆ QK_sched_act_()
| uint_fast8_t QK_sched_act_ |
( |
QActive const *const | act, |
|
|
uint_fast8_t const | pthre_in ) |
|
staticprivate |
QK internal helper function to determine whether activation is needed.
Details
- Parameters
-
| [in] | act | currently executing Active Object |
| [in] | pthre_in | current priority threshold |
- Returns
- the priority of Active Object to activate or 0 if no activation needed
- Attention
- QK_act_() must be always called with interrupts disabled and returns with interrupts disabled.
Definition at line 141 of file qk.c.
◆ QK_activate_()
| void QK_activate_ |
( |
void | | ) |
|
|
staticprivate |
QK activator activates the next active object. The activated AO preempts the currently executing AOs.
Details
QK_activate_() activates ready-to run AOs that are above the initial preemption-threshold.
- Attention
- QK_activate_() must be always called with interrupts disabled and returns with interrupts disabled.
Definition at line 177 of file qk.c.
◆ QK_schedLock()
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().
- 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:
uint32_t BSP_random(void) {
uint32_rnd;
. . .
return rnd;
}
uint_fast8_t QSchedStatus
The scheduler lock status for QK_schedLock() and QK_schedUnlock().
QSchedStatus QK_schedLock(uint8_t const ceiling)
QK selective scheduler lock.
void QK_schedUnlock(QSchedStatus const prevCeil)
QK selective scheduler unlock.
Definition at line 52 of file qk.c.
◆ QK_schedUnlock()
QK selective scheduler unlock.
Details
This function unlocks the QK scheduler to the previous status.
- Parameters
-
- 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:
uint32_t BSP_random(void) {
uint32_rnd;
. . .
return rnd;
}
Definition at line 80 of file qk.c.
◆ QK_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.
◆ readySet
Definition at line 39 of file qk.h.
◆ actPrio
Definition at line 40 of file qk.h.
◆ nextPrio
Definition at line 41 of file qk.h.
◆ actThre
Definition at line 42 of file qk.h.
◆ lockCeil
Definition at line 43 of file qk.h.
◆ intNest
Definition at line 44 of file qk.h.
◆ QK_priv_
Definition at line 68 of file qk.h.
The documentation for this class was generated from the following files: