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