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