AutosarOS
OCB.h
Go to the documentation of this file.
1 
17 #ifndef OCB_H_
18 #define OCB_H_
19 
20 #include <stddef.h>
21 #include <stdint.h>
22 #include <stdbool.h>
23 
24 #include "Types.h"
25 
26 #include <avr/io.h>
27 #include <util/delay.h>
28 
29 
30 
31 #define OS_CONFIG_GEN_FUNC_DECL
32 #include "AppCfg.h"
33 #undef OS_CONFIG_GEN_FUNC_DECL
34 
38 extern volatile bool isISR;
39 
43 extern volatile uint8_t isCat2ISR;
44 
48 extern volatile TaskType currentTask;
49 
53 extern volatile struct task_s* TCB_Cfg[];
54 
58 extern volatile uint32_t sysTick;
59 
65 extern volatile uint8_t needScheduling;
66 
72 extern volatile uint8_t blockScheduling;
73 
82 extern bool forceScheduling;
83 
91 extern volatile uint8_t needSysTickEval;
92 
96 extern uint8_t OS_SystemStack[];
97 
101 extern uint8_t* const OS_SystemStackPtr;
102 
106 extern volatile struct resource_s* Res_Cfg[];
107 
111 extern struct resource_s* volatile isrResourceQueue;
112 
116 extern volatile struct internalResource_s IntResourceNULL_s;
117 
121 extern volatile struct counter_s* Counter_Cfg[];
122 
126 extern volatile struct alarm_s* Alarm_Cfg[];
127 
131 extern struct scheduleTable_s* ScheduleTable_Cfg[];
132 
133 #if (defined(OS_CONFIG_HOOK_ERROR) && OS_CONFIG_HOOK_ERROR == true)
134 
140 extern volatile bool blockErrorHook;
141 #endif /* (defined(OS_CONFIG_HOOK_ERROR) && OS_CONFIG_HOOK_ERROR == true) */
142 
143 #if defined(OS_CONFIG_MAX_ERROR_PARAM) && OS_CONFIG_MAX_ERROR_PARAM >= 0
144 
150 extern volatile struct errorInfo_s errorInfo;
151 #endif /* defined(OS_CONFIG_MAX_ERROR_PARAM) && OS_CONFIG_MAX_ERROR_PARAM >= 0 */
152 
153 #if defined(OS_CONFIG_EXTENDED) && OS_CONFIG_EXTENDED == true
154 #define OS_EXTENDED true
155 #else /* defined(OS_CONFIG_EXTENDED) && OS_CONFIG_EXTENDED == true */
156 #define OS_EXTENDED false
157 #endif /* defined(OS_CONFIG_EXTENDED) && OS_CONFIG_EXTENDED == true */
158 
159 #endif /* OCB_H_ */
OS_SystemStackPtr
uint8_t *const OS_SystemStackPtr
Pointer to SystemStack base.
task_s
Data structure for task.
Definition: TaskTypes.h:83
TaskType
enum tasks_e TaskType
Type for task reference.
Definition: TaskTypes.h:29
isrResourceQueue
struct resource_s *volatile isrResourceQueue
Resource queue for resources taken by Cat2 ISRs.
Definition: OCB.c:32
blockScheduling
volatile uint8_t blockScheduling
Block scheduling.
Definition: OCB.c:27
ScheduleTable_Cfg
struct scheduleTable_s * ScheduleTable_Cfg[]
Current schedule table control blocks.
IntResourceNULL_s
volatile struct internalResource_s IntResourceNULL_s
Internal resource for tasks with no internal resource defined.
currentTask
volatile TaskType currentTask
Task currently being executed.
Definition: OCB.c:23
Res_Cfg
volatile struct resource_s * Res_Cfg[]
Current resource control blocks.
sysTick
volatile uint32_t sysTick
Current system tick.
Definition: OCB.c:25
needSysTickEval
volatile uint8_t needSysTickEval
SysTick must be evaluated during timer interrupt.
Definition: OCB.c:30
TCB_Cfg
volatile struct task_s * TCB_Cfg[]
Current task control blocks.
isCat2ISR
volatile uint8_t isCat2ISR
Priority of current Cat 2 ISR (zero if not in Cat 2 ISR)
Definition: OCB.c:21
isISR
volatile bool isISR
Is currently ISR context?
Definition: OCB.c:20
resource_s
Data structure for OS resource.
Definition: ResourceTypes.h:29
errorInfo_s
Structure used for saving error information.
Definition: ErrorTypes.h:63
Types.h
Type definitions.
counter_s
Data structure for counter.
Definition: CounterTypes.h:46
Alarm_Cfg
volatile struct alarm_s * Alarm_Cfg[]
Current alarm control blocks.
scheduleTable_s
Structure for schedule table.
Definition: ScheduleTableTypes.h:73
alarm_s
Data structure for alarm.
Definition: AlarmTypes.h:64
OS_SystemStack
uint8_t OS_SystemStack[]
Array used as SystemStack (value points to stack top)
Counter_Cfg
volatile struct counter_s * Counter_Cfg[]
Current counter control blocks.
forceScheduling
bool forceScheduling
Force the next rescheduling.
Definition: OCB.c:28
internalResource_s
Data structure for internal resource.
Definition: ResourceTypes.h:38
needScheduling
volatile uint8_t needScheduling
Scheduling needed during timer interrupt.
Definition: OCB.c:26