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