1 | #include "rca_app.h"
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Max number of task
|
---|
5 | */
|
---|
6 | #define RCA_NUM_TASK_MAX 5
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Check number of task
|
---|
10 | */
|
---|
11 | #if RCA_NUM_TASK > RCA_NUM_TASK_MAX
|
---|
12 | #error The number of Task is over!
|
---|
13 | #endif /* RCA_NUM_TASK > RCA_NUM_TASK_MAX */
|
---|
14 |
|
---|
15 | /*
|
---|
16 | * Idle task loop count per 10ms at idle state
|
---|
17 | */
|
---|
18 | #define IDLE_TASK_IDLE_LOOP_10MS 42178
|
---|
19 |
|
---|
20 | /*
|
---|
21 | * Default Macro
|
---|
22 | */
|
---|
23 |
|
---|
24 | /*
|
---|
25 | * Priotiry
|
---|
26 | */
|
---|
27 | #ifndef RCA_MAINTASK_SETUP_PRI
|
---|
28 | #define RCA_MAINTASK_SETUP_PRI 5
|
---|
29 | #endif /* RCA_MAINTASK_SETUP_PRI */
|
---|
30 |
|
---|
31 | #ifndef RCA_MAINTASK_LOOP_PRI
|
---|
32 | #define RCA_MAINTASK_LOOP_PRI 5
|
---|
33 | #endif /* RCA_MAINTASK_SETUP_PRI */
|
---|
34 |
|
---|
35 | #ifndef RCA_TASK1_SETUP_PRI
|
---|
36 | #define RCA_TASK1_SETUP_PRI 5
|
---|
37 | #endif /* RCA_TASK1_SETUP_PRI */
|
---|
38 |
|
---|
39 | #ifndef RCA_TASK1_LOOP_PRI
|
---|
40 | #define RCA_TASK1_LOOP_PRI 5
|
---|
41 | #endif /* RCA_TASK1_SETUP_PRI */
|
---|
42 |
|
---|
43 | #ifndef RCA_TASK2_SETUP_PRI
|
---|
44 | #define RCA_TASK2_SETUP_PRI 5
|
---|
45 | #endif /* RCA_TASK2_SETUP_PRI */
|
---|
46 |
|
---|
47 | #ifndef RCA_TASK2_LOOP_PRI
|
---|
48 | #define RCA_TASK2_LOOP_PRI 5
|
---|
49 | #endif /* RCA_TASK2_SETUP_PRI */
|
---|
50 |
|
---|
51 | #ifndef RCA_TASK3_SETUP_PRI
|
---|
52 | #define RCA_TASK3_SETUP_PRI 5
|
---|
53 | #endif /* RCA_TASK3_SETUP_PRI */
|
---|
54 |
|
---|
55 | #ifndef RCA_TASK3_LOOP_PRI
|
---|
56 | #define RCA_TASK3_LOOP_PRI 5
|
---|
57 | #endif /* RCA_TASK3_SETUP_PRI */
|
---|
58 |
|
---|
59 | #ifndef RCA_TASK4_SETUP_PRI
|
---|
60 | #define RCA_TASK4_SETUP_PRI 5
|
---|
61 | #endif /* RCA_TASK4_SETUP_PRI */
|
---|
62 |
|
---|
63 | #ifndef RCA_TASK4_LOOP_PRI
|
---|
64 | #define RCA_TASK4_LOOP_PRI 5
|
---|
65 | #endif /* RCA_TASK4_SETUP_PRI */
|
---|
66 |
|
---|
67 | #ifndef RCA_TASK5_SETUP_PRI
|
---|
68 | #define RCA_TASK5_SETUP_PRI 5
|
---|
69 | #endif /* RCA_TASK5_SETUP_PRI */
|
---|
70 |
|
---|
71 | #ifndef RCA_TASK5_LOOP_PRI
|
---|
72 | #define RCA_TASK5_LOOP_PRI 5
|
---|
73 | #endif /* RCA_TASK3_SETUP_PRI */
|
---|
74 |
|
---|
75 | /*
|
---|
76 | * Stack Size
|
---|
77 | */
|
---|
78 | #ifndef RCA_MAINTASK_STACK_SIZE
|
---|
79 | #define RCA_MAINTASK_STACK_SIZE 2048
|
---|
80 | #endif /* RCA_MAINTASK_STACK_SIZE */
|
---|
81 |
|
---|
82 | #ifndef RCA_TASK1_STACK_SIZE
|
---|
83 | #define RCA_TASK1_STACK_SIZE 1024
|
---|
84 | #endif /* RCA_TASK1_STACK_SIZE */
|
---|
85 |
|
---|
86 | #ifndef RCA_TASK2_STACK_SIZE
|
---|
87 | #define RCA_TASK2_STACK_SIZE 1024
|
---|
88 | #endif /* RCA_TASK2_STACK_SIZE */
|
---|
89 |
|
---|
90 | #ifndef RCA_TASK3_STACK_SIZE
|
---|
91 | #define RCA_TASK3_STACK_SIZE 1024
|
---|
92 | #endif /* RCA_TASK3_STACK_SIZE */
|
---|
93 |
|
---|
94 | #ifndef RCA_TASK4_STACK_SIZE
|
---|
95 | #define RCA_TASK4_STACK_SIZE 1024
|
---|
96 | #endif /* RCA_TASK4_STACK_SIZE */
|
---|
97 |
|
---|
98 | #ifndef RCA_TASK5_STACK_SIZE
|
---|
99 | #define RCA_TASK5_STACK_SIZE 1024
|
---|
100 | #endif /* RCA_TASK5_STACK_SIZE */
|
---|
101 |
|
---|
102 | #ifdef __cplusplus
|
---|
103 | extern "C" {
|
---|
104 | #endif
|
---|
105 |
|
---|
106 | extern void rca_init(intptr_t exinf);
|
---|
107 | extern void rca_maintask(intptr_t exinf);
|
---|
108 | extern void rca_task1(intptr_t exinf);
|
---|
109 | extern void rca_task2(intptr_t exinf);
|
---|
110 | extern void rca_task3(intptr_t exinf);
|
---|
111 | extern void rca_task4(intptr_t exinf);
|
---|
112 | extern void rca_task5(intptr_t exinf);
|
---|
113 | extern void rca_CycHandler(intptr_t exinf);
|
---|
114 |
|
---|
115 | extern void rca_USB_Handler(void);
|
---|
116 | extern void rca_SERCOM0_Handler(void);
|
---|
117 | extern void rca_SERCOM2_Handler(void);
|
---|
118 | extern void rca_SERCOM3_Handler(void);
|
---|
119 | extern void rca_SERCOM4_Handler(void);
|
---|
120 | extern void rca_SERCOM5_Handler(void);
|
---|
121 | extern void rca_EIC_Handler(void);
|
---|
122 | extern void rca_TC5_Handler(void);
|
---|
123 | extern void rca_RTC_Handler(void);
|
---|
124 |
|
---|
125 | #ifdef RCA_ENABLE_PROFILING
|
---|
126 | extern void rca_idle_task(intptr_t exinf);
|
---|
127 | extern volatile uint32_t rca_idle_result;
|
---|
128 | extern volatile uint32_t rca_isr_result;
|
---|
129 | extern volatile uint32_t rca_dispatch_result;
|
---|
130 | extern volatile uint32_t rca_timer_isr_result;
|
---|
131 | extern volatile uint32_t rca_usb_isr_result;
|
---|
132 | extern volatile uint32_t rca_sercom0_isr_result;
|
---|
133 | extern volatile uint32_t rca_sercom4_isr_result;
|
---|
134 | extern volatile uint32_t rca_sercom5_isr_result;
|
---|
135 | extern volatile uint32_t rca_eic_isr_result;
|
---|
136 | extern volatile uint32_t rca_tc5_isr_result;
|
---|
137 | extern volatile uint32_t rca_rtc_isr_result;
|
---|
138 |
|
---|
139 | #ifdef RCA_USE_SERIAL3
|
---|
140 | extern volatile uint32_t rca_sercom3_isr_result;
|
---|
141 | #endif /* RCA_USE_SERIAL3 */
|
---|
142 |
|
---|
143 | #endif /* RCA_ENABLE_PROFILING */
|
---|
144 |
|
---|
145 | #define WIRE_ENTER_CRITICAL wai_sem(WIRE_SEM);
|
---|
146 | #define WIRE_LEAVE_CRITICAL sig_sem(WIRE_SEM);
|
---|
147 |
|
---|
148 | #ifdef __cplusplus
|
---|
149 | }
|
---|
150 | #endif
|
---|