2 * FreeRTOS SMP Kernel V202110.00
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * https://www.FreeRTOS.org
23 * https://github.com/FreeRTOS
27 #ifndef INC_FREERTOS_H
28 #define INC_FREERTOS_H
31 * Include the generic headers required for the FreeRTOS port being used.
36 * If stdint.h cannot be located then:
37 * + If using GCC ensure the -nostdint options is *not* being used.
38 * + Ensure the project's include path includes the directory in which your
39 * compiler stores stdint.h.
40 * + Set any compiler options necessary for it to support C99, as technically
41 * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any
43 * + The FreeRTOS download includes a simple stdint.h definition that can be
44 * used in cases where none is provided by the compiler. The files only
45 * contains the typedefs required to build FreeRTOS. Read the instructions
46 * in FreeRTOS/source/stdint.readme for more information.
48 #include <stdint.h> /* READ COMMENT ABOVE. */
56 /* Application specific configuration options. */
57 #include "FreeRTOSConfig.h"
59 /* Basic FreeRTOS definitions. */
62 /* Definitions specific to the port being used. */
65 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */
66 #ifndef configUSE_NEWLIB_REENTRANT
67 #define configUSE_NEWLIB_REENTRANT 0
70 /* Required if struct _reent is used. */
71 #if ( configUSE_NEWLIB_REENTRANT == 1 )
75 #ifdef configNEWLIB_REENTRANT_IS_DYNAMIC
76 #if ( configUSE_NEWLIB_REENTRANT != 1 )
77 #error configUSE_NEWLIB_REENTRANT must be defined to 1 to enable configNEWLIB_REENTRANT_IS_DYNAMIC
79 #else /* configNEWLIB_REENTRANT_IS_DYNAMIC */
80 #define configNEWLIB_REENTRANT_IS_DYNAMIC 0
81 #endif /* configNEWLIB_REENTRANT_IS_DYNAMIC */
84 * Check all the required application specific macros have been defined.
85 * These macros are application specific and (as downloaded) are defined
86 * within FreeRTOSConfig.h.
89 #ifndef configMINIMAL_STACK_SIZE
90 #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.
93 #ifndef configMAX_PRIORITIES
94 #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
97 #if configMAX_PRIORITIES < 1
98 #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.
101 #ifndef configUSE_PREEMPTION
102 #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.
105 #ifndef configUSE_IDLE_HOOK
106 #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.
109 #ifndef configUSE_TICK_HOOK
110 #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.
113 #ifndef configUSE_16_BIT_TICKS
114 #error Missing definition: configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
117 #ifndef configUSE_CO_ROUTINES
118 #define configUSE_CO_ROUTINES 0
121 #ifndef INCLUDE_vTaskPrioritySet
122 #define INCLUDE_vTaskPrioritySet 0
125 #ifndef INCLUDE_uxTaskPriorityGet
126 #define INCLUDE_uxTaskPriorityGet 0
129 #ifndef INCLUDE_vTaskDelete
130 #define INCLUDE_vTaskDelete 0
133 #ifndef INCLUDE_vTaskSuspend
134 #define INCLUDE_vTaskSuspend 0
137 #ifdef INCLUDE_xTaskDelayUntil
138 #ifdef INCLUDE_vTaskDelayUntil
139 /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
140 * compatibility is maintained if only one or the other is defined, but
141 * there is a conflict if both are defined. */
142 #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed
146 #ifndef INCLUDE_xTaskDelayUntil
147 #ifdef INCLUDE_vTaskDelayUntil
148 /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
149 * the project's FreeRTOSConfig.h probably pre-dates the introduction of
150 * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
151 * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
153 #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
157 #ifndef INCLUDE_xTaskDelayUntil
158 #define INCLUDE_xTaskDelayUntil 0
161 #ifndef INCLUDE_vTaskDelay
162 #define INCLUDE_vTaskDelay 0
165 #ifndef INCLUDE_xTaskGetIdleTaskHandle
166 #define INCLUDE_xTaskGetIdleTaskHandle 0
169 #ifndef INCLUDE_xTaskAbortDelay
170 #define INCLUDE_xTaskAbortDelay 0
173 #ifndef INCLUDE_xQueueGetMutexHolder
174 #define INCLUDE_xQueueGetMutexHolder 0
177 #ifndef INCLUDE_xSemaphoreGetMutexHolder
178 #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
181 #ifndef INCLUDE_xTaskGetHandle
182 #define INCLUDE_xTaskGetHandle 0
185 #ifndef INCLUDE_uxTaskGetStackHighWaterMark
186 #define INCLUDE_uxTaskGetStackHighWaterMark 0
189 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2
190 #define INCLUDE_uxTaskGetStackHighWaterMark2 0
193 #ifndef INCLUDE_eTaskGetState
194 #define INCLUDE_eTaskGetState 0
197 #ifndef INCLUDE_xTaskResumeFromISR
198 #define INCLUDE_xTaskResumeFromISR 1
201 #ifndef INCLUDE_xTimerPendFunctionCall
202 #define INCLUDE_xTimerPendFunctionCall 0
205 #ifndef INCLUDE_xTaskGetSchedulerState
206 #define INCLUDE_xTaskGetSchedulerState 0
209 #ifndef INCLUDE_xTaskGetCurrentTaskHandle
210 #define INCLUDE_xTaskGetCurrentTaskHandle 0
213 #if configUSE_CO_ROUTINES != 0
214 #ifndef configMAX_CO_ROUTINE_PRIORITIES
215 #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.
219 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
220 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
223 #ifndef configUSE_APPLICATION_TASK_TAG
224 #define configUSE_APPLICATION_TASK_TAG 0
227 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
228 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
231 #ifndef configUSE_RECURSIVE_MUTEXES
232 #define configUSE_RECURSIVE_MUTEXES 0
235 #ifndef configUSE_MUTEXES
236 #define configUSE_MUTEXES 0
239 #ifndef configUSE_TIMERS
240 #define configUSE_TIMERS 0
243 #ifndef configUSE_COUNTING_SEMAPHORES
244 #define configUSE_COUNTING_SEMAPHORES 0
247 #ifndef configUSE_TASK_PREEMPTION_DISABLE
248 #define configUSE_TASK_PREEMPTION_DISABLE 0
251 #ifndef configUSE_CORE_AFFINITY
252 #define configUSE_CORE_AFFINITY 0
255 #ifndef configUSE_ALTERNATIVE_API
256 #define configUSE_ALTERNATIVE_API 0
259 #ifndef portCRITICAL_NESTING_IN_TCB
260 #define portCRITICAL_NESTING_IN_TCB 0
263 #ifndef configMAX_TASK_NAME_LEN
264 #define configMAX_TASK_NAME_LEN 16
267 #ifndef configIDLE_SHOULD_YIELD
268 #define configIDLE_SHOULD_YIELD 1
271 #if configMAX_TASK_NAME_LEN < 1
272 #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
276 #define configASSERT( x )
277 #define configASSERT_DEFINED 0
279 #define configASSERT_DEFINED 1
282 /* configPRECONDITION should be defined as configASSERT.
283 * The CBMC proofs need a way to track assumptions and assertions.
284 * A configPRECONDITION statement should express an implicit invariant or
285 * assumption made. A configASSERT statement should express an invariant that must
286 * hold explicit before calling the code. */
287 #ifndef configPRECONDITION
288 #define configPRECONDITION( X ) configASSERT( X )
289 #define configPRECONDITION_DEFINED 0
291 #define configPRECONDITION_DEFINED 1
294 #ifndef portMEMORY_BARRIER
295 #define portMEMORY_BARRIER()
298 #ifndef portSOFTWARE_BARRIER
299 #define portSOFTWARE_BARRIER()
302 #ifndef configNUM_CORES
303 #define configNUM_CORES 1
306 #ifndef configRUN_MULTIPLE_PRIORITIES
307 #define configRUN_MULTIPLE_PRIORITIES 0
311 /* The timers module relies on xTaskGetSchedulerState(). */
312 #if configUSE_TIMERS == 1
314 #ifndef configTIMER_TASK_PRIORITY
315 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
316 #endif /* configTIMER_TASK_PRIORITY */
318 #ifndef configTIMER_QUEUE_LENGTH
319 #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
320 #endif /* configTIMER_QUEUE_LENGTH */
322 #ifndef configTIMER_TASK_STACK_DEPTH
323 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
324 #endif /* configTIMER_TASK_STACK_DEPTH */
326 #ifndef portTIMER_CALLBACK_ATTRIBUTE
327 #define portTIMER_CALLBACK_ATTRIBUTE
328 #endif /* portTIMER_CALLBACK_ATTRIBUTE */
330 #endif /* configUSE_TIMERS */
332 #ifndef portSET_INTERRUPT_MASK_FROM_ISR
333 #define portSET_INTERRUPT_MASK_FROM_ISR() 0
336 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
337 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
340 #ifndef portCLEAN_UP_TCB
341 #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
344 #ifndef portPRE_TASK_DELETE_HOOK
345 #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
348 #ifndef portSETUP_TCB
349 #define portSETUP_TCB( pxTCB ) ( void ) pxTCB
352 #ifndef configQUEUE_REGISTRY_SIZE
353 #define configQUEUE_REGISTRY_SIZE 0U
356 #if ( configQUEUE_REGISTRY_SIZE < 1 )
357 #define vQueueAddToRegistry( xQueue, pcName )
358 #define vQueueUnregisterQueue( xQueue )
359 #define pcQueueGetName( xQueue )
362 #ifndef portPOINTER_SIZE_TYPE
363 #define portPOINTER_SIZE_TYPE uint32_t
366 /* Remove any unused trace macros. */
369 /* Used to perform any necessary initialisation - for example, open a file
370 * into which trace is to be written. */
376 /* Use to close a trace, for example close a file into which trace has been
381 #ifndef traceTASK_SWITCHED_IN
383 /* Called after a task has been selected to run. pxCurrentTCB holds a pointer
384 * to the task control block of the selected task. */
385 #define traceTASK_SWITCHED_IN()
388 #ifndef traceINCREASE_TICK_COUNT
390 /* Called before stepping the tick count after waking from tickless idle
392 #define traceINCREASE_TICK_COUNT( x )
395 #ifndef traceLOW_POWER_IDLE_BEGIN
396 /* Called immediately before entering tickless idle. */
397 #define traceLOW_POWER_IDLE_BEGIN()
400 #ifndef traceLOW_POWER_IDLE_END
401 /* Called when returning to the Idle task after a tickless idle. */
402 #define traceLOW_POWER_IDLE_END()
405 #ifndef traceTASK_SWITCHED_OUT
407 /* Called before a task has been selected to run. pxCurrentTCB holds a pointer
408 * to the task control block of the task being switched out. */
409 #define traceTASK_SWITCHED_OUT()
412 #ifndef traceTASK_PRIORITY_INHERIT
414 /* Called when a task attempts to take a mutex that is already held by a
415 * lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
416 * that holds the mutex. uxInheritedPriority is the priority the mutex holder
417 * will inherit (the priority of the task that is attempting to obtain the
419 #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
422 #ifndef traceTASK_PRIORITY_DISINHERIT
424 /* Called when a task releases a mutex, the holding of which had resulted in
425 * the task inheriting the priority of a higher priority task.
426 * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
427 * mutex. uxOriginalPriority is the task's configured (base) priority. */
428 #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
431 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
433 /* Task is about to block because it cannot read from a
434 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
435 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
436 * task that attempted the read. */
437 #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
440 #ifndef traceBLOCKING_ON_QUEUE_PEEK
442 /* Task is about to block because it cannot read from a
443 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
444 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
445 * task that attempted the read. */
446 #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )
449 #ifndef traceBLOCKING_ON_QUEUE_SEND
451 /* Task is about to block because it cannot write to a
452 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
453 * upon which the write was attempted. pxCurrentTCB points to the TCB of the
454 * task that attempted the write. */
455 #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
458 #ifndef configCHECK_FOR_STACK_OVERFLOW
459 #define configCHECK_FOR_STACK_OVERFLOW 0
462 #ifndef configRECORD_STACK_HIGH_ADDRESS
463 #define configRECORD_STACK_HIGH_ADDRESS 0
466 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H
467 #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0
470 /* The following event macros are embedded in the kernel API calls. */
472 #ifndef traceMOVED_TASK_TO_READY_STATE
473 #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
476 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE
477 #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
480 #ifndef traceQUEUE_CREATE
481 #define traceQUEUE_CREATE( pxNewQueue )
484 #ifndef traceQUEUE_CREATE_FAILED
485 #define traceQUEUE_CREATE_FAILED( ucQueueType )
488 #ifndef traceCREATE_MUTEX
489 #define traceCREATE_MUTEX( pxNewQueue )
492 #ifndef traceCREATE_MUTEX_FAILED
493 #define traceCREATE_MUTEX_FAILED()
496 #ifndef traceGIVE_MUTEX_RECURSIVE
497 #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
500 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
501 #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
504 #ifndef traceTAKE_MUTEX_RECURSIVE
505 #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
508 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
509 #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
512 #ifndef traceCREATE_COUNTING_SEMAPHORE
513 #define traceCREATE_COUNTING_SEMAPHORE()
516 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
517 #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
520 #ifndef traceQUEUE_SET_SEND
521 #define traceQUEUE_SET_SEND traceQUEUE_SEND
524 #ifndef traceQUEUE_SEND
525 #define traceQUEUE_SEND( pxQueue )
528 #ifndef traceQUEUE_SEND_FAILED
529 #define traceQUEUE_SEND_FAILED( pxQueue )
532 #ifndef traceQUEUE_RECEIVE
533 #define traceQUEUE_RECEIVE( pxQueue )
536 #ifndef traceQUEUE_PEEK
537 #define traceQUEUE_PEEK( pxQueue )
540 #ifndef traceQUEUE_PEEK_FAILED
541 #define traceQUEUE_PEEK_FAILED( pxQueue )
544 #ifndef traceQUEUE_PEEK_FROM_ISR
545 #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
548 #ifndef traceQUEUE_RECEIVE_FAILED
549 #define traceQUEUE_RECEIVE_FAILED( pxQueue )
552 #ifndef traceQUEUE_SEND_FROM_ISR
553 #define traceQUEUE_SEND_FROM_ISR( pxQueue )
556 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
557 #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
560 #ifndef traceQUEUE_RECEIVE_FROM_ISR
561 #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
564 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
565 #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
568 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
569 #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
572 #ifndef traceQUEUE_DELETE
573 #define traceQUEUE_DELETE( pxQueue )
576 #ifndef traceTASK_CREATE
577 #define traceTASK_CREATE( pxNewTCB )
580 #ifndef traceTASK_CREATE_FAILED
581 #define traceTASK_CREATE_FAILED()
584 #ifndef traceTASK_DELETE
585 #define traceTASK_DELETE( pxTaskToDelete )
588 #ifndef traceTASK_DELAY_UNTIL
589 #define traceTASK_DELAY_UNTIL( x )
592 #ifndef traceTASK_DELAY
593 #define traceTASK_DELAY()
596 #ifndef traceTASK_PRIORITY_SET
597 #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
600 #ifndef traceTASK_SUSPEND
601 #define traceTASK_SUSPEND( pxTaskToSuspend )
604 #ifndef traceTASK_RESUME
605 #define traceTASK_RESUME( pxTaskToResume )
608 #ifndef traceTASK_RESUME_FROM_ISR
609 #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
612 #ifndef traceTASK_INCREMENT_TICK
613 #define traceTASK_INCREMENT_TICK( xTickCount )
616 #ifndef traceTIMER_CREATE
617 #define traceTIMER_CREATE( pxNewTimer )
620 #ifndef traceTIMER_CREATE_FAILED
621 #define traceTIMER_CREATE_FAILED()
624 #ifndef traceTIMER_COMMAND_SEND
625 #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
628 #ifndef traceTIMER_EXPIRED
629 #define traceTIMER_EXPIRED( pxTimer )
632 #ifndef traceTIMER_COMMAND_RECEIVED
633 #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
637 #define traceMALLOC( pvAddress, uiSize )
641 #define traceFREE( pvAddress, uiSize )
644 #ifndef traceEVENT_GROUP_CREATE
645 #define traceEVENT_GROUP_CREATE( xEventGroup )
648 #ifndef traceEVENT_GROUP_CREATE_FAILED
649 #define traceEVENT_GROUP_CREATE_FAILED()
652 #ifndef traceEVENT_GROUP_SYNC_BLOCK
653 #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
656 #ifndef traceEVENT_GROUP_SYNC_END
657 #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
660 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
661 #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
664 #ifndef traceEVENT_GROUP_WAIT_BITS_END
665 #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
668 #ifndef traceEVENT_GROUP_CLEAR_BITS
669 #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
672 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
673 #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
676 #ifndef traceEVENT_GROUP_SET_BITS
677 #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
680 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
681 #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
684 #ifndef traceEVENT_GROUP_DELETE
685 #define traceEVENT_GROUP_DELETE( xEventGroup )
688 #ifndef tracePEND_FUNC_CALL
689 #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )
692 #ifndef tracePEND_FUNC_CALL_FROM_ISR
693 #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )
696 #ifndef traceQUEUE_REGISTRY_ADD
697 #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )
700 #ifndef traceTASK_NOTIFY_TAKE_BLOCK
701 #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )
704 #ifndef traceTASK_NOTIFY_TAKE
705 #define traceTASK_NOTIFY_TAKE( uxIndexToWait )
708 #ifndef traceTASK_NOTIFY_WAIT_BLOCK
709 #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )
712 #ifndef traceTASK_NOTIFY_WAIT
713 #define traceTASK_NOTIFY_WAIT( uxIndexToWait )
716 #ifndef traceTASK_NOTIFY
717 #define traceTASK_NOTIFY( uxIndexToNotify )
720 #ifndef traceTASK_NOTIFY_FROM_ISR
721 #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )
724 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
725 #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
728 #ifndef traceSTREAM_BUFFER_CREATE_FAILED
729 #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
732 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
733 #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )
736 #ifndef traceSTREAM_BUFFER_CREATE
737 #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )
740 #ifndef traceSTREAM_BUFFER_DELETE
741 #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )
744 #ifndef traceSTREAM_BUFFER_RESET
745 #define traceSTREAM_BUFFER_RESET( xStreamBuffer )
748 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND
749 #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )
752 #ifndef traceSTREAM_BUFFER_SEND
753 #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )
756 #ifndef traceSTREAM_BUFFER_SEND_FAILED
757 #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )
760 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR
761 #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )
764 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE
765 #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )
768 #ifndef traceSTREAM_BUFFER_RECEIVE
769 #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )
772 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED
773 #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )
776 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR
777 #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )
780 #ifndef configGENERATE_RUN_TIME_STATS
781 #define configGENERATE_RUN_TIME_STATS 0
784 #if ( configGENERATE_RUN_TIME_STATS == 1 )
786 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
787 #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.
788 #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
790 #ifndef portGET_RUN_TIME_COUNTER_VALUE
791 #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
792 #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.
793 #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
794 #endif /* portGET_RUN_TIME_COUNTER_VALUE */
796 #endif /* configGENERATE_RUN_TIME_STATS */
798 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
799 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
802 #ifndef configUSE_MALLOC_FAILED_HOOK
803 #define configUSE_MALLOC_FAILED_HOOK 0
806 #ifndef portPRIVILEGE_BIT
807 #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
810 #ifndef portSUPPRESS_TICKS_AND_SLEEP
811 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
814 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
815 #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
818 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
819 #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
822 #ifndef configUSE_TICKLESS_IDLE
823 #define configUSE_TICKLESS_IDLE 0
826 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
827 #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
830 #ifndef configPRE_SLEEP_PROCESSING
831 #define configPRE_SLEEP_PROCESSING( x )
834 #ifndef configPOST_SLEEP_PROCESSING
835 #define configPOST_SLEEP_PROCESSING( x )
838 #ifndef configUSE_QUEUE_SETS
839 #define configUSE_QUEUE_SETS 0
842 #ifndef portTASK_USES_FLOATING_POINT
843 #define portTASK_USES_FLOATING_POINT()
846 #ifndef portALLOCATE_SECURE_CONTEXT
847 #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
850 #ifndef portDONT_DISCARD
851 #define portDONT_DISCARD
854 #ifndef configUSE_TIME_SLICING
855 #define configUSE_TIME_SLICING 1
858 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
859 #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
862 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
863 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
866 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
867 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
870 #ifndef configUSE_TRACE_FACILITY
871 #define configUSE_TRACE_FACILITY 0
874 #ifndef mtCOVERAGE_TEST_MARKER
875 #define mtCOVERAGE_TEST_MARKER()
878 #ifndef mtCOVERAGE_TEST_DELAY
879 #define mtCOVERAGE_TEST_DELAY()
882 #ifndef portASSERT_IF_IN_ISR
883 #define portASSERT_IF_IN_ISR()
886 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
887 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
890 #ifndef configAPPLICATION_ALLOCATED_HEAP
891 #define configAPPLICATION_ALLOCATED_HEAP 0
894 #ifndef configUSE_TASK_NOTIFICATIONS
895 #define configUSE_TASK_NOTIFICATIONS 1
898 #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
899 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
902 #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
903 #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
906 #ifndef configUSE_POSIX_ERRNO
907 #define configUSE_POSIX_ERRNO 0
910 #ifndef portTICK_TYPE_IS_ATOMIC
911 #define portTICK_TYPE_IS_ATOMIC 0
914 #ifndef configSUPPORT_STATIC_ALLOCATION
915 /* Defaults to 0 for backward compatibility. */
916 #define configSUPPORT_STATIC_ALLOCATION 0
919 #ifndef configSUPPORT_DYNAMIC_ALLOCATION
920 /* Defaults to 1 for backward compatibility. */
921 #define configSUPPORT_DYNAMIC_ALLOCATION 1
924 #ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
925 /* Defaults to 0 for backward compatibility. */
926 #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
929 #ifndef configSTACK_DEPTH_TYPE
931 /* Defaults to uint16_t for backward compatibility, but can be overridden
932 * in FreeRTOSConfig.h if uint16_t is too restrictive. */
933 #define configSTACK_DEPTH_TYPE uint16_t
936 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE
938 /* Defaults to size_t for backward compatibility, but can be overridden
939 * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
941 #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
944 /* Sanity check the configuration. */
945 #if ( configUSE_TICKLESS_IDLE != 0 )
946 #if ( INCLUDE_vTaskSuspend != 1 )
947 #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
948 #endif /* INCLUDE_vTaskSuspend */
949 #endif /* configUSE_TICKLESS_IDLE */
951 #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
952 #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
955 #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
956 #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
959 #if( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configUSE_CORE_AFFINITY != 0 ) )
960 #error configRUN_MULTIPLE_PRIORITIES must be set to 1 to use core exclusion
963 #if( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
964 #error configRUN_MULTIPLE_PRIORITIES must be set to 1 to use task preemption disable
967 #if( ( configUSE_PREEMPTION == 0 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
968 #error configUSE_PREEMPTION must be set to 1 to use task preemption disable
971 #ifndef configINITIAL_TICK_COUNT
972 #define configINITIAL_TICK_COUNT 0
975 #if ( portTICK_TYPE_IS_ATOMIC == 0 )
977 /* Either variables of tick type cannot be read atomically, or
978 * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
979 * the tick count is returned to the standard critical section macros. */
980 #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
981 #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
982 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
983 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
986 /* The tick type can be read atomically, so critical sections used when the
987 * tick count is returned can be defined away. */
988 #define portTICK_TYPE_ENTER_CRITICAL()
989 #define portTICK_TYPE_EXIT_CRITICAL()
990 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
991 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x
992 #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */
994 /* Definitions to allow backward compatibility with FreeRTOS versions prior to
996 #ifndef configENABLE_BACKWARD_COMPATIBILITY
997 #define configENABLE_BACKWARD_COMPATIBILITY 1
1000 #ifndef configPRINTF
1002 /* configPRINTF() was not defined, so define it away to nothing. To use
1003 * configPRINTF() then define it as follows (where MyPrintFunction() is
1004 * provided by the application writer):
1006 * void MyPrintFunction(const char *pcFormat, ... );
1007 #define configPRINTF( X ) MyPrintFunction X
1009 * Then call like a standard printf() function, but placing brackets around
1010 * all parameters so they are passed as a single parameter. For example:
1011 * configPRINTF( ("Value = %d", MyVariable) ); */
1012 #define configPRINTF( X )
1017 /* The application writer has not provided their own MAX macro, so define
1018 * the following generic implementation. */
1019 #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
1024 /* The application writer has not provided their own MIN macro, so define
1025 * the following generic implementation. */
1026 #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
1029 #if configENABLE_BACKWARD_COMPATIBILITY == 1
1030 #define eTaskStateGet eTaskGetState
1031 #define portTickType TickType_t
1032 #define xTaskHandle TaskHandle_t
1033 #define xQueueHandle QueueHandle_t
1034 #define xSemaphoreHandle SemaphoreHandle_t
1035 #define xQueueSetHandle QueueSetHandle_t
1036 #define xQueueSetMemberHandle QueueSetMemberHandle_t
1037 #define xTimeOutType TimeOut_t
1038 #define xMemoryRegion MemoryRegion_t
1039 #define xTaskParameters TaskParameters_t
1040 #define xTaskStatusType TaskStatus_t
1041 #define xTimerHandle TimerHandle_t
1042 #define xCoRoutineHandle CoRoutineHandle_t
1043 #define pdTASK_HOOK_CODE TaskHookFunction_t
1044 #define portTICK_RATE_MS portTICK_PERIOD_MS
1045 #define pcTaskGetTaskName pcTaskGetName
1046 #define pcTimerGetTimerName pcTimerGetName
1047 #define pcQueueGetQueueName pcQueueGetName
1048 #define vTaskGetTaskInfo vTaskGetInfo
1049 #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
1051 /* Backward compatibility within the scheduler code only - these definitions
1052 * are not really required but are included for completeness. */
1053 #define tmrTIMER_CALLBACK TimerCallbackFunction_t
1054 #define pdTASK_CODE TaskFunction_t
1055 #define xListItem ListItem_t
1056 #define xList List_t
1058 /* For libraries that break the list data hiding, and access list structure
1059 * members directly (which is not supposed to be done). */
1060 #define pxContainer pvContainer
1061 #endif /* configENABLE_BACKWARD_COMPATIBILITY */
1063 #if ( configUSE_ALTERNATIVE_API != 0 )
1064 #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0
1067 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
1068 * if floating point hardware is otherwise supported by the FreeRTOS port in use.
1069 * This constant is not supported by all FreeRTOS ports that include floating
1071 #ifndef configUSE_TASK_FPU_SUPPORT
1072 #define configUSE_TASK_FPU_SUPPORT 1
1075 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is
1076 * currently used in ARMv8M ports. */
1077 #ifndef configENABLE_MPU
1078 #define configENABLE_MPU 0
1081 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is
1082 * currently used in ARMv8M ports. */
1083 #ifndef configENABLE_FPU
1084 #define configENABLE_FPU 1
1087 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
1088 * This is currently used in ARMv8M ports. */
1089 #ifndef configENABLE_TRUSTZONE
1090 #define configENABLE_TRUSTZONE 1
1093 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on
1094 * the Secure Side only. */
1095 #ifndef configRUN_FREERTOS_SECURE_ONLY
1096 #define configRUN_FREERTOS_SECURE_ONLY 0
1099 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
1100 * dynamically allocated RAM, in which case when any task is deleted it is known
1101 * that both the task's stack and TCB need to be freed. Sometimes the
1102 * FreeRTOSConfig.h settings only allow a task to be created using statically
1103 * allocated RAM, in which case when any task is deleted it is known that neither
1104 * the task's stack or TCB should be freed. Sometimes the FreeRTOSConfig.h
1105 * settings allow a task to be created using either statically or dynamically
1106 * allocated RAM, in which case a member of the TCB is used to record whether the
1107 * stack and/or TCB were allocated statically or dynamically, so when a task is
1108 * deleted the RAM that was allocated dynamically is freed again and no attempt is
1109 * made to free the RAM that was allocated statically.
1110 * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a
1111 * task to be created using either statically or dynamically allocated RAM. Note
1112 * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with
1113 * a statically allocated stack and a dynamically allocated TCB.
1115 * The following table lists various combinations of portUSING_MPU_WRAPPERS,
1116 * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and
1117 * when it is possible to have both static and dynamic allocation:
1118 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1119 * | MPU | Dynamic | Static | Available Functions | Possible Allocations | Both Dynamic and | Need Free |
1120 * | | | | | | Static Possible | |
1121 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1122 * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack - Static | No | No |
1123 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1124 * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack - Dynamic | No | Yes |
1125 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1126 * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1127 * | | | | xTaskCreateStatic | 2. TCB - Static, Stack - Static | | |
1128 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1129 * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack - Static | No | No |
1130 * | | | | xTaskCreateRestrictedStatic | | | |
1131 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1132 * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1133 * | | | | xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | |
1134 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1135 * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1136 * | | | | xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | |
1137 * | | | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | | |
1138 * | | | | xTaskCreateRestrictedStatic | | | |
1139 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1141 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE \
1142 ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \
1143 ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )
1146 * In line with software engineering best practice, FreeRTOS implements a strict
1147 * data hiding policy, so the real structures used by FreeRTOS to maintain the
1148 * state of tasks, queues, semaphores, etc. are not accessible to the application
1149 * code. However, if the application writer wants to statically allocate such
1150 * an object then the size of the object needs to be known. Dummy structures
1151 * that are guaranteed to have the same size and alignment requirements of the
1152 * real objects are used for this purpose. The dummy list and list item
1153 * structures below are used for inclusion in such a dummy structure.
1155 struct xSTATIC_LIST_ITEM
1157 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1161 void * pvDummy3[ 4 ];
1162 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1166 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
1168 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1169 struct xSTATIC_MINI_LIST_ITEM
1171 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1175 void * pvDummy3[ 2 ];
1177 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
1179 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1180 typedef struct xSTATIC_LIST
1182 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1185 UBaseType_t uxDummy2;
1187 StaticMiniListItem_t xDummy4;
1188 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1194 * In line with software engineering best practice, especially when supplying a
1195 * library that is likely to change in future versions, FreeRTOS implements a
1196 * strict data hiding policy. This means the Task structure used internally by
1197 * FreeRTOS is not accessible to application code. However, if the application
1198 * writer wants to statically allocate the memory required to create a task then
1199 * the size of the task object needs to be known. The StaticTask_t structure
1200 * below is provided for this purpose. Its sizes and alignment requirements are
1201 * guaranteed to match those of the genuine structure, no matter which
1202 * architecture is being used, and no matter how the values in FreeRTOSConfig.h
1203 * are set. Its contents are somewhat obfuscated in the hope users will
1204 * recognise that it would be unwise to make direct use of the structure members.
1206 typedef struct xSTATIC_TCB
1209 #if ( portUSING_MPU_WRAPPERS == 1 )
1210 xMPU_SETTINGS xDummy2;
1212 #if ( configUSE_CORE_AFFINITY == 1 && configNUM_CORES > 1 )
1213 UBaseType_t uxDummy25;
1215 StaticListItem_t xDummy3[ 2 ];
1216 UBaseType_t uxDummy5;
1218 BaseType_t xDummy23[ 2 ];
1219 uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
1220 #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
1221 BaseType_t xDummy24;
1223 #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
1226 #if ( portCRITICAL_NESTING_IN_TCB == 1 )
1227 UBaseType_t uxDummy9;
1229 #if ( configUSE_TRACE_FACILITY == 1 )
1230 UBaseType_t uxDummy10[ 2 ];
1232 #if ( configUSE_MUTEXES == 1 )
1233 UBaseType_t uxDummy12[ 2 ];
1235 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
1238 #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1239 void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
1241 #if ( configGENERATE_RUN_TIME_STATS == 1 )
1244 #if ( configUSE_NEWLIB_REENTRANT == 1 )
1245 struct _reent xDummy17;
1247 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
1248 uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
1249 uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
1251 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
1255 #if ( INCLUDE_xTaskAbortDelay == 1 )
1258 #if ( configUSE_POSIX_ERRNO == 1 )
1264 * In line with software engineering best practice, especially when supplying a
1265 * library that is likely to change in future versions, FreeRTOS implements a
1266 * strict data hiding policy. This means the Queue structure used internally by
1267 * FreeRTOS is not accessible to application code. However, if the application
1268 * writer wants to statically allocate the memory required to create a queue
1269 * then the size of the queue object needs to be known. The StaticQueue_t
1270 * structure below is provided for this purpose. Its sizes and alignment
1271 * requirements are guaranteed to match those of the genuine structure, no
1272 * matter which architecture is being used, and no matter how the values in
1273 * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope
1274 * users will recognise that it would be unwise to make direct use of the
1275 * structure members.
1277 typedef struct xSTATIC_QUEUE
1279 void * pvDummy1[ 3 ];
1284 UBaseType_t uxDummy2;
1287 StaticList_t xDummy3[ 2 ];
1288 UBaseType_t uxDummy4[ 3 ];
1289 uint8_t ucDummy5[ 2 ];
1291 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
1295 #if ( configUSE_QUEUE_SETS == 1 )
1299 #if ( configUSE_TRACE_FACILITY == 1 )
1300 UBaseType_t uxDummy8;
1304 typedef StaticQueue_t StaticSemaphore_t;
1307 * In line with software engineering best practice, especially when supplying a
1308 * library that is likely to change in future versions, FreeRTOS implements a
1309 * strict data hiding policy. This means the event group structure used
1310 * internally by FreeRTOS is not accessible to application code. However, if
1311 * the application writer wants to statically allocate the memory required to
1312 * create an event group then the size of the event group object needs to be
1313 * know. The StaticEventGroup_t structure below is provided for this purpose.
1314 * Its sizes and alignment requirements are guaranteed to match those of the
1315 * genuine structure, no matter which architecture is being used, and no matter
1316 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat
1317 * obfuscated in the hope users will recognise that it would be unwise to make
1318 * direct use of the structure members.
1320 typedef struct xSTATIC_EVENT_GROUP
1323 StaticList_t xDummy2;
1325 #if ( configUSE_TRACE_FACILITY == 1 )
1326 UBaseType_t uxDummy3;
1329 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
1332 } StaticEventGroup_t;
1335 * In line with software engineering best practice, especially when supplying a
1336 * library that is likely to change in future versions, FreeRTOS implements a
1337 * strict data hiding policy. This means the software timer structure used
1338 * internally by FreeRTOS is not accessible to application code. However, if
1339 * the application writer wants to statically allocate the memory required to
1340 * create a software timer then the size of the queue object needs to be known.
1341 * The StaticTimer_t structure below is provided for this purpose. Its sizes
1342 * and alignment requirements are guaranteed to match those of the genuine
1343 * structure, no matter which architecture is being used, and no matter how the
1344 * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in
1345 * the hope users will recognise that it would be unwise to make direct use of
1346 * the structure members.
1348 typedef struct xSTATIC_TIMER
1351 StaticListItem_t xDummy2;
1354 TaskFunction_t pvDummy6;
1355 #if ( configUSE_TRACE_FACILITY == 1 )
1356 UBaseType_t uxDummy7;
1362 * In line with software engineering best practice, especially when supplying a
1363 * library that is likely to change in future versions, FreeRTOS implements a
1364 * strict data hiding policy. This means the stream buffer structure used
1365 * internally by FreeRTOS is not accessible to application code. However, if
1366 * the application writer wants to statically allocate the memory required to
1367 * create a stream buffer then the size of the stream buffer object needs to be
1368 * known. The StaticStreamBuffer_t structure below is provided for this
1369 * purpose. Its size and alignment requirements are guaranteed to match those
1370 * of the genuine structure, no matter which architecture is being used, and
1371 * no matter how the values in FreeRTOSConfig.h are set. Its contents are
1372 * somewhat obfuscated in the hope users will recognise that it would be unwise
1373 * to make direct use of the structure members.
1375 typedef struct xSTATIC_STREAM_BUFFER
1377 size_t uxDummy1[ 4 ];
1378 void * pvDummy2[ 3 ];
1380 #if ( configUSE_TRACE_FACILITY == 1 )
1381 UBaseType_t uxDummy4;
1383 } StaticStreamBuffer_t;
1385 /* Message buffers are built on stream buffers. */
1386 typedef StaticStreamBuffer_t StaticMessageBuffer_t;
1394 #endif /* INC_FREERTOS_H */