QP/C++  6.5.1
qxk_port.h File Reference

QXK/C++ port example, Generic C++ compiler. More...

#include "qxk.h"
Include dependency graph for qxk_port.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define QXK_ISR_CONTEXT_()   (getSR() != static_cast<uint32_t>(0))
 determination if the code executes in the ISR context (used internally in QXK only) More...
 
#define QXK_CONTEXT_SWITCH_()   (trigSWI())
 trigger context switch (used internally in QXK only) More...
 
#define QXK_ON_CONTEXT_SW   1
 activate the context-switch callback More...
 
#define QXK_ISR_ENTRY()
 Define the ISR entry sequence, if the compiler supports writing interrupts in C++. More...
 
#define QXK_ISR_EXIT()
 Define the ISR exit sequence, if the compiler supports writing interrupts in C++. More...
 

Functions

uint32_t getSR (void)
 
void trigSWI (void)
 

Detailed Description

QXK/C++ port example, Generic C++ compiler.

Definition in file qxk_port.h.

Macro Definition Documentation

◆ QXK_ISR_CONTEXT_

#define QXK_ISR_CONTEXT_ ( )    (getSR() != static_cast<uint32_t>(0))

determination if the code executes in the ISR context (used internally in QXK only)

Definition at line 47 of file qxk_port.h.

◆ QXK_CONTEXT_SWITCH_

#define QXK_CONTEXT_SWITCH_ ( )    (trigSWI())

trigger context switch (used internally in QXK only)

Definition at line 50 of file qxk_port.h.

◆ QXK_ON_CONTEXT_SW

#define QXK_ON_CONTEXT_SW   1

activate the context-switch callback

Definition at line 54 of file qxk_port.h.

◆ QXK_ISR_ENTRY

#define QXK_ISR_ENTRY ( )
Value:
do { \
} while (false)
QXK_Attr QXK_attr_
global attributes of the QXK kernel
uint8_t volatile intNest
ISR nesting level.
Definition: qxk.h:91

Define the ISR entry sequence, if the compiler supports writing interrupts in C++.

Note
This is just an example of QK_ISR_ENTRY. You need to define the macro appropriately for the CPU/compiler you're using. Also, some QK ports will not define this macro, but instead will provide ISR skeleton code in assembly.

Definition at line 65 of file qxk_port.h.

◆ QXK_ISR_EXIT

#define QXK_ISR_EXIT ( )
Value:
do { \
if (QXK_attr_.intNest == static_cast<uint_fast8_t>(0)) { \
if (QXK_sched_() != static_cast<uint_fast8_t>(0)) { \
QXK_activate_(); \
} \
} \
else { \
Q_ERROR(); \
} \
} while (false)
QXK_Attr QXK_attr_
global attributes of the QXK kernel
uint_fast8_t QXK_sched_(void)
QXK scheduler finds the highest-priority thread ready to run.
uint8_t volatile intNest
ISR nesting level.
Definition: qxk.h:91

Define the ISR exit sequence, if the compiler supports writing interrupts in C++.

Note
This is just an example of QK_ISR_EXIT. You need to define the macro appropriately for the CPU/compiler you're using. Also, some QK ports will not define this macro, but instead will provide ISR skeleton code in assembly.

Definition at line 76 of file qxk_port.h.

Function Documentation

◆ getSR()

uint32_t getSR ( void  )

◆ trigSWI()

void trigSWI ( void  )