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