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