CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OsConfig.h Source File

OsConfig.h

00001 /**
00002  *******************************************************************************
00003  * @file       config.h
00004  * @version    V1.1.4
00005  * @date       2011.04.20
00006  * @brief      This file use by user to configuration CooCox CoOS.
00007  * @note       Ensure you have knew every item before modify this file. 
00008  *******************************************************************************
00009  * @copy
00010  *
00011  * INTERNAL FILE,DON'T PUBLIC.
00012  * 
00013  * <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2>
00014  *******************************************************************************
00015  */ 
00016 
00017 
00018 #ifndef  _CONFIG_H
00019 #define  _CONFIG_H
00020 
00021 
00022 /*!< 
00023 Defines chip type,cortex-m3(1),cortex-m0(2)      
00024 */
00025 #define CFG_CHIP_TYPE           (1)
00026 
00027 /*!< 
00028 Defines the lowest priority that be assigned.       
00029 */
00030 #define CFG_LOWEST_PRIO         (64)
00031 
00032 /*!< 
00033 Max number of tasks that can be running.             
00034 */            
00035 #define CFG_MAX_USER_TASKS      (5)     
00036 
00037 /*!< 
00038 Idle task stack size(word).                                 
00039 */    
00040 #define CFG_IDLE_STACK_SIZE     (25)    
00041 
00042 /*!< 
00043 System frequency (Hz).                                  
00044 */    
00045 #define CFG_CPU_FREQ            (96000000)  
00046 
00047 /*!< 
00048 systick frequency (Hz).                             
00049 */
00050 #define CFG_SYSTICK_FREQ        (1000)
00051 
00052 /*!< 
00053 max systerm api call num in ISR.                             
00054 */
00055 #define CFG_MAX_SERVICE_REQUEST (3) 
00056 
00057 /*!< 
00058 Enable(1) or disable(0) order list schedule.
00059 If disable(0),CoOS use Binary-Scheduling Algorithm. 
00060 */
00061 #if (CFG_MAX_USER_TASKS) <15
00062 #define CFG_ORDER_LIST_SCHEDULE_EN  (1)
00063 #else 
00064 #define CFG_ORDER_LIST_SCHEDULE_EN  (0)
00065 #endif    
00066 
00067 
00068 /*!< 
00069 Enable(1) or disable(0) Round-Robin Task switching. 
00070 */
00071 #define CFG_ROBIN_EN            (0)         
00072 
00073 /*!< 
00074 Default slice of task.                                 
00075 */
00076 #if    CFG_ROBIN_EN > 0
00077 #define CFG_TIME_SLICE          (10)              
00078 #endif
00079 
00080 
00081 /*----------------------- Schedule model Config -----------------------------*/
00082 /*!< 
00083 Enable(1) or disable(0) all waiting function.
00084 Include sem,mailbox,queue,flag,mutex,delay modules.    
00085 If CFG_TASK_WAITTING_EN=0,all these modules are disable.          
00086 */
00087 #define CFG_TASK_WAITTING_EN     (1)
00088 
00089 /*!< 
00090 Dynamic task scheduling(1) or Static Task Scheduling(0) model.
00091 If in Static Task Scheduling model(0),cannot creat task and change task priority
00092 after coocox os start running. In Dynamic Task Scheduling model(1), all these can.
00093 When task terminated, if in Static Task Scheduling model(0), 
00094 CoOS do not recovered task resources, and you can activate it again.
00095 But in Dynamic Task Scheduling model(1),task resources will be recovered.
00096 If in Static Task Scheduling model(0),mutex module can not be used, as this model don't
00097 support to change task priority while CoOS running. 
00098 */
00099 #define CFG_TASK_SCHEDULE_EN     (1)
00100 
00101 
00102 /*---------------------- Task Management Config -----------------------------*/
00103 /*!< 
00104 Enable(1) or disable(0) CoSetPriority() API.              
00105 */
00106 #if CFG_TASK_SCHEDULE_EN >0
00107 #define CFG_PRIORITY_SET_EN       (0)    
00108 #endif
00109 
00110 /*!< 
00111 Enable(1) or disable(0) CoAwakeTask() and CoSuspendTask() API.              
00112 */
00113 #define CFG_TASK_SUSPEND_EN       (0)
00114 
00115 
00116 /*---------------------- Debug Management Config ----------------------------*/
00117 /*!< 
00118 Enable(1) or disable(0) parameter checkout .          
00119 */
00120 #define CFG_PAR_CHECKOUT_EN     (0)    
00121 
00122 /*!< 
00123 Enable(1) or disable(0) stack overflow checkout .        
00124 */        
00125 #define CFG_STK_CHECKOUT_EN     (0)        
00126 
00127 
00128 
00129 /*---------------------- Memory Management Config ----------------------------*/
00130 /*!< 
00131 Enable(1) or disable(0) memory management.          
00132 */
00133 #define CFG_MM_EN               (0)   
00134 
00135 /*!< 
00136 Max number of memory.(must be less than 32).      
00137 */ 
00138 #if CFG_MM_EN >0
00139 #define CFG_MAX_MM              (2)            
00140 #endif 
00141 
00142 
00143 
00144 /*-------------------- Kernel heap Management Config -------------------------*/
00145 /*!< 
00146 Enable(1) or disable(0) kernel heap management.          
00147 */
00148 #define CFG_KHEAP_EN            (0)          
00149 
00150 /*!< 
00151 Kernel heap size(word).      
00152 */ 
00153 #if CFG_KHEAP_EN >0
00154 #define KHEAP_SIZE              (50)            
00155 #endif   
00156 
00157 
00158         
00159 /*---------------------- Time Management Config -----------------------------*/
00160 /*!< 
00161 Enable(1) or disable(0) TimeDelay() API.              
00162 */
00163 #if CFG_TASK_WAITTING_EN >0
00164 #define CFG_TIME_DELAY_EN       (1)    
00165 #endif
00166 
00167 
00168 /*---------------------- Timer Management Config ----------------------------*/
00169 /*!< 
00170 Enable(1) or disable(0) timer management.              
00171 */
00172 #define CFG_TMR_EN              (0)        
00173 
00174 /*!< 
00175 Specify max number timer.(must be less than 32)      
00176 */    
00177 #if CFG_TMR_EN >0
00178 #define CFG_MAX_TMR             (2)            
00179 #endif
00180 
00181 
00182 /*---------------------- Event Management Config ----------------------------*/
00183 /*!< 
00184 Enable(1) or disable(0) events management,             
00185 events including semaphore,mailbox,queue.             
00186 */
00187 #if CFG_TASK_WAITTING_EN > 0
00188 #define  CFG_EVENT_EN           (1) 
00189 #endif
00190            
00191 #if CFG_EVENT_EN > 0
00192 /*!< 
00193 Event sort type.(1)FIFO (2)PRI (3)FIFO+PRI           
00194 */
00195 #define CFG_EVENT_SORT          (3)        
00196 
00197 /*!< 
00198 Max number of event.(must be less than 255)           
00199 Event = semaphore + mailbox + queue;                  
00200 */
00201 #define CFG_MAX_EVENT           (5)    
00202 
00203 /*!< 
00204 Enable(1) or disable(0) semaphore management.          
00205 */
00206 #define CFG_SEM_EN              (1)    
00207 
00208 /*!< 
00209 Enable(1) or disable(0) mailbox management.          
00210 */        
00211 #define CFG_MAILBOX_EN          (1)
00212 
00213 /*!< 
00214 Enable(1) or disable(0) queue management.              
00215 */        
00216 #define CFG_QUEUE_EN            (0)    
00217 
00218 /*!< 
00219 Max number of queue.(less than CFG_MAX_EVENT).       
00220 */
00221 #if    CFG_QUEUE_EN >0    
00222 #define CFG_MAX_QUEUE           (2)        
00223 #endif   // CFG_QUEUE_EN
00224     
00225 #endif   // CFG_EVENT_EN
00226     
00227 
00228 
00229 /*----------------------- Flag Management Config ----------------------------*/
00230 /*!< 
00231 Enable(1) or disable(0) flag management.             
00232 Max number of flag is 32.                              
00233 */
00234 #if CFG_TASK_WAITTING_EN > 0
00235 #define  CFG_FLAG_EN           (1)
00236 #endif        
00237 
00238 
00239 /*---------------------- Mutex Management Config ----------------------------*/
00240 /*!< 
00241 Enable(1) or disable(0) mutex management.          
00242 */
00243 #if CFG_TASK_WAITTING_EN > 0
00244 #if CFG_TASK_SCHEDULE_EN > 0
00245 #define  CFG_MUTEX_EN           (1)
00246 #endif
00247 #endif
00248 
00249  
00250 /*!< 
00251 Max number of mutex.(must be less than 255).      
00252 */ 
00253 #if CFG_MUTEX_EN >0
00254 #define CFG_MAX_MUTEX           (10)            
00255 #endif
00256 
00257 /*---------------------- Utility Management Config --------------------------*/
00258 /*!< 
00259 Enable(1) or disable(0) utility management.          
00260 */
00261 #define CFG_UTILITY_EN          (0)      
00262    
00263 #if CFG_UTILITY_EN >0
00264 
00265 /*!< 
00266 Enable(1) or disable(0) TickToTime() utility    
00267 */
00268 #define    CFG_TICK_TO_TIME_EN     (1)        
00269 /*!< 
00270 Enable(1) or disable(0) TimeToTick() utility    
00271 */    
00272 #define    CFG_TIME_TO_TICK_EN     (1)        
00273 #endif
00274 
00275 
00276 #endif     // _CONFIG_H