qkn.h File Reference

Public QP-nano interface. More...

Go to the source code of this file.

Defines

#define QK_PREEMPTIVE   1
 Preprocessor switch for configuring preemptive real-time kernel (QK-nano). The macro is automatically defined by including the qkn.h file in qpn_port.h.
#define QK_SCHEDULE_()
 The macro to invoke the QK scheduler in the QK_ISR_EXIT().

Functions

void QK_init (void)
 QK-nano initialization.
void QK_schedule_ (void) Q_REENTRANT
 The QK scheduler.
void QK_onIdle (void)
 QK idle callback (customized in BSPs for QK).

Variables

uint8_t volatile QK_currPrio_


Detailed Description

Public QP-nano interface.

This header file must be included in all modules that use QP-nano with preemptive kernel option. Typically, this header file is included indirectly through the header file qpn.h.

Definition in file qkn.h.


Define Documentation

#define QK_PREEMPTIVE   1

Preprocessor switch for configuring preemptive real-time kernel (QK-nano). The macro is automatically defined by including the qkn.h file in qpn_port.h.

Note:
If defined, this macro eliminates the code for the non-preemptive scheduler provided in QF-nano. Instead, the fully preemptive QK-nano real-time kernel is used.

Definition at line 49 of file qkn.h.


Function Documentation

void QK_init ( void   ) 

QK-nano initialization.

This function is optional and might be used in some QK-nano ports. When the function is defined, it must called exactly once before any other QK function, typically from the BSP initialization function.

void QK_onIdle ( void   ) 

QK idle callback (customized in BSPs for QK).

QK_onIdle() is called continously by the QK-nano 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 unlocked and must also return with interrupts unlocked. This is in contrast to the callback QF_onIdle(), which is used by the non-preemptive QF-nano scheduler.

Referenced by QF_run().

void QK_schedule_ ( void   ) 

The QK scheduler.

Note:
The QK scheduler must be always called with interrupts locked. The scheduler might unlock the interrupts internally, but always returns with interrupts locked.

Definition at line 90 of file qkn.c.

References QActive::nUsed, Q_PAR, Q_PARAM_SIZE, Q_ROM, Q_ROM_BYTE, Q_ROM_PTR, Q_ROM_VAR, Q_SIG, QF_active, QF_INT_LOCK, QF_INT_UNLOCK, QF_readySet_, QFsm_dispatch(), QHsm_dispatch(), and QActive::tail.

Referenced by QActive_post().


Variable Documentation

uint8_t volatile QK_currPrio_

current QK priority

Definition at line 44 of file qkn.c.


Generated on Sat Dec 27 22:01:47 2008 for QP-nano by  doxygen 1.5.4