]> begriffs open source - freertos/blob - include/FreeRTOS.h
[AUTO][RELEASE]: Bump file header version to "10.4.4"
[freertos] / include / FreeRTOS.h
1 /*\r
2  * FreeRTOS Kernel V10.4.4\r
3  * Copyright (C) 2021 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * SPDX-License-Identifier: MIT
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
8  * this software and associated documentation files (the "Software"), to deal in\r
9  * the Software without restriction, including without limitation the rights to\r
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
11  * the Software, and to permit persons to whom the Software is furnished to do so,\r
12  * subject to the following conditions:\r
13  *\r
14  * The above copyright notice and this permission notice shall be included in all\r
15  * copies or substantial portions of the Software.\r
16  *\r
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
19  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
20  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
23  *\r
24  * https://www.FreeRTOS.org\r
25  * https://github.com/FreeRTOS\r
26  *\r
27  */\r
28 \r
29 #ifndef INC_FREERTOS_H\r
30 #define INC_FREERTOS_H\r
31 \r
32 /*\r
33  * Include the generic headers required for the FreeRTOS port being used.\r
34  */\r
35 #include <stddef.h>\r
36 \r
37 /*\r
38  * If stdint.h cannot be located then:\r
39  *   + If using GCC ensure the -nostdint options is *not* being used.\r
40  *   + Ensure the project's include path includes the directory in which your\r
41  *     compiler stores stdint.h.\r
42  *   + Set any compiler options necessary for it to support C99, as technically\r
43  *     stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any\r
44  *     other way).\r
45  *   + The FreeRTOS download includes a simple stdint.h definition that can be\r
46  *     used in cases where none is provided by the compiler.  The files only\r
47  *     contains the typedefs required to build FreeRTOS.  Read the instructions\r
48  *     in FreeRTOS/source/stdint.readme for more information.\r
49  */\r
50 #include <stdint.h>     /* READ COMMENT ABOVE. */\r
51 \r
52 /* *INDENT-OFF* */\r
53 #ifdef __cplusplus\r
54     extern "C" {\r
55 #endif\r
56 /* *INDENT-ON* */\r
57 \r
58 /* Application specific configuration options. */\r
59 #include "FreeRTOSConfig.h"\r
60 \r
61 /* Basic FreeRTOS definitions. */\r
62 #include "projdefs.h"\r
63 \r
64 /* Definitions specific to the port being used. */\r
65 #include "portable.h"\r
66 \r
67 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */\r
68 #ifndef configUSE_NEWLIB_REENTRANT\r
69     #define configUSE_NEWLIB_REENTRANT    0\r
70 #endif\r
71 \r
72 /* Required if struct _reent is used. */\r
73 #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
74     #include <reent.h>\r
75 #endif\r
76 \r
77 /*\r
78  * Check all the required application specific macros have been defined.\r
79  * These macros are application specific and (as downloaded) are defined\r
80  * within FreeRTOSConfig.h.\r
81  */\r
82 \r
83 #ifndef configMINIMAL_STACK_SIZE\r
84     #error Missing definition:  configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h.  configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task.  Refer to the demo project provided for your port for a suitable value.\r
85 #endif\r
86 \r
87 #ifndef configMAX_PRIORITIES\r
88     #error Missing definition:  configMAX_PRIORITIES must be defined in FreeRTOSConfig.h.  See the Configuration section of the FreeRTOS API documentation for details.\r
89 #endif\r
90 \r
91 #if configMAX_PRIORITIES < 1\r
92     #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.\r
93 #endif\r
94 \r
95 #ifndef configUSE_PREEMPTION\r
96     #error Missing definition:  configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
97 #endif\r
98 \r
99 #ifndef configUSE_IDLE_HOOK\r
100     #error Missing definition:  configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
101 #endif\r
102 \r
103 #ifndef configUSE_TICK_HOOK\r
104     #error Missing definition:  configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
105 #endif\r
106 \r
107 #ifndef configUSE_16_BIT_TICKS\r
108     #error Missing definition:  configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
109 #endif\r
110 \r
111 #ifndef configUSE_CO_ROUTINES\r
112     #define configUSE_CO_ROUTINES    0\r
113 #endif\r
114 \r
115 #ifndef INCLUDE_vTaskPrioritySet\r
116     #define INCLUDE_vTaskPrioritySet    0\r
117 #endif\r
118 \r
119 #ifndef INCLUDE_uxTaskPriorityGet\r
120     #define INCLUDE_uxTaskPriorityGet    0\r
121 #endif\r
122 \r
123 #ifndef INCLUDE_vTaskDelete\r
124     #define INCLUDE_vTaskDelete    0\r
125 #endif\r
126 \r
127 #ifndef INCLUDE_vTaskSuspend\r
128     #define INCLUDE_vTaskSuspend    0\r
129 #endif\r
130 \r
131 #ifdef INCLUDE_xTaskDelayUntil\r
132     #ifdef INCLUDE_vTaskDelayUntil\r
133         /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil.  Backward\r
134          * compatibility is maintained if only one or the other is defined, but\r
135          * there is a conflict if both are defined. */\r
136         #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined.  INCLUDE_vTaskDelayUntil is no longer required and should be removed\r
137     #endif\r
138 #endif\r
139 \r
140 #ifndef INCLUDE_xTaskDelayUntil\r
141     #ifdef INCLUDE_vTaskDelayUntil\r
142         /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then\r
143          * the project's FreeRTOSConfig.h probably pre-dates the introduction of\r
144          * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever\r
145          * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.\r
146          */\r
147         #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil\r
148     #endif\r
149 #endif\r
150 \r
151 #ifndef INCLUDE_xTaskDelayUntil\r
152     #define INCLUDE_xTaskDelayUntil    0\r
153 #endif\r
154 \r
155 #ifndef INCLUDE_vTaskDelay\r
156     #define INCLUDE_vTaskDelay    0\r
157 #endif\r
158 \r
159 #ifndef INCLUDE_xTaskGetIdleTaskHandle\r
160     #define INCLUDE_xTaskGetIdleTaskHandle    0\r
161 #endif\r
162 \r
163 #ifndef INCLUDE_xTaskAbortDelay\r
164     #define INCLUDE_xTaskAbortDelay    0\r
165 #endif\r
166 \r
167 #ifndef INCLUDE_xQueueGetMutexHolder\r
168     #define INCLUDE_xQueueGetMutexHolder    0\r
169 #endif\r
170 \r
171 #ifndef INCLUDE_xSemaphoreGetMutexHolder\r
172     #define INCLUDE_xSemaphoreGetMutexHolder    INCLUDE_xQueueGetMutexHolder\r
173 #endif\r
174 \r
175 #ifndef INCLUDE_xTaskGetHandle\r
176     #define INCLUDE_xTaskGetHandle    0\r
177 #endif\r
178 \r
179 #ifndef INCLUDE_uxTaskGetStackHighWaterMark\r
180     #define INCLUDE_uxTaskGetStackHighWaterMark    0\r
181 #endif\r
182 \r
183 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2\r
184     #define INCLUDE_uxTaskGetStackHighWaterMark2    0\r
185 #endif\r
186 \r
187 #ifndef INCLUDE_eTaskGetState\r
188     #define INCLUDE_eTaskGetState    0\r
189 #endif\r
190 \r
191 #ifndef INCLUDE_xTaskResumeFromISR\r
192     #define INCLUDE_xTaskResumeFromISR    1\r
193 #endif\r
194 \r
195 #ifndef INCLUDE_xTimerPendFunctionCall\r
196     #define INCLUDE_xTimerPendFunctionCall    0\r
197 #endif\r
198 \r
199 #ifndef INCLUDE_xTaskGetSchedulerState\r
200     #define INCLUDE_xTaskGetSchedulerState    0\r
201 #endif\r
202 \r
203 #ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
204     #define INCLUDE_xTaskGetCurrentTaskHandle    0\r
205 #endif\r
206 \r
207 #if configUSE_CO_ROUTINES != 0\r
208     #ifndef configMAX_CO_ROUTINE_PRIORITIES\r
209         #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.\r
210     #endif\r
211 #endif\r
212 \r
213 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK\r
214     #define configUSE_DAEMON_TASK_STARTUP_HOOK    0\r
215 #endif\r
216 \r
217 #ifndef configUSE_APPLICATION_TASK_TAG\r
218     #define configUSE_APPLICATION_TASK_TAG    0\r
219 #endif\r
220 \r
221 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS\r
222     #define configNUM_THREAD_LOCAL_STORAGE_POINTERS    0\r
223 #endif\r
224 \r
225 #ifndef configUSE_RECURSIVE_MUTEXES\r
226     #define configUSE_RECURSIVE_MUTEXES    0\r
227 #endif\r
228 \r
229 #ifndef configUSE_MUTEXES\r
230     #define configUSE_MUTEXES    0\r
231 #endif\r
232 \r
233 #ifndef configUSE_TIMERS\r
234     #define configUSE_TIMERS    0\r
235 #endif\r
236 \r
237 #ifndef configUSE_COUNTING_SEMAPHORES\r
238     #define configUSE_COUNTING_SEMAPHORES    0\r
239 #endif\r
240 \r
241 #ifndef configUSE_ALTERNATIVE_API\r
242     #define configUSE_ALTERNATIVE_API    0\r
243 #endif\r
244 \r
245 #ifndef portCRITICAL_NESTING_IN_TCB\r
246     #define portCRITICAL_NESTING_IN_TCB    0\r
247 #endif\r
248 \r
249 #ifndef configMAX_TASK_NAME_LEN\r
250     #define configMAX_TASK_NAME_LEN    16\r
251 #endif\r
252 \r
253 #ifndef configIDLE_SHOULD_YIELD\r
254     #define configIDLE_SHOULD_YIELD    1\r
255 #endif\r
256 \r
257 #if configMAX_TASK_NAME_LEN < 1\r
258     #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h\r
259 #endif\r
260 \r
261 #ifndef configASSERT\r
262     #define configASSERT( x )\r
263     #define configASSERT_DEFINED    0\r
264 #else\r
265     #define configASSERT_DEFINED    1\r
266 #endif\r
267 \r
268 /* configPRECONDITION should be defined as configASSERT.\r
269  * The CBMC proofs need a way to track assumptions and assertions.\r
270  * A configPRECONDITION statement should express an implicit invariant or\r
271  * assumption made.  A configASSERT statement should express an invariant that must\r
272  * hold explicit before calling the code. */\r
273 #ifndef configPRECONDITION\r
274     #define configPRECONDITION( X )    configASSERT( X )\r
275     #define configPRECONDITION_DEFINED    0\r
276 #else\r
277     #define configPRECONDITION_DEFINED    1\r
278 #endif\r
279 \r
280 #ifndef portMEMORY_BARRIER\r
281     #define portMEMORY_BARRIER()\r
282 #endif\r
283 \r
284 #ifndef portSOFTWARE_BARRIER\r
285     #define portSOFTWARE_BARRIER()\r
286 #endif\r
287 \r
288 /* The timers module relies on xTaskGetSchedulerState(). */\r
289 #if configUSE_TIMERS == 1\r
290 \r
291     #ifndef configTIMER_TASK_PRIORITY\r
292         #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.\r
293     #endif /* configTIMER_TASK_PRIORITY */\r
294 \r
295     #ifndef configTIMER_QUEUE_LENGTH\r
296         #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.\r
297     #endif /* configTIMER_QUEUE_LENGTH */\r
298 \r
299     #ifndef configTIMER_TASK_STACK_DEPTH\r
300         #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.\r
301     #endif /* configTIMER_TASK_STACK_DEPTH */\r
302 \r
303 #endif /* configUSE_TIMERS */\r
304 \r
305 #ifndef portSET_INTERRUPT_MASK_FROM_ISR\r
306     #define portSET_INTERRUPT_MASK_FROM_ISR()    0\r
307 #endif\r
308 \r
309 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR\r
310     #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue )    ( void ) uxSavedStatusValue\r
311 #endif\r
312 \r
313 #ifndef portCLEAN_UP_TCB\r
314     #define portCLEAN_UP_TCB( pxTCB )    ( void ) pxTCB\r
315 #endif\r
316 \r
317 #ifndef portPRE_TASK_DELETE_HOOK\r
318     #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )\r
319 #endif\r
320 \r
321 #ifndef portSETUP_TCB\r
322     #define portSETUP_TCB( pxTCB )    ( void ) pxTCB\r
323 #endif\r
324 \r
325 #ifndef configQUEUE_REGISTRY_SIZE\r
326     #define configQUEUE_REGISTRY_SIZE    0U\r
327 #endif\r
328 \r
329 #if ( configQUEUE_REGISTRY_SIZE < 1 )\r
330     #define vQueueAddToRegistry( xQueue, pcName )\r
331     #define vQueueUnregisterQueue( xQueue )\r
332     #define pcQueueGetName( xQueue )\r
333 #endif\r
334 \r
335 #ifndef portPOINTER_SIZE_TYPE\r
336     #define portPOINTER_SIZE_TYPE    uint32_t\r
337 #endif\r
338 \r
339 /* Remove any unused trace macros. */\r
340 #ifndef traceSTART\r
341 \r
342 /* Used to perform any necessary initialisation - for example, open a file\r
343  * into which trace is to be written. */\r
344     #define traceSTART()\r
345 #endif\r
346 \r
347 #ifndef traceEND\r
348 \r
349 /* Use to close a trace, for example close a file into which trace has been\r
350  * written. */\r
351     #define traceEND()\r
352 #endif\r
353 \r
354 #ifndef traceTASK_SWITCHED_IN\r
355 \r
356 /* Called after a task has been selected to run.  pxCurrentTCB holds a pointer\r
357  * to the task control block of the selected task. */\r
358     #define traceTASK_SWITCHED_IN()\r
359 #endif\r
360 \r
361 #ifndef traceINCREASE_TICK_COUNT\r
362 \r
363 /* Called before stepping the tick count after waking from tickless idle\r
364  * sleep. */\r
365     #define traceINCREASE_TICK_COUNT( x )\r
366 #endif\r
367 \r
368 #ifndef traceLOW_POWER_IDLE_BEGIN\r
369     /* Called immediately before entering tickless idle. */\r
370     #define traceLOW_POWER_IDLE_BEGIN()\r
371 #endif\r
372 \r
373 #ifndef traceLOW_POWER_IDLE_END\r
374     /* Called when returning to the Idle task after a tickless idle. */\r
375     #define traceLOW_POWER_IDLE_END()\r
376 #endif\r
377 \r
378 #ifndef traceTASK_SWITCHED_OUT\r
379 \r
380 /* Called before a task has been selected to run.  pxCurrentTCB holds a pointer\r
381  * to the task control block of the task being switched out. */\r
382     #define traceTASK_SWITCHED_OUT()\r
383 #endif\r
384 \r
385 #ifndef traceTASK_PRIORITY_INHERIT\r
386 \r
387 /* Called when a task attempts to take a mutex that is already held by a\r
388  * lower priority task.  pxTCBOfMutexHolder is a pointer to the TCB of the task\r
389  * that holds the mutex.  uxInheritedPriority is the priority the mutex holder\r
390  * will inherit (the priority of the task that is attempting to obtain the\r
391  * muted. */\r
392     #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )\r
393 #endif\r
394 \r
395 #ifndef traceTASK_PRIORITY_DISINHERIT\r
396 \r
397 /* Called when a task releases a mutex, the holding of which had resulted in\r
398  * the task inheriting the priority of a higher priority task.\r
399  * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the\r
400  * mutex.  uxOriginalPriority is the task's configured (base) priority. */\r
401     #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )\r
402 #endif\r
403 \r
404 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE\r
405 \r
406 /* Task is about to block because it cannot read from a\r
407  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
408  * upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
409  * task that attempted the read. */\r
410     #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )\r
411 #endif\r
412 \r
413 #ifndef traceBLOCKING_ON_QUEUE_PEEK\r
414 \r
415 /* Task is about to block because it cannot read from a\r
416  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
417  * upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
418  * task that attempted the read. */\r
419     #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )\r
420 #endif\r
421 \r
422 #ifndef traceBLOCKING_ON_QUEUE_SEND\r
423 \r
424 /* Task is about to block because it cannot write to a\r
425  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
426  * upon which the write was attempted.  pxCurrentTCB points to the TCB of the\r
427  * task that attempted the write. */\r
428     #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )\r
429 #endif\r
430 \r
431 #ifndef configCHECK_FOR_STACK_OVERFLOW\r
432     #define configCHECK_FOR_STACK_OVERFLOW    0\r
433 #endif\r
434 \r
435 #ifndef configRECORD_STACK_HIGH_ADDRESS\r
436     #define configRECORD_STACK_HIGH_ADDRESS    0\r
437 #endif\r
438 \r
439 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H\r
440     #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H    0\r
441 #endif\r
442 \r
443 /* The following event macros are embedded in the kernel API calls. */\r
444 \r
445 #ifndef traceMOVED_TASK_TO_READY_STATE\r
446     #define traceMOVED_TASK_TO_READY_STATE( pxTCB )\r
447 #endif\r
448 \r
449 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE\r
450     #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )\r
451 #endif\r
452 \r
453 #ifndef traceQUEUE_CREATE\r
454     #define traceQUEUE_CREATE( pxNewQueue )\r
455 #endif\r
456 \r
457 #ifndef traceQUEUE_CREATE_FAILED\r
458     #define traceQUEUE_CREATE_FAILED( ucQueueType )\r
459 #endif\r
460 \r
461 #ifndef traceCREATE_MUTEX\r
462     #define traceCREATE_MUTEX( pxNewQueue )\r
463 #endif\r
464 \r
465 #ifndef traceCREATE_MUTEX_FAILED\r
466     #define traceCREATE_MUTEX_FAILED()\r
467 #endif\r
468 \r
469 #ifndef traceGIVE_MUTEX_RECURSIVE\r
470     #define traceGIVE_MUTEX_RECURSIVE( pxMutex )\r
471 #endif\r
472 \r
473 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED\r
474     #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
475 #endif\r
476 \r
477 #ifndef traceTAKE_MUTEX_RECURSIVE\r
478     #define traceTAKE_MUTEX_RECURSIVE( pxMutex )\r
479 #endif\r
480 \r
481 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED\r
482     #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
483 #endif\r
484 \r
485 #ifndef traceCREATE_COUNTING_SEMAPHORE\r
486     #define traceCREATE_COUNTING_SEMAPHORE()\r
487 #endif\r
488 \r
489 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED\r
490     #define traceCREATE_COUNTING_SEMAPHORE_FAILED()\r
491 #endif\r
492 \r
493 #ifndef traceQUEUE_SET_SEND\r
494     #define traceQUEUE_SET_SEND    traceQUEUE_SEND\r
495 #endif\r
496 \r
497 #ifndef traceQUEUE_SEND\r
498     #define traceQUEUE_SEND( pxQueue )\r
499 #endif\r
500 \r
501 #ifndef traceQUEUE_SEND_FAILED\r
502     #define traceQUEUE_SEND_FAILED( pxQueue )\r
503 #endif\r
504 \r
505 #ifndef traceQUEUE_RECEIVE\r
506     #define traceQUEUE_RECEIVE( pxQueue )\r
507 #endif\r
508 \r
509 #ifndef traceQUEUE_PEEK\r
510     #define traceQUEUE_PEEK( pxQueue )\r
511 #endif\r
512 \r
513 #ifndef traceQUEUE_PEEK_FAILED\r
514     #define traceQUEUE_PEEK_FAILED( pxQueue )\r
515 #endif\r
516 \r
517 #ifndef traceQUEUE_PEEK_FROM_ISR\r
518     #define traceQUEUE_PEEK_FROM_ISR( pxQueue )\r
519 #endif\r
520 \r
521 #ifndef traceQUEUE_RECEIVE_FAILED\r
522     #define traceQUEUE_RECEIVE_FAILED( pxQueue )\r
523 #endif\r
524 \r
525 #ifndef traceQUEUE_SEND_FROM_ISR\r
526     #define traceQUEUE_SEND_FROM_ISR( pxQueue )\r
527 #endif\r
528 \r
529 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED\r
530     #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )\r
531 #endif\r
532 \r
533 #ifndef traceQUEUE_RECEIVE_FROM_ISR\r
534     #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )\r
535 #endif\r
536 \r
537 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
538     #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )\r
539 #endif\r
540 \r
541 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED\r
542     #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )\r
543 #endif\r
544 \r
545 #ifndef traceQUEUE_DELETE\r
546     #define traceQUEUE_DELETE( pxQueue )\r
547 #endif\r
548 \r
549 #ifndef traceTASK_CREATE\r
550     #define traceTASK_CREATE( pxNewTCB )\r
551 #endif\r
552 \r
553 #ifndef traceTASK_CREATE_FAILED\r
554     #define traceTASK_CREATE_FAILED()\r
555 #endif\r
556 \r
557 #ifndef traceTASK_DELETE\r
558     #define traceTASK_DELETE( pxTaskToDelete )\r
559 #endif\r
560 \r
561 #ifndef traceTASK_DELAY_UNTIL\r
562     #define traceTASK_DELAY_UNTIL( x )\r
563 #endif\r
564 \r
565 #ifndef traceTASK_DELAY\r
566     #define traceTASK_DELAY()\r
567 #endif\r
568 \r
569 #ifndef traceTASK_PRIORITY_SET\r
570     #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )\r
571 #endif\r
572 \r
573 #ifndef traceTASK_SUSPEND\r
574     #define traceTASK_SUSPEND( pxTaskToSuspend )\r
575 #endif\r
576 \r
577 #ifndef traceTASK_RESUME\r
578     #define traceTASK_RESUME( pxTaskToResume )\r
579 #endif\r
580 \r
581 #ifndef traceTASK_RESUME_FROM_ISR\r
582     #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )\r
583 #endif\r
584 \r
585 #ifndef traceTASK_INCREMENT_TICK\r
586     #define traceTASK_INCREMENT_TICK( xTickCount )\r
587 #endif\r
588 \r
589 #ifndef traceTIMER_CREATE\r
590     #define traceTIMER_CREATE( pxNewTimer )\r
591 #endif\r
592 \r
593 #ifndef traceTIMER_CREATE_FAILED\r
594     #define traceTIMER_CREATE_FAILED()\r
595 #endif\r
596 \r
597 #ifndef traceTIMER_COMMAND_SEND\r
598     #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )\r
599 #endif\r
600 \r
601 #ifndef traceTIMER_EXPIRED\r
602     #define traceTIMER_EXPIRED( pxTimer )\r
603 #endif\r
604 \r
605 #ifndef traceTIMER_COMMAND_RECEIVED\r
606     #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )\r
607 #endif\r
608 \r
609 #ifndef traceMALLOC\r
610     #define traceMALLOC( pvAddress, uiSize )\r
611 #endif\r
612 \r
613 #ifndef traceFREE\r
614     #define traceFREE( pvAddress, uiSize )\r
615 #endif\r
616 \r
617 #ifndef traceEVENT_GROUP_CREATE\r
618     #define traceEVENT_GROUP_CREATE( xEventGroup )\r
619 #endif\r
620 \r
621 #ifndef traceEVENT_GROUP_CREATE_FAILED\r
622     #define traceEVENT_GROUP_CREATE_FAILED()\r
623 #endif\r
624 \r
625 #ifndef traceEVENT_GROUP_SYNC_BLOCK\r
626     #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )\r
627 #endif\r
628 \r
629 #ifndef traceEVENT_GROUP_SYNC_END\r
630     #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred )    ( void ) xTimeoutOccurred\r
631 #endif\r
632 \r
633 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK\r
634     #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )\r
635 #endif\r
636 \r
637 #ifndef traceEVENT_GROUP_WAIT_BITS_END\r
638     #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred )    ( void ) xTimeoutOccurred\r
639 #endif\r
640 \r
641 #ifndef traceEVENT_GROUP_CLEAR_BITS\r
642     #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )\r
643 #endif\r
644 \r
645 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR\r
646     #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )\r
647 #endif\r
648 \r
649 #ifndef traceEVENT_GROUP_SET_BITS\r
650     #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )\r
651 #endif\r
652 \r
653 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR\r
654     #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )\r
655 #endif\r
656 \r
657 #ifndef traceEVENT_GROUP_DELETE\r
658     #define traceEVENT_GROUP_DELETE( xEventGroup )\r
659 #endif\r
660 \r
661 #ifndef tracePEND_FUNC_CALL\r
662     #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )\r
663 #endif\r
664 \r
665 #ifndef tracePEND_FUNC_CALL_FROM_ISR\r
666     #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )\r
667 #endif\r
668 \r
669 #ifndef traceQUEUE_REGISTRY_ADD\r
670     #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )\r
671 #endif\r
672 \r
673 #ifndef traceTASK_NOTIFY_TAKE_BLOCK\r
674     #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )\r
675 #endif\r
676 \r
677 #ifndef traceTASK_NOTIFY_TAKE\r
678     #define traceTASK_NOTIFY_TAKE( uxIndexToWait )\r
679 #endif\r
680 \r
681 #ifndef traceTASK_NOTIFY_WAIT_BLOCK\r
682     #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )\r
683 #endif\r
684 \r
685 #ifndef traceTASK_NOTIFY_WAIT\r
686     #define traceTASK_NOTIFY_WAIT( uxIndexToWait )\r
687 #endif\r
688 \r
689 #ifndef traceTASK_NOTIFY\r
690     #define traceTASK_NOTIFY( uxIndexToNotify )\r
691 #endif\r
692 \r
693 #ifndef traceTASK_NOTIFY_FROM_ISR\r
694     #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )\r
695 #endif\r
696 \r
697 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR\r
698     #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )\r
699 #endif\r
700 \r
701 #ifndef traceSTREAM_BUFFER_CREATE_FAILED\r
702     #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )\r
703 #endif\r
704 \r
705 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED\r
706     #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )\r
707 #endif\r
708 \r
709 #ifndef traceSTREAM_BUFFER_CREATE\r
710     #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )\r
711 #endif\r
712 \r
713 #ifndef traceSTREAM_BUFFER_DELETE\r
714     #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )\r
715 #endif\r
716 \r
717 #ifndef traceSTREAM_BUFFER_RESET\r
718     #define traceSTREAM_BUFFER_RESET( xStreamBuffer )\r
719 #endif\r
720 \r
721 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND\r
722     #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )\r
723 #endif\r
724 \r
725 #ifndef traceSTREAM_BUFFER_SEND\r
726     #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )\r
727 #endif\r
728 \r
729 #ifndef traceSTREAM_BUFFER_SEND_FAILED\r
730     #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )\r
731 #endif\r
732 \r
733 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR\r
734     #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )\r
735 #endif\r
736 \r
737 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE\r
738     #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )\r
739 #endif\r
740 \r
741 #ifndef traceSTREAM_BUFFER_RECEIVE\r
742     #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )\r
743 #endif\r
744 \r
745 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED\r
746     #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )\r
747 #endif\r
748 \r
749 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR\r
750     #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )\r
751 #endif\r
752 \r
753 #ifndef configGENERATE_RUN_TIME_STATS\r
754     #define configGENERATE_RUN_TIME_STATS    0\r
755 #endif\r
756 \r
757 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
758 \r
759     #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS\r
760         #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.\r
761     #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */\r
762 \r
763     #ifndef portGET_RUN_TIME_COUNTER_VALUE\r
764         #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE\r
765             #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined.  See the examples provided and the FreeRTOS web site for more information.\r
766         #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */\r
767     #endif /* portGET_RUN_TIME_COUNTER_VALUE */\r
768 \r
769 #endif /* configGENERATE_RUN_TIME_STATS */\r
770 \r
771 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS\r
772     #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()\r
773 #endif\r
774 \r
775 #ifndef configUSE_MALLOC_FAILED_HOOK\r
776     #define configUSE_MALLOC_FAILED_HOOK    0\r
777 #endif\r
778 \r
779 #ifndef portPRIVILEGE_BIT\r
780     #define portPRIVILEGE_BIT    ( ( UBaseType_t ) 0x00 )\r
781 #endif\r
782 \r
783 #ifndef portYIELD_WITHIN_API\r
784     #define portYIELD_WITHIN_API    portYIELD\r
785 #endif\r
786 \r
787 #ifndef portSUPPRESS_TICKS_AND_SLEEP\r
788     #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )\r
789 #endif\r
790 \r
791 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP\r
792     #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP    2\r
793 #endif\r
794 \r
795 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2\r
796     #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2\r
797 #endif\r
798 \r
799 #ifndef configUSE_TICKLESS_IDLE\r
800     #define configUSE_TICKLESS_IDLE    0\r
801 #endif\r
802 \r
803 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING\r
804     #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )\r
805 #endif\r
806 \r
807 #ifndef configPRE_SLEEP_PROCESSING\r
808     #define configPRE_SLEEP_PROCESSING( x )\r
809 #endif\r
810 \r
811 #ifndef configPOST_SLEEP_PROCESSING\r
812     #define configPOST_SLEEP_PROCESSING( x )\r
813 #endif\r
814 \r
815 #ifndef configUSE_QUEUE_SETS\r
816     #define configUSE_QUEUE_SETS    0\r
817 #endif\r
818 \r
819 #ifndef portTASK_USES_FLOATING_POINT\r
820     #define portTASK_USES_FLOATING_POINT()\r
821 #endif\r
822 \r
823 #ifndef portALLOCATE_SECURE_CONTEXT\r
824     #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )\r
825 #endif\r
826 \r
827 #ifndef portDONT_DISCARD\r
828     #define portDONT_DISCARD\r
829 #endif\r
830 \r
831 #ifndef configUSE_TIME_SLICING\r
832     #define configUSE_TIME_SLICING    1\r
833 #endif\r
834 \r
835 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS\r
836     #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS    0\r
837 #endif\r
838 \r
839 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS\r
840     #define configUSE_STATS_FORMATTING_FUNCTIONS    0\r
841 #endif\r
842 \r
843 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID\r
844     #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()\r
845 #endif\r
846 \r
847 #ifndef configUSE_TRACE_FACILITY\r
848     #define configUSE_TRACE_FACILITY    0\r
849 #endif\r
850 \r
851 #ifndef mtCOVERAGE_TEST_MARKER\r
852     #define mtCOVERAGE_TEST_MARKER()\r
853 #endif\r
854 \r
855 #ifndef mtCOVERAGE_TEST_DELAY\r
856     #define mtCOVERAGE_TEST_DELAY()\r
857 #endif\r
858 \r
859 #ifndef portASSERT_IF_IN_ISR\r
860     #define portASSERT_IF_IN_ISR()\r
861 #endif\r
862 \r
863 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION\r
864     #define configUSE_PORT_OPTIMISED_TASK_SELECTION    0\r
865 #endif\r
866 \r
867 #ifndef configAPPLICATION_ALLOCATED_HEAP\r
868     #define configAPPLICATION_ALLOCATED_HEAP    0\r
869 #endif\r
870 \r
871 #ifndef configUSE_TASK_NOTIFICATIONS\r
872     #define configUSE_TASK_NOTIFICATIONS    1\r
873 #endif\r
874 \r
875 #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES\r
876     #define configTASK_NOTIFICATION_ARRAY_ENTRIES    1\r
877 #endif\r
878 \r
879 #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1\r
880     #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1\r
881 #endif\r
882 \r
883 #ifndef configUSE_POSIX_ERRNO\r
884     #define configUSE_POSIX_ERRNO    0\r
885 #endif\r
886 \r
887 #ifndef portTICK_TYPE_IS_ATOMIC\r
888     #define portTICK_TYPE_IS_ATOMIC    0\r
889 #endif\r
890 \r
891 #ifndef configSUPPORT_STATIC_ALLOCATION\r
892     /* Defaults to 0 for backward compatibility. */\r
893     #define configSUPPORT_STATIC_ALLOCATION    0\r
894 #endif\r
895 \r
896 #ifndef configSUPPORT_DYNAMIC_ALLOCATION\r
897     /* Defaults to 1 for backward compatibility. */\r
898     #define configSUPPORT_DYNAMIC_ALLOCATION    1\r
899 #endif\r
900 \r
901 #ifndef configSTACK_DEPTH_TYPE\r
902 \r
903 /* Defaults to uint16_t for backward compatibility, but can be overridden\r
904  * in FreeRTOSConfig.h if uint16_t is too restrictive. */\r
905     #define configSTACK_DEPTH_TYPE    uint16_t\r
906 #endif\r
907 \r
908 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE\r
909 \r
910 /* Defaults to size_t for backward compatibility, but can be overridden\r
911  * in FreeRTOSConfig.h if lengths will always be less than the number of bytes\r
912  * in a size_t. */\r
913     #define configMESSAGE_BUFFER_LENGTH_TYPE    size_t\r
914 #endif\r
915 \r
916 /* Sanity check the configuration. */\r
917 #if ( configUSE_TICKLESS_IDLE != 0 )\r
918     #if ( INCLUDE_vTaskSuspend != 1 )\r
919         #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0\r
920     #endif /* INCLUDE_vTaskSuspend */\r
921 #endif /* configUSE_TICKLESS_IDLE */\r
922 \r
923 #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )\r
924     #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.\r
925 #endif\r
926 \r
927 #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )\r
928     #error configUSE_MUTEXES must be set to 1 to use recursive mutexes\r
929 #endif\r
930 \r
931 #ifndef configINITIAL_TICK_COUNT\r
932     #define configINITIAL_TICK_COUNT    0\r
933 #endif\r
934 \r
935 #if ( portTICK_TYPE_IS_ATOMIC == 0 )\r
936 \r
937 /* Either variables of tick type cannot be read atomically, or\r
938  * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when\r
939  * the tick count is returned to the standard critical section macros. */\r
940     #define portTICK_TYPE_ENTER_CRITICAL()                      portENTER_CRITICAL()\r
941     #define portTICK_TYPE_EXIT_CRITICAL()                       portEXIT_CRITICAL()\r
942     #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()         portSET_INTERRUPT_MASK_FROM_ISR()\r
943     #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x )    portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )\r
944 #else\r
945 \r
946 /* The tick type can be read atomically, so critical sections used when the\r
947  * tick count is returned can be defined away. */\r
948     #define portTICK_TYPE_ENTER_CRITICAL()\r
949     #define portTICK_TYPE_EXIT_CRITICAL()\r
950     #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()         0\r
951     #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x )    ( void ) x\r
952 #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */\r
953 \r
954 /* Definitions to allow backward compatibility with FreeRTOS versions prior to\r
955  * V8 if desired. */\r
956 #ifndef configENABLE_BACKWARD_COMPATIBILITY\r
957     #define configENABLE_BACKWARD_COMPATIBILITY    1\r
958 #endif\r
959 \r
960 #ifndef configPRINTF\r
961 \r
962 /* configPRINTF() was not defined, so define it away to nothing.  To use\r
963  * configPRINTF() then define it as follows (where MyPrintFunction() is\r
964  * provided by the application writer):\r
965  *\r
966  * void MyPrintFunction(const char *pcFormat, ... );\r
967  #define configPRINTF( X )   MyPrintFunction X\r
968  *\r
969  * Then call like a standard printf() function, but placing brackets around\r
970  * all parameters so they are passed as a single parameter.  For example:\r
971  * configPRINTF( ("Value = %d", MyVariable) ); */\r
972     #define configPRINTF( X )\r
973 #endif\r
974 \r
975 #ifndef configMAX\r
976 \r
977 /* The application writer has not provided their own MAX macro, so define\r
978  * the following generic implementation. */\r
979     #define configMAX( a, b )    ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )\r
980 #endif\r
981 \r
982 #ifndef configMIN\r
983 \r
984 /* The application writer has not provided their own MIN macro, so define\r
985  * the following generic implementation. */\r
986     #define configMIN( a, b )    ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )\r
987 #endif\r
988 \r
989 #if configENABLE_BACKWARD_COMPATIBILITY == 1\r
990     #define eTaskStateGet                 eTaskGetState\r
991     #define portTickType                  TickType_t\r
992     #define xTaskHandle                   TaskHandle_t\r
993     #define xQueueHandle                  QueueHandle_t\r
994     #define xSemaphoreHandle              SemaphoreHandle_t\r
995     #define xQueueSetHandle               QueueSetHandle_t\r
996     #define xQueueSetMemberHandle         QueueSetMemberHandle_t\r
997     #define xTimeOutType                  TimeOut_t\r
998     #define xMemoryRegion                 MemoryRegion_t\r
999     #define xTaskParameters               TaskParameters_t\r
1000     #define xTaskStatusType               TaskStatus_t\r
1001     #define xTimerHandle                  TimerHandle_t\r
1002     #define xCoRoutineHandle              CoRoutineHandle_t\r
1003     #define pdTASK_HOOK_CODE              TaskHookFunction_t\r
1004     #define portTICK_RATE_MS              portTICK_PERIOD_MS\r
1005     #define pcTaskGetTaskName             pcTaskGetName\r
1006     #define pcTimerGetTimerName           pcTimerGetName\r
1007     #define pcQueueGetQueueName           pcQueueGetName\r
1008     #define vTaskGetTaskInfo              vTaskGetInfo\r
1009     #define xTaskGetIdleRunTimeCounter    ulTaskGetIdleRunTimeCounter\r
1010 \r
1011 /* Backward compatibility within the scheduler code only - these definitions\r
1012  * are not really required but are included for completeness. */\r
1013     #define tmrTIMER_CALLBACK             TimerCallbackFunction_t\r
1014     #define pdTASK_CODE                   TaskFunction_t\r
1015     #define xListItem                     ListItem_t\r
1016     #define xList                         List_t\r
1017 \r
1018 /* For libraries that break the list data hiding, and access list structure\r
1019  * members directly (which is not supposed to be done). */\r
1020     #define pxContainer                   pvContainer\r
1021 #endif /* configENABLE_BACKWARD_COMPATIBILITY */\r
1022 \r
1023 #if ( configUSE_ALTERNATIVE_API != 0 )\r
1024     #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0\r
1025 #endif\r
1026 \r
1027 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even\r
1028  * if floating point hardware is otherwise supported by the FreeRTOS port in use.\r
1029  * This constant is not supported by all FreeRTOS ports that include floating\r
1030  * point support. */\r
1031 #ifndef configUSE_TASK_FPU_SUPPORT\r
1032     #define configUSE_TASK_FPU_SUPPORT    1\r
1033 #endif\r
1034 \r
1035 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is\r
1036  * currently used in ARMv8M ports. */\r
1037 #ifndef configENABLE_MPU\r
1038     #define configENABLE_MPU    0\r
1039 #endif\r
1040 \r
1041 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is\r
1042  * currently used in ARMv8M ports. */\r
1043 #ifndef configENABLE_FPU\r
1044     #define configENABLE_FPU    1\r
1045 #endif\r
1046 \r
1047 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.\r
1048  * This is currently used in ARMv8M ports. */\r
1049 #ifndef configENABLE_TRUSTZONE\r
1050     #define configENABLE_TRUSTZONE    1\r
1051 #endif\r
1052 \r
1053 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on\r
1054  * the Secure Side only. */\r
1055 #ifndef configRUN_FREERTOS_SECURE_ONLY\r
1056     #define configRUN_FREERTOS_SECURE_ONLY    0\r
1057 #endif\r
1058 \r
1059 #ifndef configRUN_ADDITIONAL_TESTS\r
1060     #define configRUN_ADDITIONAL_TESTS    0\r
1061 #endif\r
1062 \r
1063 \r
1064 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using\r
1065  * dynamically allocated RAM, in which case when any task is deleted it is known\r
1066  * that both the task's stack and TCB need to be freed.  Sometimes the\r
1067  * FreeRTOSConfig.h settings only allow a task to be created using statically\r
1068  * allocated RAM, in which case when any task is deleted it is known that neither\r
1069  * the task's stack or TCB should be freed.  Sometimes the FreeRTOSConfig.h\r
1070  * settings allow a task to be created using either statically or dynamically\r
1071  * allocated RAM, in which case a member of the TCB is used to record whether the\r
1072  * stack and/or TCB were allocated statically or dynamically, so when a task is\r
1073  * deleted the RAM that was allocated dynamically is freed again and no attempt is\r
1074  * made to free the RAM that was allocated statically.\r
1075  * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a\r
1076  * task to be created using either statically or dynamically allocated RAM.  Note\r
1077  * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with\r
1078  * a statically allocated stack and a dynamically allocated TCB.\r
1079  *\r
1080  * The following table lists various combinations of portUSING_MPU_WRAPPERS,\r
1081  * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and\r
1082  * when it is possible to have both static and dynamic allocation:\r
1083  *  +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1084  * | MPU | Dynamic | Static |     Available Functions     |       Possible Allocations        | Both Dynamic and | Need Free |\r
1085  * |     |         |        |                             |                                   | Static Possible  |           |\r
1086  * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1087  * | 0   | 0       | 1      | xTaskCreateStatic           | TCB - Static, Stack - Static      | No               | No        |\r
1088  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1089  * | 0   | 1       | 0      | xTaskCreate                 | TCB - Dynamic, Stack - Dynamic    | No               | Yes       |\r
1090  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1091  * | 0   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1092  * |     |         |        | xTaskCreateStatic           | 2. TCB - Static, Stack - Static   |                  |           |\r
1093  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1094  * | 1   | 0       | 1      | xTaskCreateStatic,          | TCB - Static, Stack - Static      | No               | No        |\r
1095  * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
1096  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1097  * | 1   | 1       | 0      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1098  * |     |         |        | xTaskCreateRestricted       | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
1099  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1100  * | 1   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1101  * |     |         |        | xTaskCreateStatic,          | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
1102  * |     |         |        | xTaskCreateRestricted,      | 3. TCB - Static, Stack - Static   |                  |           |\r
1103  * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
1104  * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1105  */\r
1106 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE                                                                                     \\r
1107     ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \\r
1108       ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )\r
1109 \r
1110 /*\r
1111  * In line with software engineering best practice, FreeRTOS implements a strict\r
1112  * data hiding policy, so the real structures used by FreeRTOS to maintain the\r
1113  * state of tasks, queues, semaphores, etc. are not accessible to the application\r
1114  * code.  However, if the application writer wants to statically allocate such\r
1115  * an object then the size of the object needs to be known.  Dummy structures\r
1116  * that are guaranteed to have the same size and alignment requirements of the\r
1117  * real objects are used for this purpose.  The dummy list and list item\r
1118  * structures below are used for inclusion in such a dummy structure.\r
1119  */\r
1120 struct xSTATIC_LIST_ITEM\r
1121 {\r
1122     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1123         TickType_t xDummy1;\r
1124     #endif\r
1125     TickType_t xDummy2;\r
1126     void * pvDummy3[ 4 ];\r
1127     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1128         TickType_t xDummy4;\r
1129     #endif\r
1130 };\r
1131 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;\r
1132 \r
1133 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
1134 struct xSTATIC_MINI_LIST_ITEM\r
1135 {\r
1136     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1137         TickType_t xDummy1;\r
1138     #endif\r
1139     TickType_t xDummy2;\r
1140     void * pvDummy3[ 2 ];\r
1141 };\r
1142 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;\r
1143 \r
1144 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
1145 typedef struct xSTATIC_LIST\r
1146 {\r
1147     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1148         TickType_t xDummy1;\r
1149     #endif\r
1150     UBaseType_t uxDummy2;\r
1151     void * pvDummy3;\r
1152     StaticMiniListItem_t xDummy4;\r
1153     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1154         TickType_t xDummy5;\r
1155     #endif\r
1156 } StaticList_t;\r
1157 \r
1158 /*\r
1159  * In line with software engineering best practice, especially when supplying a\r
1160  * library that is likely to change in future versions, FreeRTOS implements a\r
1161  * strict data hiding policy.  This means the Task structure used internally by\r
1162  * FreeRTOS is not accessible to application code.  However, if the application\r
1163  * writer wants to statically allocate the memory required to create a task then\r
1164  * the size of the task object needs to be known.  The StaticTask_t structure\r
1165  * below is provided for this purpose.  Its sizes and alignment requirements are\r
1166  * guaranteed to match those of the genuine structure, no matter which\r
1167  * architecture is being used, and no matter how the values in FreeRTOSConfig.h\r
1168  * are set.  Its contents are somewhat obfuscated in the hope users will\r
1169  * recognise that it would be unwise to make direct use of the structure members.\r
1170  */\r
1171 typedef struct xSTATIC_TCB\r
1172 {\r
1173     void * pxDummy1;\r
1174     #if ( portUSING_MPU_WRAPPERS == 1 )\r
1175         xMPU_SETTINGS xDummy2;\r
1176     #endif\r
1177     StaticListItem_t xDummy3[ 2 ];\r
1178     UBaseType_t uxDummy5;\r
1179     void * pxDummy6;\r
1180     uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];\r
1181     #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )\r
1182         void * pxDummy8;\r
1183     #endif\r
1184     #if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
1185         UBaseType_t uxDummy9;\r
1186     #endif\r
1187     #if ( configUSE_TRACE_FACILITY == 1 )\r
1188         UBaseType_t uxDummy10[ 2 ];\r
1189     #endif\r
1190     #if ( configUSE_MUTEXES == 1 )\r
1191         UBaseType_t uxDummy12[ 2 ];\r
1192     #endif\r
1193     #if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
1194         void * pxDummy14;\r
1195     #endif\r
1196     #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
1197         void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
1198     #endif\r
1199     #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
1200         uint32_t ulDummy16;\r
1201     #endif\r
1202     #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
1203         struct  _reent xDummy17;\r
1204     #endif\r
1205     #if ( configUSE_TASK_NOTIFICATIONS == 1 )\r
1206         uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];\r
1207         uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];\r
1208     #endif\r
1209     #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
1210         uint8_t uxDummy20;\r
1211     #endif\r
1212 \r
1213     #if ( INCLUDE_xTaskAbortDelay == 1 )\r
1214         uint8_t ucDummy21;\r
1215     #endif\r
1216     #if ( configUSE_POSIX_ERRNO == 1 )\r
1217         int iDummy22;\r
1218     #endif\r
1219 } StaticTask_t;\r
1220 \r
1221 /*\r
1222  * In line with software engineering best practice, especially when supplying a\r
1223  * library that is likely to change in future versions, FreeRTOS implements a\r
1224  * strict data hiding policy.  This means the Queue structure used internally by\r
1225  * FreeRTOS is not accessible to application code.  However, if the application\r
1226  * writer wants to statically allocate the memory required to create a queue\r
1227  * then the size of the queue object needs to be known.  The StaticQueue_t\r
1228  * structure below is provided for this purpose.  Its sizes and alignment\r
1229  * requirements are guaranteed to match those of the genuine structure, no\r
1230  * matter which architecture is being used, and no matter how the values in\r
1231  * FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in the hope\r
1232  * users will recognise that it would be unwise to make direct use of the\r
1233  * structure members.\r
1234  */\r
1235 typedef struct xSTATIC_QUEUE\r
1236 {\r
1237     void * pvDummy1[ 3 ];\r
1238 \r
1239     union\r
1240     {\r
1241         void * pvDummy2;\r
1242         UBaseType_t uxDummy2;\r
1243     } u;\r
1244 \r
1245     StaticList_t xDummy3[ 2 ];\r
1246     UBaseType_t uxDummy4[ 3 ];\r
1247     uint8_t ucDummy5[ 2 ];\r
1248 \r
1249     #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
1250         uint8_t ucDummy6;\r
1251     #endif\r
1252 \r
1253     #if ( configUSE_QUEUE_SETS == 1 )\r
1254         void * pvDummy7;\r
1255     #endif\r
1256 \r
1257     #if ( configUSE_TRACE_FACILITY == 1 )\r
1258         UBaseType_t uxDummy8;\r
1259         uint8_t ucDummy9;\r
1260     #endif\r
1261 } StaticQueue_t;\r
1262 typedef StaticQueue_t StaticSemaphore_t;\r
1263 \r
1264 /*\r
1265  * In line with software engineering best practice, especially when supplying a\r
1266  * library that is likely to change in future versions, FreeRTOS implements a\r
1267  * strict data hiding policy.  This means the event group structure used\r
1268  * internally by FreeRTOS is not accessible to application code.  However, if\r
1269  * the application writer wants to statically allocate the memory required to\r
1270  * create an event group then the size of the event group object needs to be\r
1271  * know.  The StaticEventGroup_t structure below is provided for this purpose.\r
1272  * Its sizes and alignment requirements are guaranteed to match those of the\r
1273  * genuine structure, no matter which architecture is being used, and no matter\r
1274  * how the values in FreeRTOSConfig.h are set.  Its contents are somewhat\r
1275  * obfuscated in the hope users will recognise that it would be unwise to make\r
1276  * direct use of the structure members.\r
1277  */\r
1278 typedef struct xSTATIC_EVENT_GROUP\r
1279 {\r
1280     TickType_t xDummy1;\r
1281     StaticList_t xDummy2;\r
1282 \r
1283     #if ( configUSE_TRACE_FACILITY == 1 )\r
1284         UBaseType_t uxDummy3;\r
1285     #endif\r
1286 \r
1287     #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
1288         uint8_t ucDummy4;\r
1289     #endif\r
1290 } StaticEventGroup_t;\r
1291 \r
1292 /*\r
1293  * In line with software engineering best practice, especially when supplying a\r
1294  * library that is likely to change in future versions, FreeRTOS implements a\r
1295  * strict data hiding policy.  This means the software timer structure used\r
1296  * internally by FreeRTOS is not accessible to application code.  However, if\r
1297  * the application writer wants to statically allocate the memory required to\r
1298  * create a software timer then the size of the queue object needs to be known.\r
1299  * The StaticTimer_t structure below is provided for this purpose.  Its sizes\r
1300  * and alignment requirements are guaranteed to match those of the genuine\r
1301  * structure, no matter which architecture is being used, and no matter how the\r
1302  * values in FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in\r
1303  * the hope users will recognise that it would be unwise to make direct use of\r
1304  * the structure members.\r
1305  */\r
1306 typedef struct xSTATIC_TIMER\r
1307 {\r
1308     void * pvDummy1;\r
1309     StaticListItem_t xDummy2;\r
1310     TickType_t xDummy3;\r
1311     void * pvDummy5;\r
1312     TaskFunction_t pvDummy6;\r
1313     #if ( configUSE_TRACE_FACILITY == 1 )\r
1314         UBaseType_t uxDummy7;\r
1315     #endif\r
1316     uint8_t ucDummy8;\r
1317 } StaticTimer_t;\r
1318 \r
1319 /*\r
1320  * In line with software engineering best practice, especially when supplying a\r
1321  * library that is likely to change in future versions, FreeRTOS implements a\r
1322  * strict data hiding policy.  This means the stream buffer structure used\r
1323  * internally by FreeRTOS is not accessible to application code.  However, if\r
1324  * the application writer wants to statically allocate the memory required to\r
1325  * create a stream buffer then the size of the stream buffer object needs to be\r
1326  * known.  The StaticStreamBuffer_t structure below is provided for this\r
1327  * purpose.  Its size and alignment requirements are guaranteed to match those\r
1328  * of the genuine structure, no matter which architecture is being used, and\r
1329  * no matter how the values in FreeRTOSConfig.h are set.  Its contents are\r
1330  * somewhat obfuscated in the hope users will recognise that it would be unwise\r
1331  * to make direct use of the structure members.\r
1332  */\r
1333 typedef struct xSTATIC_STREAM_BUFFER\r
1334 {\r
1335     size_t uxDummy1[ 4 ];\r
1336     void * pvDummy2[ 3 ];\r
1337     uint8_t ucDummy3;\r
1338     #if ( configUSE_TRACE_FACILITY == 1 )\r
1339         UBaseType_t uxDummy4;\r
1340     #endif\r
1341 } StaticStreamBuffer_t;\r
1342 \r
1343 /* Message buffers are built on stream buffers. */\r
1344 typedef StaticStreamBuffer_t StaticMessageBuffer_t;\r
1345 \r
1346 /* *INDENT-OFF* */\r
1347 #ifdef __cplusplus\r
1348     }\r
1349 #endif\r
1350 /* *INDENT-ON* */\r
1351 \r
1352 #endif /* INC_FREERTOS_H */\r