QP/C  6.3.7
qk_port.h File Reference

QK/C port example for a generic C compiler. More...

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

Go to the source code of this file.

Macros

#define QK_ON_CONTEXT_SW   1
 enable the context-switch callback More...
 
#define QK_ISR_CONTEXT_()   (get_IPSR() != (uint32_t)0)
 determination if the code executes in the ISR context More...
 
#define QK_ISR_ENTRY()
 Define the ISR entry sequence, if the compiler supports writing interrupts in C. More...
 
#define QK_ISR_EXIT()
 Define the ISR exit sequence, if the compiler supports writing interrupts in C. More...
 

Functions

uint32_t get_IPSR (void)
 

Detailed Description

QK/C port example for a generic C compiler.

Definition in file qk_port.h.

Macro Definition Documentation

◆ QK_ON_CONTEXT_SW

#define QK_ON_CONTEXT_SW   1

enable the context-switch callback

Definition at line 46 of file qk_port.h.

◆ QK_ISR_CONTEXT_

#define QK_ISR_CONTEXT_ ( )    (get_IPSR() != (uint32_t)0)

determination if the code executes in the ISR context

Definition at line 49 of file qk_port.h.

◆ QK_ISR_ENTRY

#define QK_ISR_ENTRY ( )
Value:
do { \
QF_INT_DISABLE(); \
++QK_intNest_; \
QF_QS_ISR_ENTRY(QK_intNest_, QK_currPrio_); \
QF_INT_ENABLE(); \
} while (0)

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 61 of file qk_port.h.

◆ QK_ISR_EXIT

#define QK_ISR_EXIT ( )
Value:
do { \
QF_INT_DISABLE(); \
--QK_intNest_; \
if (QK_intNest_ == (uint_fast8_t)0) { \
if (QK_sched_() != (uint_fast8_t)0) { \
QK_activate_(); \
} \
} \
QF_INT_ENABLE(); \
} while (0)
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
Definition: stdint.h:35
uint_fast8_t QK_sched_(void)
QK scheduler finds the highest-priority thread ready to run.

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 in assembly.

Definition at line 78 of file qk_port.h.

Function Documentation

◆ get_IPSR()

uint32_t get_IPSR ( void  )