2 * FreeRTOS Kernel <DEVELOPMENT BRANCH>
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: MIT
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:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
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.
24 * https://www.FreeRTOS.org
25 * https://github.com/FreeRTOS
29 #ifndef INC_FREERTOS_H
30 #define INC_FREERTOS_H
33 * Include the generic headers required for the FreeRTOS port being used.
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
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.
50 #include <stdint.h> /* READ COMMENT ABOVE. */
58 /* Application specific configuration options. */
59 #include "FreeRTOSConfig.h"
61 /* Basic FreeRTOS definitions. */
64 /* Definitions specific to the port being used. */
67 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */
68 #ifndef configUSE_NEWLIB_REENTRANT
69 #define configUSE_NEWLIB_REENTRANT 0
72 /* Required if struct _reent is used. */
73 #if ( configUSE_NEWLIB_REENTRANT == 1 )
75 /* Note Newlib support has been included by popular demand, but is not
76 * used by the FreeRTOS maintainers themselves. FreeRTOS is not
77 * responsible for resulting newlib operation. User must be familiar with
78 * newlib and must provide system-wide implementations of the necessary
79 * stubs. Be warned that (at the time of writing) the current newlib design
80 * implements a system-wide malloc() that must be provided with locks.
82 * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
83 * for additional information. */
86 #define configUSE_C_RUNTIME_TLS_SUPPORT 1
88 #ifndef configTLS_BLOCK_TYPE
89 #define configTLS_BLOCK_TYPE struct _reent
92 #ifndef configINIT_TLS_BLOCK
93 #define configINIT_TLS_BLOCK( xTLSBlock ) _REENT_INIT_PTR( &( xTLSBlock ) )
96 #ifndef configSET_TLS_BLOCK
97 #define configSET_TLS_BLOCK( xTLSBlock ) ( _impure_ptr = &( xTLSBlock ) )
100 #ifndef configDEINIT_TLS_BLOCK
101 #define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
103 #endif /* if ( configUSE_NEWLIB_REENTRANT == 1 ) */
105 #ifndef configUSE_C_RUNTIME_TLS_SUPPORT
106 #define configUSE_C_RUNTIME_TLS_SUPPORT 0
109 #if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
111 #ifndef configTLS_BLOCK_TYPE
112 #error Missing definition: configTLS_BLOCK_TYPE must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
115 #ifndef configINIT_TLS_BLOCK
116 #error Missing definition: configINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
119 #ifndef configSET_TLS_BLOCK
120 #error Missing definition: configSET_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
123 #ifndef configDEINIT_TLS_BLOCK
124 #error Missing definition: configDEINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
126 #endif /* if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) ) */
129 * Check all the required application specific macros have been defined.
130 * These macros are application specific and (as downloaded) are defined
131 * within FreeRTOSConfig.h.
134 #ifndef configMINIMAL_STACK_SIZE
135 #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.
138 #ifndef configMAX_PRIORITIES
139 #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
142 #if configMAX_PRIORITIES < 1
143 #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.
146 #ifndef configUSE_PREEMPTION
147 #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.
150 #ifndef configUSE_IDLE_HOOK
151 #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.
154 #ifndef configUSE_TICK_HOOK
155 #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.
158 #ifndef configUSE_16_BIT_TICKS
159 #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.
162 #ifndef INCLUDE_vTaskPrioritySet
163 #define INCLUDE_vTaskPrioritySet 0
166 #ifndef INCLUDE_uxTaskPriorityGet
167 #define INCLUDE_uxTaskPriorityGet 0
170 #ifndef INCLUDE_vTaskDelete
171 #define INCLUDE_vTaskDelete 0
174 #ifndef INCLUDE_vTaskSuspend
175 #define INCLUDE_vTaskSuspend 0
178 #ifdef INCLUDE_xTaskDelayUntil
179 #ifdef INCLUDE_vTaskDelayUntil
181 /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
182 * compatibility is maintained if only one or the other is defined, but
183 * there is a conflict if both are defined. */
184 #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed
188 #ifndef INCLUDE_xTaskDelayUntil
189 #ifdef INCLUDE_vTaskDelayUntil
191 /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
192 * the project's FreeRTOSConfig.h probably pre-dates the introduction of
193 * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
194 * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
196 #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
200 #ifndef INCLUDE_xTaskDelayUntil
201 #define INCLUDE_xTaskDelayUntil 0
204 #ifndef INCLUDE_vTaskDelay
205 #define INCLUDE_vTaskDelay 0
208 #ifndef INCLUDE_xTaskGetIdleTaskHandle
209 #define INCLUDE_xTaskGetIdleTaskHandle 0
212 #ifndef INCLUDE_xTaskAbortDelay
213 #define INCLUDE_xTaskAbortDelay 0
216 #ifndef INCLUDE_xQueueGetMutexHolder
217 #define INCLUDE_xQueueGetMutexHolder 0
220 #ifndef INCLUDE_xSemaphoreGetMutexHolder
221 #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
224 #ifndef INCLUDE_xTaskGetHandle
225 #define INCLUDE_xTaskGetHandle 0
228 #ifndef INCLUDE_uxTaskGetStackHighWaterMark
229 #define INCLUDE_uxTaskGetStackHighWaterMark 0
232 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2
233 #define INCLUDE_uxTaskGetStackHighWaterMark2 0
236 #ifndef INCLUDE_eTaskGetState
237 #define INCLUDE_eTaskGetState 0
240 #ifndef INCLUDE_xTaskResumeFromISR
241 #define INCLUDE_xTaskResumeFromISR 1
244 #ifndef INCLUDE_xTimerPendFunctionCall
245 #define INCLUDE_xTimerPendFunctionCall 0
248 #ifndef INCLUDE_xTaskGetSchedulerState
249 #define INCLUDE_xTaskGetSchedulerState 0
252 #ifndef INCLUDE_xTaskGetCurrentTaskHandle
253 #define INCLUDE_xTaskGetCurrentTaskHandle 1
256 #if ( defined( configUSE_CO_ROUTINES ) && configUSE_CO_ROUTINES != 0 )
257 #warning Co-routines have been removed from FreeRTOS-Kernel versions released after V10.5.1. You can view previous versions of the FreeRTOS Kernel at github.com/freertos/freertos-kernel/tree/V10.5.1 .
260 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
261 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
264 #ifndef configUSE_APPLICATION_TASK_TAG
265 #define configUSE_APPLICATION_TASK_TAG 0
268 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
269 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
272 #ifndef configUSE_RECURSIVE_MUTEXES
273 #define configUSE_RECURSIVE_MUTEXES 0
276 #ifndef configUSE_MUTEXES
277 #define configUSE_MUTEXES 0
280 #ifndef configUSE_TIMERS
281 #define configUSE_TIMERS 0
284 #ifndef configUSE_COUNTING_SEMAPHORES
285 #define configUSE_COUNTING_SEMAPHORES 0
288 #ifndef configUSE_ALTERNATIVE_API
289 #define configUSE_ALTERNATIVE_API 0
292 #ifndef portCRITICAL_NESTING_IN_TCB
293 #define portCRITICAL_NESTING_IN_TCB 0
296 #ifndef configMAX_TASK_NAME_LEN
297 #define configMAX_TASK_NAME_LEN 16
300 #ifndef configIDLE_SHOULD_YIELD
301 #define configIDLE_SHOULD_YIELD 1
304 #if configMAX_TASK_NAME_LEN < 1
305 #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
309 #define configASSERT( x )
310 #define configASSERT_DEFINED 0
312 #define configASSERT_DEFINED 1
315 /* configPRECONDITION should be defined as configASSERT.
316 * The CBMC proofs need a way to track assumptions and assertions.
317 * A configPRECONDITION statement should express an implicit invariant or
318 * assumption made. A configASSERT statement should express an invariant that must
319 * hold explicit before calling the code. */
320 #ifndef configPRECONDITION
321 #define configPRECONDITION( X ) configASSERT( X )
322 #define configPRECONDITION_DEFINED 0
324 #define configPRECONDITION_DEFINED 1
327 #ifndef portMEMORY_BARRIER
328 #define portMEMORY_BARRIER()
331 #ifndef portSOFTWARE_BARRIER
332 #define portSOFTWARE_BARRIER()
335 /* The timers module relies on xTaskGetSchedulerState(). */
336 #if configUSE_TIMERS == 1
338 #ifndef configTIMER_TASK_PRIORITY
339 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
340 #endif /* configTIMER_TASK_PRIORITY */
342 #ifndef configTIMER_QUEUE_LENGTH
343 #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
344 #endif /* configTIMER_QUEUE_LENGTH */
346 #ifndef configTIMER_TASK_STACK_DEPTH
347 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
348 #endif /* configTIMER_TASK_STACK_DEPTH */
350 #endif /* configUSE_TIMERS */
352 #ifndef portSET_INTERRUPT_MASK_FROM_ISR
353 #define portSET_INTERRUPT_MASK_FROM_ISR() 0
356 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
357 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) ( uxSavedStatusValue )
360 #ifndef portCLEAN_UP_TCB
361 #define portCLEAN_UP_TCB( pxTCB ) ( void ) ( pxTCB )
364 #ifndef portPRE_TASK_DELETE_HOOK
365 #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
368 #ifndef portSETUP_TCB
369 #define portSETUP_TCB( pxTCB ) ( void ) ( pxTCB )
372 #ifndef configQUEUE_REGISTRY_SIZE
373 #define configQUEUE_REGISTRY_SIZE 0U
376 #if ( configQUEUE_REGISTRY_SIZE < 1 )
377 #define vQueueAddToRegistry( xQueue, pcName )
378 #define vQueueUnregisterQueue( xQueue )
379 #define pcQueueGetName( xQueue )
382 #ifndef configUSE_MINI_LIST_ITEM
383 #define configUSE_MINI_LIST_ITEM 1
386 #ifndef portPOINTER_SIZE_TYPE
387 #define portPOINTER_SIZE_TYPE uint32_t
390 /* Remove any unused trace macros. */
393 /* Used to perform any necessary initialisation - for example, open a file
394 * into which trace is to be written. */
400 /* Use to close a trace, for example close a file into which trace has been
405 #ifndef traceTASK_SWITCHED_IN
407 /* Called after a task has been selected to run. pxCurrentTCB holds a pointer
408 * to the task control block of the selected task. */
409 #define traceTASK_SWITCHED_IN()
412 #ifndef traceINCREASE_TICK_COUNT
414 /* Called before stepping the tick count after waking from tickless idle
416 #define traceINCREASE_TICK_COUNT( x )
419 #ifndef traceLOW_POWER_IDLE_BEGIN
420 /* Called immediately before entering tickless idle. */
421 #define traceLOW_POWER_IDLE_BEGIN()
424 #ifndef traceLOW_POWER_IDLE_END
425 /* Called when returning to the Idle task after a tickless idle. */
426 #define traceLOW_POWER_IDLE_END()
429 #ifndef traceTASK_SWITCHED_OUT
431 /* Called before a task has been selected to run. pxCurrentTCB holds a pointer
432 * to the task control block of the task being switched out. */
433 #define traceTASK_SWITCHED_OUT()
436 #ifndef traceTASK_PRIORITY_INHERIT
438 /* Called when a task attempts to take a mutex that is already held by a
439 * lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
440 * that holds the mutex. uxInheritedPriority is the priority the mutex holder
441 * will inherit (the priority of the task that is attempting to obtain the
443 #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
446 #ifndef traceTASK_PRIORITY_DISINHERIT
448 /* Called when a task releases a mutex, the holding of which had resulted in
449 * the task inheriting the priority of a higher priority task.
450 * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
451 * mutex. uxOriginalPriority is the task's configured (base) priority. */
452 #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
455 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
457 /* Task is about to block because it cannot read from a
458 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
459 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
460 * task that attempted the read. */
461 #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
464 #ifndef traceBLOCKING_ON_QUEUE_PEEK
466 /* Task is about to block because it cannot read from a
467 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
468 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
469 * task that attempted the read. */
470 #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )
473 #ifndef traceBLOCKING_ON_QUEUE_SEND
475 /* Task is about to block because it cannot write to a
476 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
477 * upon which the write was attempted. pxCurrentTCB points to the TCB of the
478 * task that attempted the write. */
479 #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
482 #ifndef configCHECK_FOR_STACK_OVERFLOW
483 #define configCHECK_FOR_STACK_OVERFLOW 0
486 #ifndef configRECORD_STACK_HIGH_ADDRESS
487 #define configRECORD_STACK_HIGH_ADDRESS 0
490 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H
491 #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0
494 /* The following event macros are embedded in the kernel API calls. */
496 #ifndef traceMOVED_TASK_TO_READY_STATE
497 #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
500 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE
501 #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
504 #ifndef traceQUEUE_CREATE
505 #define traceQUEUE_CREATE( pxNewQueue )
508 #ifndef traceQUEUE_CREATE_FAILED
509 #define traceQUEUE_CREATE_FAILED( ucQueueType )
512 #ifndef traceCREATE_MUTEX
513 #define traceCREATE_MUTEX( pxNewQueue )
516 #ifndef traceCREATE_MUTEX_FAILED
517 #define traceCREATE_MUTEX_FAILED()
520 #ifndef traceGIVE_MUTEX_RECURSIVE
521 #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
524 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
525 #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
528 #ifndef traceTAKE_MUTEX_RECURSIVE
529 #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
532 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
533 #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
536 #ifndef traceCREATE_COUNTING_SEMAPHORE
537 #define traceCREATE_COUNTING_SEMAPHORE()
540 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
541 #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
544 #ifndef traceQUEUE_SET_SEND
545 #define traceQUEUE_SET_SEND traceQUEUE_SEND
548 #ifndef traceQUEUE_SEND
549 #define traceQUEUE_SEND( pxQueue )
552 #ifndef traceQUEUE_SEND_FAILED
553 #define traceQUEUE_SEND_FAILED( pxQueue )
556 #ifndef traceQUEUE_RECEIVE
557 #define traceQUEUE_RECEIVE( pxQueue )
560 #ifndef traceQUEUE_PEEK
561 #define traceQUEUE_PEEK( pxQueue )
564 #ifndef traceQUEUE_PEEK_FAILED
565 #define traceQUEUE_PEEK_FAILED( pxQueue )
568 #ifndef traceQUEUE_PEEK_FROM_ISR
569 #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
572 #ifndef traceQUEUE_RECEIVE_FAILED
573 #define traceQUEUE_RECEIVE_FAILED( pxQueue )
576 #ifndef traceQUEUE_SEND_FROM_ISR
577 #define traceQUEUE_SEND_FROM_ISR( pxQueue )
580 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
581 #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
584 #ifndef traceQUEUE_RECEIVE_FROM_ISR
585 #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
588 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
589 #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
592 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
593 #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
596 #ifndef traceQUEUE_DELETE
597 #define traceQUEUE_DELETE( pxQueue )
600 #ifndef traceTASK_CREATE
601 #define traceTASK_CREATE( pxNewTCB )
604 #ifndef traceTASK_CREATE_FAILED
605 #define traceTASK_CREATE_FAILED()
608 #ifndef traceTASK_DELETE
609 #define traceTASK_DELETE( pxTaskToDelete )
612 #ifndef traceTASK_DELAY_UNTIL
613 #define traceTASK_DELAY_UNTIL( x )
616 #ifndef traceTASK_DELAY
617 #define traceTASK_DELAY()
620 #ifndef traceTASK_PRIORITY_SET
621 #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
624 #ifndef traceTASK_SUSPEND
625 #define traceTASK_SUSPEND( pxTaskToSuspend )
628 #ifndef traceTASK_RESUME
629 #define traceTASK_RESUME( pxTaskToResume )
632 #ifndef traceTASK_RESUME_FROM_ISR
633 #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
636 #ifndef traceTASK_INCREMENT_TICK
637 #define traceTASK_INCREMENT_TICK( xTickCount )
640 #ifndef traceTIMER_CREATE
641 #define traceTIMER_CREATE( pxNewTimer )
644 #ifndef traceTIMER_CREATE_FAILED
645 #define traceTIMER_CREATE_FAILED()
648 #ifndef traceTIMER_COMMAND_SEND
649 #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
652 #ifndef traceTIMER_EXPIRED
653 #define traceTIMER_EXPIRED( pxTimer )
656 #ifndef traceTIMER_COMMAND_RECEIVED
657 #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
661 #define traceMALLOC( pvAddress, uiSize )
665 #define traceFREE( pvAddress, uiSize )
668 #ifndef traceEVENT_GROUP_CREATE
669 #define traceEVENT_GROUP_CREATE( xEventGroup )
672 #ifndef traceEVENT_GROUP_CREATE_FAILED
673 #define traceEVENT_GROUP_CREATE_FAILED()
676 #ifndef traceEVENT_GROUP_SYNC_BLOCK
677 #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
680 #ifndef traceEVENT_GROUP_SYNC_END
681 #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) ( xTimeoutOccurred )
684 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
685 #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
688 #ifndef traceEVENT_GROUP_WAIT_BITS_END
689 #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) ( xTimeoutOccurred )
692 #ifndef traceEVENT_GROUP_CLEAR_BITS
693 #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
696 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
697 #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
700 #ifndef traceEVENT_GROUP_SET_BITS
701 #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
704 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
705 #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
708 #ifndef traceEVENT_GROUP_DELETE
709 #define traceEVENT_GROUP_DELETE( xEventGroup )
712 #ifndef tracePEND_FUNC_CALL
713 #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )
716 #ifndef tracePEND_FUNC_CALL_FROM_ISR
717 #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )
720 #ifndef traceQUEUE_REGISTRY_ADD
721 #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )
724 #ifndef traceTASK_NOTIFY_TAKE_BLOCK
725 #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )
728 #ifndef traceTASK_NOTIFY_TAKE
729 #define traceTASK_NOTIFY_TAKE( uxIndexToWait )
732 #ifndef traceTASK_NOTIFY_WAIT_BLOCK
733 #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )
736 #ifndef traceTASK_NOTIFY_WAIT
737 #define traceTASK_NOTIFY_WAIT( uxIndexToWait )
740 #ifndef traceTASK_NOTIFY
741 #define traceTASK_NOTIFY( uxIndexToNotify )
744 #ifndef traceTASK_NOTIFY_FROM_ISR
745 #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )
748 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
749 #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
752 #ifndef traceSTREAM_BUFFER_CREATE_FAILED
753 #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
756 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
757 #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )
760 #ifndef traceSTREAM_BUFFER_CREATE
761 #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )
764 #ifndef traceSTREAM_BUFFER_DELETE
765 #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )
768 #ifndef traceSTREAM_BUFFER_RESET
769 #define traceSTREAM_BUFFER_RESET( xStreamBuffer )
772 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND
773 #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )
776 #ifndef traceSTREAM_BUFFER_SEND
777 #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )
780 #ifndef traceSTREAM_BUFFER_SEND_FAILED
781 #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )
784 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR
785 #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )
788 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE
789 #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )
792 #ifndef traceSTREAM_BUFFER_RECEIVE
793 #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )
796 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED
797 #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )
800 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR
801 #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )
804 #ifndef configGENERATE_RUN_TIME_STATS
805 #define configGENERATE_RUN_TIME_STATS 0
808 #if ( configGENERATE_RUN_TIME_STATS == 1 )
810 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
811 #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.
812 #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
814 #ifndef portGET_RUN_TIME_COUNTER_VALUE
815 #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
816 #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.
817 #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
818 #endif /* portGET_RUN_TIME_COUNTER_VALUE */
820 #endif /* configGENERATE_RUN_TIME_STATS */
822 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
823 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
826 #ifndef configUSE_MALLOC_FAILED_HOOK
827 #define configUSE_MALLOC_FAILED_HOOK 0
830 #ifndef portPRIVILEGE_BIT
831 #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
834 #ifndef portYIELD_WITHIN_API
835 #define portYIELD_WITHIN_API portYIELD
838 #ifndef portSUPPRESS_TICKS_AND_SLEEP
839 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
842 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
843 #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
846 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
847 #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
850 #ifndef configUSE_TICKLESS_IDLE
851 #define configUSE_TICKLESS_IDLE 0
854 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
855 #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
858 #ifndef configPRE_SLEEP_PROCESSING
859 #define configPRE_SLEEP_PROCESSING( x )
862 #ifndef configPOST_SLEEP_PROCESSING
863 #define configPOST_SLEEP_PROCESSING( x )
866 #ifndef configUSE_QUEUE_SETS
867 #define configUSE_QUEUE_SETS 0
870 #ifndef portTASK_USES_FLOATING_POINT
871 #define portTASK_USES_FLOATING_POINT()
874 #ifndef portALLOCATE_SECURE_CONTEXT
875 #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
878 #ifndef portDONT_DISCARD
879 #define portDONT_DISCARD
882 #ifndef configUSE_TIME_SLICING
883 #define configUSE_TIME_SLICING 1
886 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
887 #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
890 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
891 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
894 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
895 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
898 #ifndef configUSE_TRACE_FACILITY
899 #define configUSE_TRACE_FACILITY 0
902 #ifndef mtCOVERAGE_TEST_MARKER
903 #define mtCOVERAGE_TEST_MARKER()
906 #ifndef mtCOVERAGE_TEST_DELAY
907 #define mtCOVERAGE_TEST_DELAY()
910 #ifndef portASSERT_IF_IN_ISR
911 #define portASSERT_IF_IN_ISR()
914 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
915 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
918 #ifndef configAPPLICATION_ALLOCATED_HEAP
919 #define configAPPLICATION_ALLOCATED_HEAP 0
922 #ifndef configUSE_TASK_NOTIFICATIONS
923 #define configUSE_TASK_NOTIFICATIONS 1
926 #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
927 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
930 #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
931 #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
934 #ifndef configUSE_POSIX_ERRNO
935 #define configUSE_POSIX_ERRNO 0
938 #ifndef configUSE_SB_COMPLETED_CALLBACK
940 /* By default per-instance callbacks are not enabled for stream buffer or message buffer. */
941 #define configUSE_SB_COMPLETED_CALLBACK 0
944 #ifndef portTICK_TYPE_IS_ATOMIC
945 #define portTICK_TYPE_IS_ATOMIC 0
948 #ifndef configSUPPORT_STATIC_ALLOCATION
949 /* Defaults to 0 for backward compatibility. */
950 #define configSUPPORT_STATIC_ALLOCATION 0
953 #ifndef configSUPPORT_DYNAMIC_ALLOCATION
954 /* Defaults to 1 for backward compatibility. */
955 #define configSUPPORT_DYNAMIC_ALLOCATION 1
958 #if ( ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
959 #error configUSE_STATS_FORMATTING_FUNCTIONS cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
962 #if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
963 #if ( ( configUSE_TRACE_FACILITY != 1 ) && ( configGENERATE_RUN_TIME_STATS != 1 ) )
964 #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.
968 #ifndef configSTACK_DEPTH_TYPE
970 /* Defaults to uint16_t for backward compatibility, but can be overridden
971 * in FreeRTOSConfig.h if uint16_t is too restrictive. */
972 #define configSTACK_DEPTH_TYPE uint16_t
975 #ifndef configRUN_TIME_COUNTER_TYPE
977 /* Defaults to uint32_t for backward compatibility, but can be overridden in
978 * FreeRTOSConfig.h if uint32_t is too restrictive. */
980 #define configRUN_TIME_COUNTER_TYPE uint32_t
983 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE
985 /* Defaults to size_t for backward compatibility, but can be overridden
986 * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
988 #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
991 /* Sanity check the configuration. */
992 #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
993 #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
996 #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
997 #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
1000 #ifndef configINITIAL_TICK_COUNT
1001 #define configINITIAL_TICK_COUNT 0
1004 #if ( portTICK_TYPE_IS_ATOMIC == 0 )
1006 /* Either variables of tick type cannot be read atomically, or
1007 * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
1008 * the tick count is returned to the standard critical section macros. */
1009 #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
1010 #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
1011 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
1012 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
1015 /* The tick type can be read atomically, so critical sections used when the
1016 * tick count is returned can be defined away. */
1017 #define portTICK_TYPE_ENTER_CRITICAL()
1018 #define portTICK_TYPE_EXIT_CRITICAL()
1019 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
1020 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) ( x )
1021 #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */
1023 /* Definitions to allow backward compatibility with FreeRTOS versions prior to
1025 #ifndef configENABLE_BACKWARD_COMPATIBILITY
1026 #define configENABLE_BACKWARD_COMPATIBILITY 1
1029 #ifndef configPRINTF
1031 /* configPRINTF() was not defined, so define it away to nothing. To use
1032 * configPRINTF() then define it as follows (where MyPrintFunction() is
1033 * provided by the application writer):
1035 * void MyPrintFunction(const char *pcFormat, ... );
1036 #define configPRINTF( X ) MyPrintFunction X
1038 * Then call like a standard printf() function, but placing brackets around
1039 * all parameters so they are passed as a single parameter. For example:
1040 * configPRINTF( ("Value = %d", MyVariable) ); */
1041 #define configPRINTF( X )
1046 /* The application writer has not provided their own MAX macro, so define
1047 * the following generic implementation. */
1048 #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
1053 /* The application writer has not provided their own MIN macro, so define
1054 * the following generic implementation. */
1055 #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
1058 #if configENABLE_BACKWARD_COMPATIBILITY == 1
1059 #define eTaskStateGet eTaskGetState
1060 #define portTickType TickType_t
1061 #define xTaskHandle TaskHandle_t
1062 #define xQueueHandle QueueHandle_t
1063 #define xSemaphoreHandle SemaphoreHandle_t
1064 #define xQueueSetHandle QueueSetHandle_t
1065 #define xQueueSetMemberHandle QueueSetMemberHandle_t
1066 #define xTimeOutType TimeOut_t
1067 #define xMemoryRegion MemoryRegion_t
1068 #define xTaskParameters TaskParameters_t
1069 #define xTaskStatusType TaskStatus_t
1070 #define xTimerHandle TimerHandle_t
1071 #define pdTASK_HOOK_CODE TaskHookFunction_t
1072 #define portTICK_RATE_MS portTICK_PERIOD_MS
1073 #define pcTaskGetTaskName pcTaskGetName
1074 #define pcTimerGetTimerName pcTimerGetName
1075 #define pcQueueGetQueueName pcQueueGetName
1076 #define vTaskGetTaskInfo vTaskGetInfo
1077 #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
1079 /* Backward compatibility within the scheduler code only - these definitions
1080 * are not really required but are included for completeness. */
1081 #define tmrTIMER_CALLBACK TimerCallbackFunction_t
1082 #define pdTASK_CODE TaskFunction_t
1083 #define xListItem ListItem_t
1084 #define xList List_t
1086 /* For libraries that break the list data hiding, and access list structure
1087 * members directly (which is not supposed to be done). */
1088 #define pxContainer pvContainer
1089 #endif /* configENABLE_BACKWARD_COMPATIBILITY */
1091 #if ( configUSE_ALTERNATIVE_API != 0 )
1092 #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0
1095 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
1096 * if floating point hardware is otherwise supported by the FreeRTOS port in use.
1097 * This constant is not supported by all FreeRTOS ports that include floating
1099 #ifndef configUSE_TASK_FPU_SUPPORT
1100 #define configUSE_TASK_FPU_SUPPORT 1
1103 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is
1104 * currently used in ARMv8M ports. */
1105 #ifndef configENABLE_MPU
1106 #define configENABLE_MPU 0
1109 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is
1110 * currently used in ARMv8M ports. */
1111 #ifndef configENABLE_FPU
1112 #define configENABLE_FPU 1
1115 /* Set configENABLE_MVE to 1 to enable MVE support and 0 to disable it. This is
1116 * currently used in ARMv8M ports. */
1117 #ifndef configENABLE_MVE
1118 #define configENABLE_MVE 0
1121 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
1122 * This is currently used in ARMv8M ports. */
1123 #ifndef configENABLE_TRUSTZONE
1124 #define configENABLE_TRUSTZONE 1
1127 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on
1128 * the Secure Side only. */
1129 #ifndef configRUN_FREERTOS_SECURE_ONLY
1130 #define configRUN_FREERTOS_SECURE_ONLY 0
1133 #ifndef configRUN_ADDITIONAL_TESTS
1134 #define configRUN_ADDITIONAL_TESTS 0
1138 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
1139 * dynamically allocated RAM, in which case when any task is deleted it is known
1140 * that both the task's stack and TCB need to be freed. Sometimes the
1141 * FreeRTOSConfig.h settings only allow a task to be created using statically
1142 * allocated RAM, in which case when any task is deleted it is known that neither
1143 * the task's stack or TCB should be freed. Sometimes the FreeRTOSConfig.h
1144 * settings allow a task to be created using either statically or dynamically
1145 * allocated RAM, in which case a member of the TCB is used to record whether the
1146 * stack and/or TCB were allocated statically or dynamically, so when a task is
1147 * deleted the RAM that was allocated dynamically is freed again and no attempt is
1148 * made to free the RAM that was allocated statically.
1149 * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a
1150 * task to be created using either statically or dynamically allocated RAM. Note
1151 * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with
1152 * a statically allocated stack and a dynamically allocated TCB.
1154 * The following table lists various combinations of portUSING_MPU_WRAPPERS,
1155 * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and
1156 * when it is possible to have both static and dynamic allocation:
1157 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1158 * | MPU | Dynamic | Static | Available Functions | Possible Allocations | Both Dynamic and | Need Free |
1159 * | | | | | | Static Possible | |
1160 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1161 * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack - Static | No | No |
1162 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1163 * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack - Dynamic | No | Yes |
1164 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1165 * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1166 * | | | | xTaskCreateStatic | 2. TCB - Static, Stack - Static | | |
1167 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1168 * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack - Static | No | No |
1169 * | | | | xTaskCreateRestrictedStatic | | | |
1170 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1171 * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1172 * | | | | xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | |
1173 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1174 * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1175 * | | | | xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | |
1176 * | | | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | | |
1177 * | | | | xTaskCreateRestrictedStatic | | | |
1178 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1180 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE \
1181 ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \
1182 ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )
1185 * In line with software engineering best practice, FreeRTOS implements a strict
1186 * data hiding policy, so the real structures used by FreeRTOS to maintain the
1187 * state of tasks, queues, semaphores, etc. are not accessible to the application
1188 * code. However, if the application writer wants to statically allocate such
1189 * an object then the size of the object needs to be known. Dummy structures
1190 * that are guaranteed to have the same size and alignment requirements of the
1191 * real objects are used for this purpose. The dummy list and list item
1192 * structures below are used for inclusion in such a dummy structure.
1194 struct xSTATIC_LIST_ITEM
1196 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1200 void * pvDummy3[ 4 ];
1201 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1205 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
1207 #if ( configUSE_MINI_LIST_ITEM == 1 )
1208 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1209 struct xSTATIC_MINI_LIST_ITEM
1211 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1215 void * pvDummy3[ 2 ];
1217 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
1218 #else /* if ( configUSE_MINI_LIST_ITEM == 1 ) */
1219 typedef struct xSTATIC_LIST_ITEM StaticMiniListItem_t;
1220 #endif /* if ( configUSE_MINI_LIST_ITEM == 1 ) */
1222 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1223 typedef struct xSTATIC_LIST
1225 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1228 UBaseType_t uxDummy2;
1230 StaticMiniListItem_t xDummy4;
1231 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1237 * In line with software engineering best practice, especially when supplying a
1238 * library that is likely to change in future versions, FreeRTOS implements a
1239 * strict data hiding policy. This means the Task structure used internally by
1240 * FreeRTOS is not accessible to application code. However, if the application
1241 * writer wants to statically allocate the memory required to create a task then
1242 * the size of the task object needs to be known. The StaticTask_t structure
1243 * below is provided for this purpose. Its sizes and alignment requirements are
1244 * guaranteed to match those of the genuine structure, no matter which
1245 * architecture is being used, and no matter how the values in FreeRTOSConfig.h
1246 * are set. Its contents are somewhat obfuscated in the hope users will
1247 * recognise that it would be unwise to make direct use of the structure members.
1249 typedef struct xSTATIC_TCB
1252 #if ( portUSING_MPU_WRAPPERS == 1 )
1253 xMPU_SETTINGS xDummy2;
1255 StaticListItem_t xDummy3[ 2 ];
1256 UBaseType_t uxDummy5;
1258 uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
1259 #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
1262 #if ( portCRITICAL_NESTING_IN_TCB == 1 )
1263 UBaseType_t uxDummy9;
1265 #if ( configUSE_TRACE_FACILITY == 1 )
1266 UBaseType_t uxDummy10[ 2 ];
1268 #if ( configUSE_MUTEXES == 1 )
1269 UBaseType_t uxDummy12[ 2 ];
1271 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
1274 #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1275 void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
1277 #if ( configGENERATE_RUN_TIME_STATS == 1 )
1278 configRUN_TIME_COUNTER_TYPE ulDummy16;
1280 #if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
1281 configTLS_BLOCK_TYPE xDummy17;
1283 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
1284 uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
1285 uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
1287 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
1291 #if ( INCLUDE_xTaskAbortDelay == 1 )
1294 #if ( configUSE_POSIX_ERRNO == 1 )
1300 * In line with software engineering best practice, especially when supplying a
1301 * library that is likely to change in future versions, FreeRTOS implements a
1302 * strict data hiding policy. This means the Queue structure used internally by
1303 * FreeRTOS is not accessible to application code. However, if the application
1304 * writer wants to statically allocate the memory required to create a queue
1305 * then the size of the queue object needs to be known. The StaticQueue_t
1306 * structure below is provided for this purpose. Its sizes and alignment
1307 * requirements are guaranteed to match those of the genuine structure, no
1308 * matter which architecture is being used, and no matter how the values in
1309 * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope
1310 * users will recognise that it would be unwise to make direct use of the
1311 * structure members.
1313 typedef struct xSTATIC_QUEUE
1315 void * pvDummy1[ 3 ];
1320 UBaseType_t uxDummy2;
1323 StaticList_t xDummy3[ 2 ];
1324 UBaseType_t uxDummy4[ 3 ];
1325 uint8_t ucDummy5[ 2 ];
1327 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
1331 #if ( configUSE_QUEUE_SETS == 1 )
1335 #if ( configUSE_TRACE_FACILITY == 1 )
1336 UBaseType_t uxDummy8;
1340 typedef StaticQueue_t StaticSemaphore_t;
1343 * In line with software engineering best practice, especially when supplying a
1344 * library that is likely to change in future versions, FreeRTOS implements a
1345 * strict data hiding policy. This means the event group structure used
1346 * internally by FreeRTOS is not accessible to application code. However, if
1347 * the application writer wants to statically allocate the memory required to
1348 * create an event group then the size of the event group object needs to be
1349 * know. The StaticEventGroup_t structure below is provided for this purpose.
1350 * Its sizes and alignment requirements are guaranteed to match those of the
1351 * genuine structure, no matter which architecture is being used, and no matter
1352 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat
1353 * obfuscated in the hope users will recognise that it would be unwise to make
1354 * direct use of the structure members.
1356 typedef struct xSTATIC_EVENT_GROUP
1359 StaticList_t xDummy2;
1361 #if ( configUSE_TRACE_FACILITY == 1 )
1362 UBaseType_t uxDummy3;
1365 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
1368 } StaticEventGroup_t;
1371 * In line with software engineering best practice, especially when supplying a
1372 * library that is likely to change in future versions, FreeRTOS implements a
1373 * strict data hiding policy. This means the software timer structure used
1374 * internally by FreeRTOS is not accessible to application code. However, if
1375 * the application writer wants to statically allocate the memory required to
1376 * create a software timer then the size of the queue object needs to be known.
1377 * The StaticTimer_t structure below is provided for this purpose. Its sizes
1378 * and alignment requirements are guaranteed to match those of the genuine
1379 * structure, no matter which architecture is being used, and no matter how the
1380 * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in
1381 * the hope users will recognise that it would be unwise to make direct use of
1382 * the structure members.
1384 typedef struct xSTATIC_TIMER
1387 StaticListItem_t xDummy2;
1390 TaskFunction_t pvDummy6;
1391 #if ( configUSE_TRACE_FACILITY == 1 )
1392 UBaseType_t uxDummy7;
1398 * In line with software engineering best practice, especially when supplying a
1399 * library that is likely to change in future versions, FreeRTOS implements a
1400 * strict data hiding policy. This means the stream buffer structure used
1401 * internally by FreeRTOS is not accessible to application code. However, if
1402 * the application writer wants to statically allocate the memory required to
1403 * create a stream buffer then the size of the stream buffer object needs to be
1404 * known. The StaticStreamBuffer_t structure below is provided for this
1405 * purpose. Its size and alignment requirements are guaranteed to match those
1406 * of the genuine structure, no matter which architecture is being used, and
1407 * no matter how the values in FreeRTOSConfig.h are set. Its contents are
1408 * somewhat obfuscated in the hope users will recognise that it would be unwise
1409 * to make direct use of the structure members.
1411 typedef struct xSTATIC_STREAM_BUFFER
1413 size_t uxDummy1[ 4 ];
1414 void * pvDummy2[ 3 ];
1416 #if ( configUSE_TRACE_FACILITY == 1 )
1417 UBaseType_t uxDummy4;
1419 #if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
1420 void * pvDummy5[ 2 ];
1422 } StaticStreamBuffer_t;
1424 /* Message buffers are built on stream buffers. */
1425 typedef StaticStreamBuffer_t StaticMessageBuffer_t;
1433 #endif /* INC_FREERTOS_H */