QP-nano  6.9.0
Real-Time Embedded Framework
qkn.h
Go to the documentation of this file.
1
40#ifndef QKN_H
41#define QKN_H
42
43/****************************************************************************/
45typedef struct {
46 uint8_t volatile actPrio;
47 uint8_t volatile nextPrio;
48 uint8_t volatile lockPrio;
49 uint8_t volatile lockHolder;
50 uint8_t volatile intNest;
52
55
56/****************************************************************************/
58uint_fast8_t QK_sched_(void);
59
63void QK_activate_(void);
64
65#ifndef QF_ISR_NEST
66 #define QK_SCHEDULE_() do { \
67 if (QK_sched_() != 0U) { \
68 QK_activate_(); \
69 } \
70 } while(false)
71#else
73 #define QK_SCHEDULE_() \
74 if (QK_attr_.intNest == 0U) { \
75 if (QK_sched_() != 0U) { \
76 QK_activate_(); \
77 } \
78 } else ((void)0)
79
80#endif
81
82#ifdef QK_ON_CONTEXT_SW
83
104 void QK_onContextSw(uint_fast8_t prev, uint_fast8_t next);
105
106#endif /* QK_ON_CONTEXT_SW */
107
118void QK_onIdle(void);
119
120
121#ifdef QK_SCHED_LOCK
122
126 typedef uint_fast16_t QSchedStatus;
127
129 QSchedStatus QK_schedLock(uint_fast8_t ceiling);
130
132 void QK_schedUnlock(QSchedStatus stat);
133
134#endif /* QK_SCHED_LOCK */
135
136#endif /* QKN_H */
void QK_onContextSw(uint_fast8_t prev, uint_fast8_t next)
uint8_t volatile lockPrio
Definition: qkn.h:48
uint_fast16_t QSchedStatus
Definition: qkn.h:126
uint_fast8_t QK_sched_(void)
Definition: qkn.c:247
void QK_activate_(void)
Definition: qkn.c:291
void QK_onIdle(void)
QSchedStatus QK_schedLock(uint_fast8_t ceiling)
Definition: qkn.c:161
QK_PrivAttr QK_attr_
Definition: qkn.c:52
uint8_t volatile actPrio
Definition: qkn.h:46
void QK_schedUnlock(QSchedStatus stat)
Definition: qkn.c:200
uint8_t volatile intNest
Definition: qkn.h:50
uint8_t volatile nextPrio
Definition: qkn.h:47
uint8_t volatile lockHolder
Definition: qkn.h:49