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