-
Notifications
You must be signed in to change notification settings - Fork 0
/
OsConfig.h
276 lines (218 loc) · 5.89 KB
/
OsConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
/**
*******************************************************************************
* @file OsConfig.h
* @version V1.1.4
* @date 2011.04.20
* @brief This file use by user to configuration CooCox CoOS.
* @note Ensure you have knew every item before modify this file.
*******************************************************************************
* @copy
*
* INTERNAL FILE,DON'T PUBLIC.
*
* <h2><center>© COPYRIGHT 2009 CooCox </center></h2>
*******************************************************************************
*/
#ifndef _CONFIG_H
#define _CONFIG_H
/*!<
Defines chip type,cortex-m3(1),cortex-m0(2)
*/
#define CFG_CHIP_TYPE (1)
/*!<
Defines the lowest priority that be assigned.
*/
#define CFG_LOWEST_PRIO (64)
/*!<
Max number of tasks that can be running.
*/
#define CFG_MAX_USER_TASKS (12)
/*!<
Idle task stack size(word).
*/
#define CFG_IDLE_STACK_SIZE (64)
/*!<
System frequency (Hz).
*/
#define CFG_CPU_FREQ (168000000)
/*!<
systick frequency (Hz).
*/
#define CFG_SYSTICK_FREQ (1000)
/*!<
max systerm api call num in ISR.
*/
#define CFG_MAX_SERVICE_REQUEST (5)
/*!<
Enable(1) or disable(0) order list schedule.
If disable(0),CoOS use Binary-Scheduling Algorithm.
*/
#if (CFG_MAX_USER_TASKS) <15
#define CFG_ORDER_LIST_SCHEDULE_EN (1)
#else
#define CFG_ORDER_LIST_SCHEDULE_EN (0)
#endif
/*!<
Enable(1) or disable(0) Round-Robin Task switching.
*/
#define CFG_ROBIN_EN (0)
/*!<
Default slice of task.
*/
#if CFG_ROBIN_EN > 0
#define CFG_TIME_SLICE (10)
#endif
/*----------------------- Schedule model Config -----------------------------*/
/*!<
Enable(1) or disable(0) all waiting function.
Include sem,mailbox,queue,flag,mutex,delay modules.
If CFG_TASK_WAITTING_EN=0,all these modules are disable.
*/
#define CFG_TASK_WAITTING_EN (1)
/*!<
Dynamic task scheduling(1) or Static Task Scheduling(0) model.
If in Static Task Scheduling model(0),cannot creat task and change task priority
after coocox os start running. In Dynamic Task Scheduling model(1), all these can.
When task terminated, if in Static Task Scheduling model(0),
CoOS do not recovered task resources, and you can activate it again.
But in Dynamic Task Scheduling model(1),task resources will be recovered.
If in Static Task Scheduling model(0),mutex module can not be used, as this model don't
support to change task priority while CoOS running.
*/
#define CFG_TASK_SCHEDULE_EN (1)
/*---------------------- Task Management Config -----------------------------*/
/*!<
Enable(1) or disable(0) CoSetPriority() API.
*/
#if CFG_TASK_SCHEDULE_EN >0
#define CFG_PRIORITY_SET_EN (1)
#endif
/*!<
Enable(1) or disable(0) CoAwakeTask() and CoSuspendTask() API.
*/
#define CFG_TASK_SUSPEND_EN (0)
/*---------------------- Debug Management Config ----------------------------*/
/*!<
Enable(1) or disable(0) parameter checkout .
*/
#define CFG_PAR_CHECKOUT_EN (0)
/*!<
Enable(1) or disable(0) stack overflow checkout .
*/
#define CFG_STK_CHECKOUT_EN (0)
/*---------------------- Memory Management Config ----------------------------*/
/*!<
Enable(1) or disable(0) memory management.
*/
#define CFG_MM_EN (0)
/*!<
Max number of memory.(must be less than 32).
*/
#if CFG_MM_EN >0
#define CFG_MAX_MM (2)
#endif
/*-------------------- Kernel heap Management Config -------------------------*/
/*!<
Enable(1) or disable(0) kernel heap management.
*/
#define CFG_KHEAP_EN (1)
/*!<
Kernel heap size(word).
*/
#if CFG_KHEAP_EN >0
#define KHEAP_SIZE (50)
#endif
/*---------------------- Time Management Config -----------------------------*/
/*!<
Enable(1) or disable(0) TimeDelay() API.
*/
#if CFG_TASK_WAITTING_EN >0
#define CFG_TIME_DELAY_EN (0)
#endif
/*---------------------- Timer Management Config ----------------------------*/
/*!<
Enable(1) or disable(0) timer management.
*/
#define CFG_TMR_EN (0)
/*!<
Specify max number timer.(must be less than 32)
*/
#if CFG_TMR_EN >0
#define CFG_MAX_TMR (2)
#endif
/*---------------------- Event Management Config ----------------------------*/
/*!<
Enable(1) or disable(0) events management,
events including semaphore,mailbox,queue.
*/
#if CFG_TASK_WAITTING_EN > 0
#define CFG_EVENT_EN (1)
#endif
#if CFG_EVENT_EN > 0
/*!<
Event sort type.(1)FIFO (2)PRI (3)FIFO+PRI
*/
#define CFG_EVENT_SORT (3)
/*!<
Max number of event.(must be less than 255)
Event = semaphore + mailbox + queue;
*/
#define CFG_MAX_EVENT (20)
/*!<
Enable(1) or disable(0) semaphore management.
*/
#define CFG_SEM_EN (0)
/*!<
Enable(1) or disable(0) mailbox management.
*/
#define CFG_MAILBOX_EN (0)
/*!<
Enable(1) or disable(0) queue management.
*/
#define CFG_QUEUE_EN (1)
/*!<
Max number of queue.(less than CFG_MAX_EVENT).
*/
#if CFG_QUEUE_EN >0
#define CFG_MAX_QUEUE (2)
#endif // CFG_QUEUE_EN
#endif // CFG_EVENT_EN
/*----------------------- Flag Management Config ----------------------------*/
/*!<
Enable(1) or disable(0) flag management.
Max number of flag is 32.
*/
#if CFG_TASK_WAITTING_EN > 0
#define CFG_FLAG_EN (1)
#endif
/*---------------------- Mutex Management Config ----------------------------*/
/*!<
Enable(1) or disable(0) mutex management.
*/
#if CFG_TASK_WAITTING_EN > 0
#if CFG_TASK_SCHEDULE_EN > 0
#define CFG_MUTEX_EN (1)
#endif
#endif
/*!<
Max number of mutex.(must be less than 255).
*/
#if CFG_MUTEX_EN >0
#define CFG_MAX_MUTEX (10)
#endif
/*---------------------- Utility Management Config --------------------------*/
/*!<
Enable(1) or disable(0) utility management.
*/
#define CFG_UTILITY_EN (0)
#if CFG_UTILITY_EN >0
/*!<
Enable(1) or disable(0) TickToTime() utility
*/
#define CFG_TICK_TO_TIME_EN (0)
/*!<
Enable(1) or disable(0) TimeToTick() utility
*/
#define CFG_TIME_TO_TICK_EN (0)
#endif
#endif // _CONFIG_H