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