QP/C 6.9.0
qxk_port.h File Reference

QXK/C port example for a 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() != 0U)
 determination if the code executes in the ISR context (used internally in QXK only) More...
 
#define QXK_ON_CONTEXT_SW   1
 activate the context-switch callback More...
 
#define QXK_CONTEXT_SWITCH_()   (trigSWI())
 trigger context switch (used internally in QXK only) 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 for a generic C compiler.

Definition in file qxk_port.h.

Macro Definition Documentation

◆ QXK_ISR_CONTEXT_

#define QXK_ISR_CONTEXT_ ( )    (getSR() != 0U)

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

determination if the code executes in the ISR context

Note
This is just an example of QXK_ISR_CONTEXT_ (for ARM Cortex-M). 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 might test the interrupt nesting up-down counter (QXK_intNest_).

Definition at line 56 of file qxk_port.h.

◆ QXK_ON_CONTEXT_SW

#define QXK_ON_CONTEXT_SW   1

activate the context-switch callback

Definition at line 59 of file qxk_port.h.

◆ QXK_CONTEXT_SWITCH_

#define QXK_CONTEXT_SWITCH_ ( )    (trigSWI())

trigger context switch (used internally in QXK only)

Definition at line 62 of file qxk_port.h.

◆ QXK_ISR_ENTRY

#define QXK_ISR_ENTRY ( )
Value:
do { \
QF_INT_DISABLE(); \
++QXK_intNest_; \
QF_QS_ISR_ENTRY(QXK_intNest_, QXK_currPrio_); \
QF_INT_ENABLE(); \
} while (false)

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

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

Definition at line 74 of file qxk_port.h.

◆ QXK_ISR_EXIT

#define QXK_ISR_EXIT ( )
Value:
do { \
QF_INT_DISABLE(); \
--QXK_intNest_; \
if (QXK_intNest_ == 0U) { \
QXK_sched_(); \
} \
QF_INT_ENABLE(); \
} while (false)

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

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

Definition at line 90 of file qxk_port.h.

Function Documentation

◆ getSR()

uint32_t getSR ( void  )

◆ trigSWI()

void trigSWI ( void  )