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