]> git.sur5r.net Git - freertos/blob - Source/include/FreeRTOS.h
Modified uxTaskGetStackHighWaterMark() to take a parameter for the task to be checked...
[freertos] / Source / include / FreeRTOS.h
1 /*\r
2         FreeRTOS.org V4.7.2 - Copyright (C) 2003-2008 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http://www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26         ***************************************************************************\r
27 \r
28         Please ensure to read the configuration and relevant port sections of the\r
29         online documentation.\r
30 \r
31         +++ http://www.FreeRTOS.org +++\r
32         Documentation, latest information, license and contact details.\r
33 \r
34         +++ http://www.SafeRTOS.com +++\r
35         A version that is certified for use in safety critical systems.\r
36 \r
37         +++ http://www.OpenRTOS.com +++\r
38         Commercial support, development, porting, licensing and training services.\r
39 \r
40         ***************************************************************************\r
41 */\r
42 \r
43 #ifndef INC_FREERTOS_H\r
44 #define INC_FREERTOS_H\r
45 \r
46 \r
47 /*\r
48  * Include the generic headers required for the FreeRTOS port being used.\r
49  */\r
50 #include <stddef.h>\r
51 \r
52 /* Basic FreeRTOS definitions. */\r
53 #include "projdefs.h"\r
54 \r
55 /* Application specific configuration options. */\r
56 #include "FreeRTOSConfig.h"\r
57 \r
58 /* Definitions specific to the port being used. */\r
59 #include "portable.h"\r
60 \r
61 \r
62 \r
63 \r
64 \r
65 \r
66 \r
67 /*\r
68  * Check all the required application specific macros have been defined.\r
69  * These macros are application specific and (as downloaded) are defined\r
70  * within FreeRTOSConfig.h.\r
71  */\r
72 \r
73 #ifndef configUSE_PREEMPTION\r
74         #error Missing definition:  configUSE_PREEMPTION should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
75 #endif\r
76 \r
77 #ifndef configUSE_IDLE_HOOK\r
78         #error Missing definition:  configUSE_IDLE_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
79 #endif\r
80 \r
81 #ifndef configUSE_TICK_HOOK\r
82         #error Missing definition:  configUSE_TICK_HOOK should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
83 #endif\r
84 \r
85 #ifndef configUSE_CO_ROUTINES\r
86         #error  Missing definition:  configUSE_CO_ROUTINES should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
87 #endif\r
88 \r
89 #ifndef INCLUDE_vTaskPrioritySet\r
90         #error Missing definition:  INCLUDE_vTaskPrioritySet should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
91 #endif\r
92 \r
93 #ifndef INCLUDE_uxTaskPriorityGet\r
94         #error Missing definition:  INCLUDE_uxTaskPriorityGet should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
95 #endif\r
96 \r
97 #ifndef INCLUDE_vTaskDelete             \r
98         #error Missing definition:  INCLUDE_vTaskDelete          should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
99 #endif\r
100 \r
101 #ifndef INCLUDE_vTaskCleanUpResources\r
102         #error Missing definition:  INCLUDE_vTaskCleanUpResources should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
103 #endif\r
104 \r
105 #ifndef INCLUDE_vTaskSuspend    \r
106         #error Missing definition:  INCLUDE_vTaskSuspend         should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
107 #endif\r
108 \r
109 #ifndef INCLUDE_vTaskDelayUntil\r
110         #error Missing definition:  INCLUDE_vTaskDelayUntil should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
111 #endif\r
112 \r
113 #ifndef INCLUDE_vTaskDelay\r
114         #error Missing definition:  INCLUDE_vTaskDelay should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
115 #endif\r
116 \r
117 #ifndef configUSE_16_BIT_TICKS\r
118         #error Missing definition:  configUSE_16_BIT_TICKS should be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
119 #endif\r
120 \r
121 #ifndef INCLUDE_uxTaskGetStackHighWaterMark\r
122         #define INCLUDE_uxTaskGetStackHighWaterMark 0\r
123 #endif\r
124 \r
125 #ifndef configUSE_RECURSIVE_MUTEXES\r
126         #define configUSE_RECURSIVE_MUTEXES 0\r
127 #endif\r
128 \r
129 #ifndef configUSE_MUTEXES\r
130         #define configUSE_MUTEXES 0\r
131 #endif\r
132 \r
133 #ifndef configUSE_COUNTING_SEMAPHORES\r
134         #define configUSE_COUNTING_SEMAPHORES 0\r
135 #endif\r
136 \r
137 #ifndef configUSE_ALTERNATIVE_API\r
138         #define configUSE_ALTERNATIVE_API 0\r
139 #endif\r
140 \r
141 #ifndef portCRITICAL_NESTING_IN_TCB\r
142         #define portCRITICAL_NESTING_IN_TCB 0\r
143 #endif\r
144 \r
145 #if ( configUSE_MUTEXES == 1 )\r
146         /* xTaskGetCurrentTaskHandle is used by the priority inheritance mechanism\r
147         within the mutex implementation so must be available if mutexes are used. */\r
148         #undef INCLUDE_xTaskGetCurrentTaskHandle\r
149         #define INCLUDE_xTaskGetCurrentTaskHandle 1\r
150 #else\r
151         #ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
152                 #define INCLUDE_xTaskGetCurrentTaskHandle 0\r
153         #endif\r
154 #endif\r
155 \r
156 \r
157 /* Remove any unused trace macros. */\r
158 #ifndef traceSTART\r
159         /* Used to perform any necessary initialisation - for example, open a file\r
160         into which trace is to be written. */\r
161         #define traceSTART()\r
162 #endif\r
163 \r
164 #ifndef traceEND\r
165         /* Use to close a trace, for example close a file into which trace has been\r
166         written. */\r
167         #define traceEND()\r
168 #endif\r
169 \r
170 #ifndef traceTASK_SWITCHED_IN\r
171         /* Called after a task has been selected to run.  pxCurrentTCB holds a pointer\r
172         to the task control block of the selected task. */\r
173         #define traceTASK_SWITCHED_IN()\r
174 #endif\r
175 \r
176 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE\r
177         /* Task is about to block because it cannot read from a \r
178         queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
179         upon which the read was attempted.  pxCurrentTCB points to the TCB of the \r
180         task that attempted the read. */\r
181         #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )\r
182 #endif\r
183 \r
184 #ifndef traceBLOCKING_ON_QUEUE_SEND\r
185         /* Task is about to block because it cannot write to a \r
186         queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
187         upon which the write was attempted.  pxCurrentTCB points to the TCB of the \r
188         task that attempted the write. */\r
189         #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )\r
190 #endif\r
191 \r
192 #ifndef configCHECK_FOR_STACK_OVERFLOW\r
193         #define configCHECK_FOR_STACK_OVERFLOW 0\r
194 #endif\r
195 \r
196 /* The following event macros are embedded in the kernel API calls. */\r
197 \r
198 #ifndef traceQUEUE_CREATE       \r
199         #define traceQUEUE_CREATE( pxNewQueue )\r
200 #endif\r
201 \r
202 #ifndef traceQUEUE_CREATE_FAILED\r
203         #define traceQUEUE_CREATE_FAILED()\r
204 #endif\r
205 \r
206 #ifndef traceCREATE_MUTEX\r
207         #define traceCREATE_MUTEX( pxNewQueue )\r
208 #endif\r
209 \r
210 #ifndef traceCREATE_MUTEX_FAILED\r
211         #define traceCREATE_MUTEX_FAILED()\r
212 #endif\r
213 \r
214 #ifndef traceGIVE_MUTEX_RECURSIVE\r
215         #define traceGIVE_MUTEX_RECURSIVE( pxMutex )\r
216 #endif\r
217 \r
218 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED\r
219         #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
220 #endif\r
221 \r
222 #ifndef traceTAKE_MUTEX_RECURSIVE\r
223         #define traceTAKE_MUTEX_RECURSIVE( pxMutex )\r
224 #endif\r
225 \r
226 #ifndef traceCREATE_COUNTING_SEMAPHORE\r
227         #define traceCREATE_COUNTING_SEMAPHORE()\r
228 #endif\r
229 \r
230 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED\r
231         #define traceCREATE_COUNTING_SEMAPHORE_FAILED()\r
232 #endif\r
233 \r
234 #ifndef traceQUEUE_SEND\r
235         #define traceQUEUE_SEND( pxQueue )\r
236 #endif\r
237 \r
238 #ifndef traceQUEUE_SEND_FAILED\r
239         #define traceQUEUE_SEND_FAILED( pxQueue )\r
240 #endif\r
241 \r
242 #ifndef traceQUEUE_RECEIVE\r
243         #define traceQUEUE_RECEIVE( pxQueue )\r
244 #endif\r
245 \r
246 #ifndef traceQUEUE_PEEK\r
247         #define traceQUEUE_PEEK( pxQueue )\r
248 #endif\r
249 \r
250 #ifndef traceQUEUE_RECEIVE_FAILED\r
251         #define traceQUEUE_RECEIVE_FAILED( pxQueue )\r
252 #endif\r
253 \r
254 #ifndef traceQUEUE_SEND_FROM_ISR\r
255         #define traceQUEUE_SEND_FROM_ISR( pxQueue )\r
256 #endif\r
257 \r
258 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED\r
259         #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )\r
260 #endif\r
261 \r
262 #ifndef traceQUEUE_RECEIVE_FROM_ISR\r
263         #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )\r
264 #endif\r
265 \r
266 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
267         #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )\r
268 #endif\r
269 \r
270 #ifndef traceQUEUE_DELETE\r
271         #define traceQUEUE_DELETE( pxQueue )\r
272 #endif\r
273 \r
274 #ifndef traceTASK_CREATE\r
275         #define traceTASK_CREATE( pxNewTCB )\r
276 #endif\r
277 \r
278 #ifndef traceTASK_CREATE_FAILED\r
279         #define traceTASK_CREATE_FAILED( pxNewTCB )\r
280 #endif\r
281 \r
282 #ifndef traceTASK_DELETE\r
283         #define traceTASK_DELETE( pxTaskToDelete )\r
284 #endif\r
285 \r
286 #ifndef traceTASK_DELAY_UNTIL\r
287         #define traceTASK_DELAY_UNTIL()\r
288 #endif\r
289 \r
290 #ifndef traceTASK_DELAY\r
291         #define traceTASK_DELAY()\r
292 #endif\r
293 \r
294 #ifndef traceTASK_PRIORITY_SET\r
295         #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )\r
296 #endif\r
297 \r
298 #ifndef traceTASK_SUSPEND\r
299         #define traceTASK_SUSPEND( pxTaskToSuspend )\r
300 #endif\r
301 \r
302 #ifndef traceTASK_RESUME\r
303         #define traceTASK_RESUME( pxTaskToResume )\r
304 #endif\r
305 \r
306 #ifndef traceTASK_RESUME_FROM_ISR\r
307         #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )\r
308 #endif\r
309 \r
310 #ifndef traceTASK_INCREMENT_TICK\r
311         #define traceTASK_INCREMENT_TICK( xTickCount )\r
312 #endif\r
313 \r
314 #endif /* INC_FREERTOS_H */\r
315 \r