1 |
/* |
---|
2 |
FreeRTOS V5.4.1 - Copyright (C) 2009 Real Time Engineers Ltd. |
---|
3 |
|
---|
4 |
This file is part of the FreeRTOS distribution. |
---|
5 |
|
---|
6 |
FreeRTOS is free software; you can redistribute it and/or modify it under |
---|
7 |
the terms of the GNU General Public License (version 2) as published by the |
---|
8 |
Free Software Foundation and modified by the FreeRTOS exception. |
---|
9 |
**NOTE** The exception to the GPL is included to allow you to distribute a |
---|
10 |
combined work that includes FreeRTOS without being obliged to provide the |
---|
11 |
source code for proprietary components outside of the FreeRTOS kernel. |
---|
12 |
Alternative commercial license and support terms are also available upon |
---|
13 |
request. See the licensing section of http://www.FreeRTOS.org for full |
---|
14 |
license details. |
---|
15 |
|
---|
16 |
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT |
---|
17 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
18 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
19 |
more details. |
---|
20 |
|
---|
21 |
You should have received a copy of the GNU General Public License along |
---|
22 |
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59 |
---|
23 |
Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
---|
24 |
|
---|
25 |
|
---|
26 |
*************************************************************************** |
---|
27 |
* * |
---|
28 |
* Looking for a quick start? Then check out the FreeRTOS eBook! * |
---|
29 |
* See http://www.FreeRTOS.org/Documentation for details * |
---|
30 |
* * |
---|
31 |
*************************************************************************** |
---|
32 |
|
---|
33 |
1 tab == 4 spaces! |
---|
34 |
|
---|
35 |
Please ensure to read the configuration and relevant port sections of the |
---|
36 |
online documentation. |
---|
37 |
|
---|
38 |
http://www.FreeRTOS.org - Documentation, latest information, license and |
---|
39 |
contact details. |
---|
40 |
|
---|
41 |
http://www.SafeRTOS.com - A version that is certified for use in safety |
---|
42 |
critical systems. |
---|
43 |
|
---|
44 |
http://www.OpenRTOS.com - Commercial support, development, porting, |
---|
45 |
licensing and training services. |
---|
46 |
*/ |
---|
47 |
|
---|
48 |
#ifndef INC_FREERTOS_H |
---|
49 |
#define INC_FREERTOS_H |
---|
50 |
|
---|
51 |
|
---|
52 |
/* |
---|
53 |
* Include the generic headers required for the FreeRTOS port being used. |
---|
54 |
*/ |
---|
55 |
#include <stddef.h> |
---|
56 |
|
---|
57 |
/* Basic FreeRTOS definitions. */ |
---|
58 |
#include "projdefs.h" |
---|
59 |
|
---|
60 |
/* Application specific configuration options. */ |
---|
61 |
#include "FreeRTOSConfig.h" |
---|
62 |
|
---|
63 |
/* Definitions specific to the port being used. */ |
---|
64 |
#include "portable.h" |
---|
65 |
|
---|
66 |
|
---|
67 |
/* Defines the prototype to which the application task hook function must |
---|
68 |
conform. */ |
---|
69 |
typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * ); |
---|
70 |
|
---|
71 |
|
---|
72 |
|
---|
73 |
|
---|
74 |
|
---|
75 |
/* |
---|
76 |
* Check all the required application specific macros have been defined. |
---|
77 |
* These macros are application specific and (as downloaded) are defined |
---|
78 |
* within FreeRTOSConfig.h. |
---|
79 |
*/ |
---|
80 |
|
---|
81 |
#ifndef configUSE_PREEMPTION |
---|
82 |
#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. |
---|
83 |
#endif |
---|
84 |
|
---|
85 |
#ifndef configUSE_IDLE_HOOK |
---|
86 |
#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. |
---|
87 |
#endif |
---|
88 |
|
---|
89 |
#ifndef configUSE_TICK_HOOK |
---|
90 |
#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. |
---|
91 |
#endif |
---|
92 |
|
---|
93 |
#ifndef configUSE_CO_ROUTINES |
---|
94 |
#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. |
---|
95 |
#endif |
---|
96 |
|
---|
97 |
#ifndef INCLUDE_vTaskPrioritySet |
---|
98 |
#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. |
---|
99 |
#endif |
---|
100 |
|
---|
101 |
#ifndef INCLUDE_uxTaskPriorityGet |
---|
102 |
#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. |
---|
103 |
#endif |
---|
104 |
|
---|
105 |
#ifndef INCLUDE_vTaskDelete |
---|
106 |
#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. |
---|
107 |
#endif |
---|
108 |
|
---|
109 |
#ifndef INCLUDE_vTaskCleanUpResources |
---|
110 |
#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. |
---|
111 |
#endif |
---|
112 |
|
---|
113 |
#ifndef INCLUDE_vTaskSuspend |
---|
114 |
#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. |
---|
115 |
#endif |
---|
116 |
|
---|
117 |
#ifndef INCLUDE_vTaskDelayUntil |
---|
118 |
#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. |
---|
119 |
#endif |
---|
120 |
|
---|
121 |
#ifndef INCLUDE_vTaskDelay |
---|
122 |
#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. |
---|
123 |
#endif |
---|
124 |
|
---|
125 |
#ifndef configUSE_16_BIT_TICKS |
---|
126 |
#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. |
---|
127 |
#endif |
---|
128 |
|
---|
129 |
#ifndef configUSE_APPLICATION_TASK_TAG |
---|
130 |
#define configUSE_APPLICATION_TASK_TAG 0 |
---|
131 |
#endif |
---|
132 |
|
---|
133 |
#ifndef INCLUDE_uxTaskGetStackHighWaterMark |
---|
134 |
#define INCLUDE_uxTaskGetStackHighWaterMark 0 |
---|
135 |
#endif |
---|
136 |
|
---|
137 |
#ifndef configUSE_RECURSIVE_MUTEXES |
---|
138 |
#define configUSE_RECURSIVE_MUTEXES 0 |
---|
139 |
#endif |
---|
140 |
|
---|
141 |
#ifndef configUSE_MUTEXES |
---|
142 |
#define configUSE_MUTEXES 0 |
---|
143 |
#endif |
---|
144 |
|
---|
145 |
#ifndef configUSE_COUNTING_SEMAPHORES |
---|
146 |
#define configUSE_COUNTING_SEMAPHORES 0 |
---|
147 |
#endif |
---|
148 |
|
---|
149 |
#ifndef configUSE_ALTERNATIVE_API |
---|
150 |
#define configUSE_ALTERNATIVE_API 0 |
---|
151 |
#endif |
---|
152 |
|
---|
153 |
#ifndef portCRITICAL_NESTING_IN_TCB |
---|
154 |
#define portCRITICAL_NESTING_IN_TCB 0 |
---|
155 |
#endif |
---|
156 |
|
---|
157 |
#ifndef configMAX_TASK_NAME_LEN |
---|
158 |
#define configMAX_TASK_NAME_LEN 16 |
---|
159 |
#endif |
---|
160 |
|
---|
161 |
#ifndef configIDLE_SHOULD_YIELD |
---|
162 |
#define configIDLE_SHOULD_YIELD 1 |
---|
163 |
#endif |
---|
164 |
|
---|
165 |
#if configMAX_TASK_NAME_LEN < 1 |
---|
166 |
#undef configMAX_TASK_NAME_LEN |
---|
167 |
#define configMAX_TASK_NAME_LEN 1 |
---|
168 |
#endif |
---|
169 |
|
---|
170 |
#ifndef INCLUDE_xTaskResumeFromISR |
---|
171 |
#define INCLUDE_xTaskResumeFromISR 1 |
---|
172 |
#endif |
---|
173 |
|
---|
174 |
#ifndef INCLUDE_xTaskGetSchedulerState |
---|
175 |
#define INCLUDE_xTaskGetSchedulerState 0 |
---|
176 |
#endif |
---|
177 |
|
---|
178 |
#if ( configUSE_MUTEXES == 1 ) |
---|
179 |
/* xTaskGetCurrentTaskHandle is used by the priority inheritance mechanism |
---|
180 |
within the mutex implementation so must be available if mutexes are used. */ |
---|
181 |
#undef INCLUDE_xTaskGetCurrentTaskHandle |
---|
182 |
#define INCLUDE_xTaskGetCurrentTaskHandle 1 |
---|
183 |
#else |
---|
184 |
#ifndef INCLUDE_xTaskGetCurrentTaskHandle |
---|
185 |
#define INCLUDE_xTaskGetCurrentTaskHandle 0 |
---|
186 |
#endif |
---|
187 |
#endif |
---|
188 |
|
---|
189 |
|
---|
190 |
#ifndef portSET_INTERRUPT_MASK_FROM_ISR |
---|
191 |
#define portSET_INTERRUPT_MASK_FROM_ISR() 0 |
---|
192 |
#endif |
---|
193 |
|
---|
194 |
#ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR |
---|
195 |
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue |
---|
196 |
#endif |
---|
197 |
|
---|
198 |
|
---|
199 |
#ifndef configQUEUE_REGISTRY_SIZE |
---|
200 |
#define configQUEUE_REGISTRY_SIZE 0 |
---|
201 |
#endif |
---|
202 |
|
---|
203 |
#if configQUEUE_REGISTRY_SIZE < 1 |
---|
204 |
#define configQUEUE_REGISTRY_SIZE 0 |
---|
205 |
#define vQueueAddToRegistry( xQueue, pcName ) |
---|
206 |
#define vQueueUnregisterQueue( xQueue ) |
---|
207 |
#endif |
---|
208 |
|
---|
209 |
|
---|
210 |
/* Remove any unused trace macros. */ |
---|
211 |
#ifndef traceSTART |
---|
212 |
/* Used to perform any necessary initialisation - for example, open a file |
---|
213 |
into which trace is to be written. */ |
---|
214 |
#define traceSTART() |
---|
215 |
#endif |
---|
216 |
|
---|
217 |
#ifndef traceEND |
---|
218 |
/* Use to close a trace, for example close a file into which trace has been |
---|
219 |
written. */ |
---|
220 |
#define traceEND() |
---|
221 |
#endif |
---|
222 |
|
---|
223 |
#ifndef traceTASK_SWITCHED_IN |
---|
224 |
/* Called after a task has been selected to run. pxCurrentTCB holds a pointer |
---|
225 |
to the task control block of the selected task. */ |
---|
226 |
#define traceTASK_SWITCHED_IN() |
---|
227 |
#endif |
---|
228 |
|
---|
229 |
#ifndef traceTASK_SWITCHED_OUT |
---|
230 |
/* Called before a task has been selected to run. pxCurrentTCB holds a pointer |
---|
231 |
to the task control block of the task being switched out. */ |
---|
232 |
#define traceTASK_SWITCHED_OUT() |
---|
233 |
#endif |
---|
234 |
|
---|
235 |
#ifndef traceBLOCKING_ON_QUEUE_RECEIVE |
---|
236 |
/* Task is about to block because it cannot read from a |
---|
237 |
queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore |
---|
238 |
upon which the read was attempted. pxCurrentTCB points to the TCB of the |
---|
239 |
task that attempted the read. */ |
---|
240 |
#define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) |
---|
241 |
#endif |
---|
242 |
|
---|
243 |
#ifndef traceBLOCKING_ON_QUEUE_SEND |
---|
244 |
/* Task is about to block because it cannot write to a |
---|
245 |
queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore |
---|
246 |
upon which the write was attempted. pxCurrentTCB points to the TCB of the |
---|
247 |
task that attempted the write. */ |
---|
248 |
#define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) |
---|
249 |
#endif |
---|
250 |
|
---|
251 |
#ifndef configCHECK_FOR_STACK_OVERFLOW |
---|
252 |
#define configCHECK_FOR_STACK_OVERFLOW 0 |
---|
253 |
#endif |
---|
254 |
|
---|
255 |
/* The following event macros are embedded in the kernel API calls. */ |
---|
256 |
|
---|
257 |
#ifndef traceQUEUE_CREATE |
---|
258 |
#define traceQUEUE_CREATE( pxNewQueue ) |
---|
259 |
#endif |
---|
260 |
|
---|
261 |
#ifndef traceQUEUE_CREATE_FAILED |
---|
262 |
#define traceQUEUE_CREATE_FAILED() |
---|
263 |
#endif |
---|
264 |
|
---|
265 |
#ifndef traceCREATE_MUTEX |
---|
266 |
#define traceCREATE_MUTEX( pxNewQueue ) |
---|
267 |
#endif |
---|
268 |
|
---|
269 |
#ifndef traceCREATE_MUTEX_FAILED |
---|
270 |
#define traceCREATE_MUTEX_FAILED() |
---|
271 |
#endif |
---|
272 |
|
---|
273 |
#ifndef traceGIVE_MUTEX_RECURSIVE |
---|
274 |
#define traceGIVE_MUTEX_RECURSIVE( pxMutex ) |
---|
275 |
#endif |
---|
276 |
|
---|
277 |
#ifndef traceGIVE_MUTEX_RECURSIVE_FAILED |
---|
278 |
#define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex ) |
---|
279 |
#endif |
---|
280 |
|
---|
281 |
#ifndef traceTAKE_MUTEX_RECURSIVE |
---|
282 |
#define traceTAKE_MUTEX_RECURSIVE( pxMutex ) |
---|
283 |
#endif |
---|
284 |
|
---|
285 |
#ifndef traceCREATE_COUNTING_SEMAPHORE |
---|
286 |
#define traceCREATE_COUNTING_SEMAPHORE() |
---|
287 |
#endif |
---|
288 |
|
---|
289 |
#ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED |
---|
290 |
#define traceCREATE_COUNTING_SEMAPHORE_FAILED() |
---|
291 |
#endif |
---|
292 |
|
---|
293 |
#ifndef traceQUEUE_SEND |
---|
294 |
#define traceQUEUE_SEND( pxQueue ) |
---|
295 |
#endif |
---|
296 |
|
---|
297 |
#ifndef traceQUEUE_SEND_FAILED |
---|
298 |
#define traceQUEUE_SEND_FAILED( pxQueue ) |
---|
299 |
#endif |
---|
300 |
|
---|
301 |
#ifndef traceQUEUE_RECEIVE |
---|
302 |
#define traceQUEUE_RECEIVE( pxQueue ) |
---|
303 |
#endif |
---|
304 |
|
---|
305 |
#ifndef traceQUEUE_PEEK |
---|
306 |
#define traceQUEUE_PEEK( pxQueue ) |
---|
307 |
#endif |
---|
308 |
|
---|
309 |
#ifndef traceQUEUE_RECEIVE_FAILED |
---|
310 |
#define traceQUEUE_RECEIVE_FAILED( pxQueue ) |
---|
311 |
#endif |
---|
312 |
|
---|
313 |
#ifndef traceQUEUE_SEND_FROM_ISR |
---|
314 |
#define traceQUEUE_SEND_FROM_ISR( pxQueue ) |
---|
315 |
#endif |
---|
316 |
|
---|
317 |
#ifndef traceQUEUE_SEND_FROM_ISR_FAILED |
---|
318 |
#define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) |
---|
319 |
#endif |
---|
320 |
|
---|
321 |
#ifndef traceQUEUE_RECEIVE_FROM_ISR |
---|
322 |
#define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) |
---|
323 |
#endif |
---|
324 |
|
---|
325 |
#ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED |
---|
326 |
#define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) |
---|
327 |
#endif |
---|
328 |
|
---|
329 |
#ifndef traceQUEUE_DELETE |
---|
330 |
#define traceQUEUE_DELETE( pxQueue ) |
---|
331 |
#endif |
---|
332 |
|
---|
333 |
#ifndef traceTASK_CREATE |
---|
334 |
#define traceTASK_CREATE( pxNewTCB ) |
---|
335 |
#endif |
---|
336 |
|
---|
337 |
#ifndef traceTASK_CREATE_FAILED |
---|
338 |
#define traceTASK_CREATE_FAILED( pxNewTCB ) |
---|
339 |
#endif |
---|
340 |
|
---|
341 |
#ifndef traceTASK_DELETE |
---|
342 |
#define traceTASK_DELETE( pxTaskToDelete ) |
---|
343 |
#endif |
---|
344 |
|
---|
345 |
#ifndef traceTASK_DELAY_UNTIL |
---|
346 |
#define traceTASK_DELAY_UNTIL() |
---|
347 |
#endif |
---|
348 |
|
---|
349 |
#ifndef traceTASK_DELAY |
---|
350 |
#define traceTASK_DELAY() |
---|
351 |
#endif |
---|
352 |
|
---|
353 |
#ifndef traceTASK_PRIORITY_SET |
---|
354 |
#define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) |
---|
355 |
#endif |
---|
356 |
|
---|
357 |
#ifndef traceTASK_SUSPEND |
---|
358 |
#define traceTASK_SUSPEND( pxTaskToSuspend ) |
---|
359 |
#endif |
---|
360 |
|
---|
361 |
#ifndef traceTASK_RESUME |
---|
362 |
#define traceTASK_RESUME( pxTaskToResume ) |
---|
363 |
#endif |
---|
364 |
|
---|
365 |
#ifndef traceTASK_RESUME_FROM_ISR |
---|
366 |
#define traceTASK_RESUME_FROM_ISR( pxTaskToResume ) |
---|
367 |
#endif |
---|
368 |
|
---|
369 |
#ifndef traceTASK_INCREMENT_TICK |
---|
370 |
#define traceTASK_INCREMENT_TICK( xTickCount ) |
---|
371 |
#endif |
---|
372 |
|
---|
373 |
#ifndef configGENERATE_RUN_TIME_STATS |
---|
374 |
#define configGENERATE_RUN_TIME_STATS 0 |
---|
375 |
#endif |
---|
376 |
|
---|
377 |
#if ( configGENERATE_RUN_TIME_STATS == 1 ) |
---|
378 |
|
---|
379 |
#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS |
---|
380 |
#error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base. |
---|
381 |
#endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */ |
---|
382 |
|
---|
383 |
#ifndef portGET_RUN_TIME_COUNTER_VALUE |
---|
384 |
#error If configGENERATE_RUN_TIME_STATS is defined then portGET_RUN_TIME_COUNTER_VALUE must also be defined. portGET_RUN_TIME_COUNTER_VALUE should evaluate to the counter value of the timer/counter peripheral used as the run time counter time base. |
---|
385 |
#endif /* portGET_RUN_TIME_COUNTER_VALUE */ |
---|
386 |
|
---|
387 |
#endif /* configGENERATE_RUN_TIME_STATS */ |
---|
388 |
|
---|
389 |
#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS |
---|
390 |
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() |
---|
391 |
#endif |
---|
392 |
|
---|
393 |
#ifndef configUSE_MALLOC_FAILED_HOOK |
---|
394 |
#define configUSE_MALLOC_FAILED_HOOK 0 |
---|
395 |
#endif |
---|
396 |
|
---|
397 |
#endif /* INC_FREERTOS_H */ |
---|
398 |
|
---|