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