QP/C  6.0.0
qv.h File Reference

QV/C (cooperative "Vanilla" kernel) platform-independent public interface. More...

#include "qequeue.h"
#include "qmpool.h"
#include "qpset.h"

Go to the source code of this file.

Macros

#define QF_EQUEUE_TYPE   QEQueue
 This macro defines the type of the event queue used for the active objects. More...
 
#define QV_getVersion()   (QP_versionStr)
 get the current QV version number string of the form "X.Y.Z"
 
#define QF_SCHED_STAT_
 
#define QF_SCHED_LOCK_(dummy)   ((void)0)
 
#define QF_SCHED_UNLOCK_(dummy)   ((void)0)
 
#define QACTIVE_EQUEUE_WAIT_(me_)   Q_ASSERT_ID(0, (me_)->eQueue.frontEvt != (QEvt *)0)
 
#define QACTIVE_EQUEUE_SIGNAL_(me_)   QPSet_insert(&QV_readySet_, (me_)->prio)
 
#define QF_EPOOL_TYPE_   QMPool
 
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_)   (QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_)))
 
#define QF_EPOOL_EVENT_SIZE_(p_)   ((uint_fast16_t)(p_).blockSize)
 
#define QF_EPOOL_GET_(p_, e_, m_)   ((e_) = (QEvt *)QMPool_get(&(p_), (m_)))
 
#define QF_EPOOL_PUT_(p_, e_)   (QMPool_put(&(p_), (e_)))
 

Functions

void QV_onIdle (void)
 QV idle callback (customized in BSPs) More...
 

Variables

QPSet QV_readySet_
 QV ready-set of AOs.
 

Detailed Description

QV/C (cooperative "Vanilla" kernel) platform-independent public interface.

Definition in file qv.h.

Macro Definition Documentation

◆ QF_EQUEUE_TYPE

#define QF_EQUEUE_TYPE   QEQueue

This macro defines the type of the event queue used for the active objects.

For the built-in QV kernel, this is ::QEqueue.

Definition at line 51 of file qv.h.

Function Documentation

◆ QV_onIdle()

void QV_onIdle ( void  )

QV idle callback (customized in BSPs)

Description
QV_onIdle() is called by the cooperative 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).
Note
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.
QV_onIdle() is only used by the cooperative QV kenrnel in the native (bare metal) QF ports, and is NOT used in any other QF ports. When QF is combined with the preemptive QK, the QK idle loop calls a different function QK_onIdle(), with different semantics than QV_onIdle(). When QF is combined with a 3rd-party RTOS or kernel, the idle processing mechanism of the RTOS or kernel is used instead of QV_onIdle().