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