LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
os_cfg_app.c
Go to the documentation of this file.
1 /*
2 ************************************************************************************************************************
3 * uC/OS-III
4 * The Real-Time Kernel
5 *
6 * (c) Copyright 2009-2012; Micrium, Inc.; Weston, FL
7 * All rights reserved. Protected by international copyright laws.
8 *
9 * OS CONFIGURATION (APPLICATION SPECIFICS)
10 *
11 * File : OS_CFG_APP.C
12 * By : JJL
13 * Version : V3.03.00
14 *
15 * LICENSING TERMS:
16 * ---------------
17 * uC/OS-III is provided in source form for FREE short-term evaluation, for educational use or
18 * for peaceful research. If you plan or intend to use uC/OS-III in a commercial application/
19 * product then, you need to contact Micrium to properly license uC/OS-III for its use in your
20 * application/product. We provide ALL the source code for your convenience and to help you
21 * experience uC/OS-III. The fact that the source is provided does NOT mean that you can use
22 * it commercially without paying a licensing fee.
23 *
24 * Knowledge of the source code may NOT be used to develop a similar product.
25 *
26 * Please help us continue to provide the embedded community with the finest software available.
27 * Your honesty is greatly appreciated.
28 *
29 * You can contact us at www.micrium.com, or by phone at +1 (954) 217-2036.
30 ************************************************************************************************************************
31 * Note(s) : DO NOT CHANGE THIS FILE!
32 ************************************************************************************************************************
33 */
34 
35 #define MICRIUM_SOURCE
36 #include <os_cfg_app.h>
37 #include <os.h>
38 
39 #ifdef VSC_INCLUDE_SOURCE_FILE_NAMES
40 const CPU_CHAR *os_cfg_app__c = "$Id: $";
41 #endif
42 
43 #define OS_CFG_IDLE_TASK_STK_LIMIT ((OS_CFG_IDLE_TASK_STK_SIZE * OS_CFG_TASK_STK_LIMIT_PCT_EMPTY) / 100u)
44 #define OS_CFG_INT_Q_TASK_STK_LIMIT ((OS_CFG_INT_Q_TASK_STK_SIZE * OS_CFG_TASK_STK_LIMIT_PCT_EMPTY) / 100u)
45 #define OS_CFG_STAT_TASK_STK_LIMIT ((OS_CFG_STAT_TASK_STK_SIZE * OS_CFG_TASK_STK_LIMIT_PCT_EMPTY) / 100u)
46 #define OS_CFG_TICK_TASK_STK_LIMIT ((OS_CFG_TICK_TASK_STK_SIZE * OS_CFG_TASK_STK_LIMIT_PCT_EMPTY) / 100u)
47 #define OS_CFG_TMR_TASK_STK_LIMIT ((OS_CFG_TMR_TASK_STK_SIZE * OS_CFG_TASK_STK_LIMIT_PCT_EMPTY) / 100u)
48 
49 /*
50 ************************************************************************************************************************
51 * DATA STORAGE
52 ************************************************************************************************************************
53 */
54 
56 
57 #if (OS_CFG_ISR_POST_DEFERRED_EN > 0u)
58 OS_INT_Q OSCfg_IntQ [OS_CFG_INT_Q_SIZE];
59 CPU_STK OSCfg_IntQTaskStk [OS_CFG_INT_Q_TASK_STK_SIZE];
60 #endif
61 
62 #if (OS_CFG_ISR_STK_SIZE > 0u)
64 #endif
65 
66 #if (OS_MSG_EN > 0u)
67 OS_MSG OSCfg_MsgPool [OS_CFG_MSG_POOL_SIZE];
68 #endif
69 
70 #if (OS_CFG_STAT_TASK_EN > 0u)
71 CPU_STK OSCfg_StatTaskStk [OS_CFG_STAT_TASK_STK_SIZE];
72 #endif
73 
76 
77 #if (OS_CFG_TMR_EN > 0u)
78 CPU_STK OSCfg_TmrTaskStk [OS_CFG_TMR_TASK_STK_SIZE];
79 OS_TMR_SPOKE OSCfg_TmrWheel [OS_CFG_TMR_WHEEL_SIZE];
80 #endif
81 
82 /*$PAGE*/
83 /*
84 ************************************************************************************************************************
85 * CONSTANTS
86 ************************************************************************************************************************
87 */
88 
93 
94 
95 #if (OS_CFG_ISR_POST_DEFERRED_EN > 0u)
96 OS_INT_Q * const OSCfg_IntQBasePtr = (OS_INT_Q *)&OSCfg_IntQ[0];
98 CPU_INT32U const OSCfg_IntQSizeRAM = (CPU_INT32U )sizeof(OSCfg_IntQ);
99 CPU_STK * const OSCfg_IntQTaskStkBasePtr = (CPU_STK *)&OSCfg_IntQTaskStk[0];
102 CPU_INT32U const OSCfg_IntQTaskStkSizeRAM = (CPU_INT32U )sizeof(OSCfg_IntQTaskStk);
103 #else
104 OS_INT_Q * const OSCfg_IntQBasePtr = (OS_INT_Q *)0;
105 OS_OBJ_QTY const OSCfg_IntQSize = (OS_OBJ_QTY )0;
106 CPU_INT32U const OSCfg_IntQSizeRAM = (CPU_INT32U )0;
107 CPU_STK * const OSCfg_IntQTaskStkBasePtr = (CPU_STK *)0;
108 CPU_STK_SIZE const OSCfg_IntQTaskStkLimit = (CPU_STK_SIZE)0;
109 CPU_STK_SIZE const OSCfg_IntQTaskStkSize = (CPU_STK_SIZE)0;
110 CPU_INT32U const OSCfg_IntQTaskStkSizeRAM = (CPU_INT32U )0;
111 #endif
112 
113 
114 #if (OS_CFG_ISR_STK_SIZE > 0u)
115 CPU_STK * const OSCfg_ISRStkBasePtr = (CPU_STK *)&OSCfg_ISRStk[0];
117 CPU_INT32U const OSCfg_ISRStkSizeRAM = (CPU_INT32U )sizeof(OSCfg_ISRStk);
118 #else
119 CPU_STK * const OSCfg_ISRStkBasePtr = (CPU_STK *)0;
120 CPU_STK_SIZE const OSCfg_ISRStkSize = (CPU_STK_SIZE)0;
121 CPU_INT32U const OSCfg_ISRStkSizeRAM = (CPU_INT32U )0;
122 #endif
123 
124 
125 #if (OS_MSG_EN > 0u)
127 CPU_INT32U const OSCfg_MsgPoolSizeRAM = (CPU_INT32U )sizeof(OSCfg_MsgPool);
128 OS_MSG * const OSCfg_MsgPoolBasePtr = (OS_MSG *)&OSCfg_MsgPool[0];
129 #else
130 OS_MSG_SIZE const OSCfg_MsgPoolSize = (OS_MSG_SIZE)0;
131 CPU_INT32U const OSCfg_MsgPoolSizeRAM = (CPU_INT32U )0;
132 OS_MSG * const OSCfg_MsgPoolBasePtr = (OS_MSG *)0;
133 #endif
134 
135 
136 #if (OS_CFG_STAT_TASK_EN > 0u)
139 CPU_STK * const OSCfg_StatTaskStkBasePtr = (CPU_STK *)&OSCfg_StatTaskStk[0];
142 CPU_INT32U const OSCfg_StatTaskStkSizeRAM = (CPU_INT32U )sizeof(OSCfg_StatTaskStk);
143 #else
144 OS_PRIO const OSCfg_StatTaskPrio = (OS_PRIO )0;
145 OS_RATE_HZ const OSCfg_StatTaskRate_Hz = (OS_RATE_HZ )0;
146 CPU_STK * const OSCfg_StatTaskStkBasePtr = (CPU_STK *)0;
147 CPU_STK_SIZE const OSCfg_StatTaskStkLimit = (CPU_STK_SIZE)0;
148 CPU_STK_SIZE const OSCfg_StatTaskStkSize = (CPU_STK_SIZE)0;
149 CPU_INT32U const OSCfg_StatTaskStkSizeRAM = (CPU_INT32U )0;
150 #endif
151 
152 
154 
155 
164 
165 
166 #if (OS_CFG_TMR_EN > 0u)
169 CPU_STK * const OSCfg_TmrTaskStkBasePtr = (CPU_STK *)&OSCfg_TmrTaskStk[0];
172 CPU_INT32U const OSCfg_TmrTaskStkSizeRAM = (CPU_INT32U )sizeof(OSCfg_TmrTaskStk);
174 CPU_INT32U const OSCfg_TmrWheelSizeRAM = (CPU_INT32U )sizeof(OSCfg_TmrWheel);
175 #else
176 OS_PRIO const OSCfg_TmrTaskPrio = (OS_PRIO )0;
177 OS_RATE_HZ const OSCfg_TmrTaskRate_Hz = (OS_RATE_HZ )0;
178 CPU_STK * const OSCfg_TmrTaskStkBasePtr = (CPU_STK *)0;
179 CPU_STK_SIZE const OSCfg_TmrTaskStkLimit = (CPU_STK_SIZE)0;
180 CPU_STK_SIZE const OSCfg_TmrTaskStkSize = (CPU_STK_SIZE)0;
181 CPU_INT32U const OSCfg_TmrTaskStkSizeRAM = (CPU_INT32U )0;
182 OS_OBJ_QTY const OSCfg_TmrWheelSize = (OS_OBJ_QTY )0;
183 CPU_INT32U const OSCfg_TmrWheelSizeRAM = (CPU_INT32U )0;
184 #endif
185 
186 
187 /*$PAGE*/
188 /*
189 ************************************************************************************************************************
190 * TOTAL SIZE OF APPLICATION CONFIGURATION
191 ************************************************************************************************************************
192 */
193 
195 
197  + sizeof(OSCfg_IntQ)
198  + sizeof(OSCfg_IntQTaskStk)
199 #endif
200 
201 #if (OS_MSG_EN > 0u)
202  + sizeof(OSCfg_MsgPool)
203 #endif
204 
205 #if (OS_CFG_STAT_TASK_EN > 0u)
206  + sizeof(OSCfg_StatTaskStk)
207 #endif
208 
209 #if (OS_CFG_TMR_EN > 0u)
210  + sizeof(OSCfg_TmrTaskStk)
211  + sizeof(OSCfg_TmrWheel)
212 #endif
213 
214 #if (OS_CFG_ISR_STK_SIZE > 0u)
215  + sizeof(OSCfg_ISRStk)
216 #endif
217  + sizeof(OSCfg_TickTaskStk)
218  + sizeof(OSCfg_TickWheel);
219 
220 /*$PAGE*/
221 /*
222 ************************************************************************************************************************
223 * OS CONFIGURATION INITIALIZATION
224 *
225 * Description: This function is used to make sure that debug variables that are unused in the application are not
226 * optimized away. This function might not be necessary for all compilers. In this case, you should simply
227 * DELETE the code in this function while still leaving the declaration of the function itself.
228 *
229 * Arguments : none
230 *
231 * Returns : none
232 *
233 * Note(s) : (1) This code doesn't do anything, it simply prevents the compiler from optimizing out the 'const'
234 * variables which are declared in this file.
235 * (2) You may decide to 'compile out' the code (by using #if 0/#endif) INSIDE the function if your compiler
236 * DOES NOT optimize out the 'const' variables above.
237 ************************************************************************************************************************
238 */
239 
240 void OSCfg_Init (void)
241 {
242  void const *p_temp;
243 
244 
245  p_temp = (void const *)&OSCfg_DataSizeRAM;
246 
247  p_temp = (void const *)&OSCfg_IdleTaskStkBasePtr;
248  p_temp = (void const *)&OSCfg_IdleTaskStkLimit;
249  p_temp = (void const *)&OSCfg_IdleTaskStkSize;
250  p_temp = (void const *)&OSCfg_IdleTaskStkSizeRAM;
251 
252 #if (OS_CFG_ISR_POST_DEFERRED_EN > 0u)
253  p_temp = (void const *)&OSCfg_IntQBasePtr;
254  p_temp = (void const *)&OSCfg_IntQSize;
255  p_temp = (void const *)&OSCfg_IntQSizeRAM;
256  p_temp = (void const *)&OSCfg_IntQTaskStkBasePtr;
257  p_temp = (void const *)&OSCfg_IntQTaskStkLimit;
258  p_temp = (void const *)&OSCfg_IntQTaskStkSize;
259  p_temp = (void const *)&OSCfg_IntQTaskStkSizeRAM;
260 #endif
261 
262  p_temp = (void const *)&OSCfg_ISRStkBasePtr;
263  p_temp = (void const *)&OSCfg_ISRStkSize;
264  p_temp = (void const *)&OSCfg_ISRStkSizeRAM;
265 
266 #if (OS_MSG_EN > 0u)
267  p_temp = (void const *)&OSCfg_MsgPoolSize;
268  p_temp = (void const *)&OSCfg_MsgPoolSizeRAM;
269  p_temp = (void const *)&OSCfg_MsgPoolBasePtr;
270 #endif
271 
272 #if (OS_CFG_STAT_TASK_EN > 0u)
273  p_temp = (void const *)&OSCfg_StatTaskPrio;
274  p_temp = (void const *)&OSCfg_StatTaskRate_Hz;
275  p_temp = (void const *)&OSCfg_StatTaskStkBasePtr;
276  p_temp = (void const *)&OSCfg_StatTaskStkLimit;
277  p_temp = (void const *)&OSCfg_StatTaskStkSize;
278  p_temp = (void const *)&OSCfg_StatTaskStkSizeRAM;
279 #endif
280 
281  p_temp = (void const *)&OSCfg_StkSizeMin;
282 
283  p_temp = (void const *)&OSCfg_TickRate_Hz;
284  p_temp = (void const *)&OSCfg_TickTaskPrio;
285  p_temp = (void const *)&OSCfg_TickTaskStkBasePtr;
286  p_temp = (void const *)&OSCfg_TickTaskStkLimit;
287  p_temp = (void const *)&OSCfg_TickTaskStkSize;
288  p_temp = (void const *)&OSCfg_TickTaskStkSizeRAM;
289  p_temp = (void const *)&OSCfg_TickWheelSize;
290  p_temp = (void const *)&OSCfg_TickWheelSizeRAM;
291 
292 #if (OS_CFG_TMR_EN > 0u)
293  p_temp = (void const *)&OSCfg_TmrTaskPrio;
294  p_temp = (void const *)&OSCfg_TmrTaskRate_Hz;
295  p_temp = (void const *)&OSCfg_TmrTaskStkBasePtr;
296  p_temp = (void const *)&OSCfg_TmrTaskStkLimit;
297  p_temp = (void const *)&OSCfg_TmrTaskStkSize;
298  p_temp = (void const *)&OSCfg_TmrTaskStkSizeRAM;
299  p_temp = (void const *)&OSCfg_TmrWheelSize;
300  p_temp = (void const *)&OSCfg_TmrWheelSizeRAM;
301 #endif
302  p_temp = p_temp;
303 }