2 * FreeRTOS Kernel V10.4.3
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 )
76 * Check all the required application specific macros have been defined.
77 * These macros are application specific and (as downloaded) are defined
78 * within FreeRTOSConfig.h.
81 #ifndef configMINIMAL_STACK_SIZE
82 #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.
85 #ifndef configMAX_PRIORITIES
86 #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
89 #if configMAX_PRIORITIES < 1
90 #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.
93 #ifndef configUSE_PREEMPTION
94 #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.
97 #ifndef configUSE_IDLE_HOOK
98 #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.
101 #ifndef configUSE_TICK_HOOK
102 #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.
105 #ifndef configUSE_16_BIT_TICKS
106 #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.
109 #ifndef configUSE_CO_ROUTINES
110 #define configUSE_CO_ROUTINES 0
113 #ifndef INCLUDE_vTaskPrioritySet
114 #define INCLUDE_vTaskPrioritySet 0
117 #ifndef INCLUDE_uxTaskPriorityGet
118 #define INCLUDE_uxTaskPriorityGet 0
121 #ifndef INCLUDE_vTaskDelete
122 #define INCLUDE_vTaskDelete 0
125 #ifndef INCLUDE_vTaskSuspend
126 #define INCLUDE_vTaskSuspend 0
129 #ifdef INCLUDE_xTaskDelayUntil
130 #ifdef INCLUDE_vTaskDelayUntil
131 /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
132 * compatibility is maintained if only one or the other is defined, but
133 * there is a conflict if both are defined. */
134 #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed
138 #ifndef INCLUDE_xTaskDelayUntil
139 #ifdef INCLUDE_vTaskDelayUntil
140 /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
141 * the project's FreeRTOSConfig.h probably pre-dates the introduction of
142 * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
143 * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
145 #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
149 #ifndef INCLUDE_xTaskDelayUntil
150 #define INCLUDE_xTaskDelayUntil 0
153 #ifndef INCLUDE_vTaskDelay
154 #define INCLUDE_vTaskDelay 0
157 #ifndef INCLUDE_xTaskGetIdleTaskHandle
158 #define INCLUDE_xTaskGetIdleTaskHandle 0
161 #ifndef INCLUDE_xTaskAbortDelay
162 #define INCLUDE_xTaskAbortDelay 0
165 #ifndef INCLUDE_xQueueGetMutexHolder
166 #define INCLUDE_xQueueGetMutexHolder 0
169 #ifndef INCLUDE_xSemaphoreGetMutexHolder
170 #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
173 #ifndef INCLUDE_xTaskGetHandle
174 #define INCLUDE_xTaskGetHandle 0
177 #ifndef INCLUDE_uxTaskGetStackHighWaterMark
178 #define INCLUDE_uxTaskGetStackHighWaterMark 0
181 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2
182 #define INCLUDE_uxTaskGetStackHighWaterMark2 0
185 #ifndef INCLUDE_eTaskGetState
186 #define INCLUDE_eTaskGetState 0
189 #ifndef INCLUDE_xTaskResumeFromISR
190 #define INCLUDE_xTaskResumeFromISR 1
193 #ifndef INCLUDE_xTimerPendFunctionCall
194 #define INCLUDE_xTimerPendFunctionCall 0
197 #ifndef INCLUDE_xTaskGetSchedulerState
198 #define INCLUDE_xTaskGetSchedulerState 0
201 #ifndef INCLUDE_xTaskGetCurrentTaskHandle
202 #define INCLUDE_xTaskGetCurrentTaskHandle 0
205 #if configUSE_CO_ROUTINES != 0
206 #ifndef configMAX_CO_ROUTINE_PRIORITIES
207 #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.
211 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
212 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
215 #ifndef configUSE_APPLICATION_TASK_TAG
216 #define configUSE_APPLICATION_TASK_TAG 0
219 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
220 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
223 #ifndef configUSE_RECURSIVE_MUTEXES
224 #define configUSE_RECURSIVE_MUTEXES 0
227 #ifndef configUSE_MUTEXES
228 #define configUSE_MUTEXES 0
231 #ifndef configUSE_TIMERS
232 #define configUSE_TIMERS 0
235 #ifndef configUSE_COUNTING_SEMAPHORES
236 #define configUSE_COUNTING_SEMAPHORES 0
239 #ifndef configUSE_ALTERNATIVE_API
240 #define configUSE_ALTERNATIVE_API 0
243 #ifndef portCRITICAL_NESTING_IN_TCB
244 #define portCRITICAL_NESTING_IN_TCB 0
247 #ifndef configMAX_TASK_NAME_LEN
248 #define configMAX_TASK_NAME_LEN 16
251 #ifndef configIDLE_SHOULD_YIELD
252 #define configIDLE_SHOULD_YIELD 1
255 #if configMAX_TASK_NAME_LEN < 1
256 #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
260 #define configASSERT( x )
261 #define configASSERT_DEFINED 0
263 #define configASSERT_DEFINED 1
266 /* configPRECONDITION should be defined as configASSERT.
267 * The CBMC proofs need a way to track assumptions and assertions.
268 * A configPRECONDITION statement should express an implicit invariant or
269 * assumption made. A configASSERT statement should express an invariant that must
270 * hold explicit before calling the code. */
271 #ifndef configPRECONDITION
272 #define configPRECONDITION( X ) configASSERT( X )
273 #define configPRECONDITION_DEFINED 0
275 #define configPRECONDITION_DEFINED 1
278 #ifndef portMEMORY_BARRIER
279 #define portMEMORY_BARRIER()
282 #ifndef portSOFTWARE_BARRIER
283 #define portSOFTWARE_BARRIER()
286 /* The timers module relies on xTaskGetSchedulerState(). */
287 #if configUSE_TIMERS == 1
289 #ifndef configTIMER_TASK_PRIORITY
290 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
291 #endif /* configTIMER_TASK_PRIORITY */
293 #ifndef configTIMER_QUEUE_LENGTH
294 #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
295 #endif /* configTIMER_QUEUE_LENGTH */
297 #ifndef configTIMER_TASK_STACK_DEPTH
298 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
299 #endif /* configTIMER_TASK_STACK_DEPTH */
301 #endif /* configUSE_TIMERS */
303 #ifndef portSET_INTERRUPT_MASK_FROM_ISR
304 #define portSET_INTERRUPT_MASK_FROM_ISR() 0
307 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
308 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
311 #ifndef portCLEAN_UP_TCB
312 #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
315 #ifndef portPRE_TASK_DELETE_HOOK
316 #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
319 #ifndef portSETUP_TCB
320 #define portSETUP_TCB( pxTCB ) ( void ) pxTCB
323 #ifndef configQUEUE_REGISTRY_SIZE
324 #define configQUEUE_REGISTRY_SIZE 0U
327 #if ( configQUEUE_REGISTRY_SIZE < 1 )
328 #define vQueueAddToRegistry( xQueue, pcName )
329 #define vQueueUnregisterQueue( xQueue )
330 #define pcQueueGetName( xQueue )
333 #ifndef portPOINTER_SIZE_TYPE
334 #define portPOINTER_SIZE_TYPE uint32_t
337 /* Remove any unused trace macros. */
340 /* Used to perform any necessary initialisation - for example, open a file
341 * into which trace is to be written. */
347 /* Use to close a trace, for example close a file into which trace has been
352 #ifndef traceTASK_SWITCHED_IN
354 /* Called after a task has been selected to run. pxCurrentTCB holds a pointer
355 * to the task control block of the selected task. */
356 #define traceTASK_SWITCHED_IN()
359 #ifndef traceINCREASE_TICK_COUNT
361 /* Called before stepping the tick count after waking from tickless idle
363 #define traceINCREASE_TICK_COUNT( x )
366 #ifndef traceLOW_POWER_IDLE_BEGIN
367 /* Called immediately before entering tickless idle. */
368 #define traceLOW_POWER_IDLE_BEGIN()
371 #ifndef traceLOW_POWER_IDLE_END
372 /* Called when returning to the Idle task after a tickless idle. */
373 #define traceLOW_POWER_IDLE_END()
376 #ifndef traceTASK_SWITCHED_OUT
378 /* Called before a task has been selected to run. pxCurrentTCB holds a pointer
379 * to the task control block of the task being switched out. */
380 #define traceTASK_SWITCHED_OUT()
383 #ifndef traceTASK_PRIORITY_INHERIT
385 /* Called when a task attempts to take a mutex that is already held by a
386 * lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
387 * that holds the mutex. uxInheritedPriority is the priority the mutex holder
388 * will inherit (the priority of the task that is attempting to obtain the
390 #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
393 #ifndef traceTASK_PRIORITY_DISINHERIT
395 /* Called when a task releases a mutex, the holding of which had resulted in
396 * the task inheriting the priority of a higher priority task.
397 * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
398 * mutex. uxOriginalPriority is the task's configured (base) priority. */
399 #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
402 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
404 /* Task is about to block because it cannot read from a
405 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
406 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
407 * task that attempted the read. */
408 #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
411 #ifndef traceBLOCKING_ON_QUEUE_PEEK
413 /* Task is about to block because it cannot read from a
414 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
415 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
416 * task that attempted the read. */
417 #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )
420 #ifndef traceBLOCKING_ON_QUEUE_SEND
422 /* Task is about to block because it cannot write to a
423 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
424 * upon which the write was attempted. pxCurrentTCB points to the TCB of the
425 * task that attempted the write. */
426 #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
429 #ifndef configCHECK_FOR_STACK_OVERFLOW
430 #define configCHECK_FOR_STACK_OVERFLOW 0
433 #ifndef configRECORD_STACK_HIGH_ADDRESS
434 #define configRECORD_STACK_HIGH_ADDRESS 0
437 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H
438 #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0
441 /* The following event macros are embedded in the kernel API calls. */
443 #ifndef traceMOVED_TASK_TO_READY_STATE
444 #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
447 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE
448 #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
451 #ifndef traceQUEUE_CREATE
452 #define traceQUEUE_CREATE( pxNewQueue )
455 #ifndef traceQUEUE_CREATE_FAILED
456 #define traceQUEUE_CREATE_FAILED( ucQueueType )
459 #ifndef traceCREATE_MUTEX
460 #define traceCREATE_MUTEX( pxNewQueue )
463 #ifndef traceCREATE_MUTEX_FAILED
464 #define traceCREATE_MUTEX_FAILED()
467 #ifndef traceGIVE_MUTEX_RECURSIVE
468 #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
471 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
472 #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
475 #ifndef traceTAKE_MUTEX_RECURSIVE
476 #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
479 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
480 #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
483 #ifndef traceCREATE_COUNTING_SEMAPHORE
484 #define traceCREATE_COUNTING_SEMAPHORE()
487 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
488 #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
491 #ifndef traceQUEUE_SET_SEND
492 #define traceQUEUE_SET_SEND traceQUEUE_SEND
495 #ifndef traceQUEUE_SEND
496 #define traceQUEUE_SEND( pxQueue )
499 #ifndef traceQUEUE_SEND_FAILED
500 #define traceQUEUE_SEND_FAILED( pxQueue )
503 #ifndef traceQUEUE_RECEIVE
504 #define traceQUEUE_RECEIVE( pxQueue )
507 #ifndef traceQUEUE_PEEK
508 #define traceQUEUE_PEEK( pxQueue )
511 #ifndef traceQUEUE_PEEK_FAILED
512 #define traceQUEUE_PEEK_FAILED( pxQueue )
515 #ifndef traceQUEUE_PEEK_FROM_ISR
516 #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
519 #ifndef traceQUEUE_RECEIVE_FAILED
520 #define traceQUEUE_RECEIVE_FAILED( pxQueue )
523 #ifndef traceQUEUE_SEND_FROM_ISR
524 #define traceQUEUE_SEND_FROM_ISR( pxQueue )
527 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
528 #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
531 #ifndef traceQUEUE_RECEIVE_FROM_ISR
532 #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
535 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
536 #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
539 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
540 #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
543 #ifndef traceQUEUE_DELETE
544 #define traceQUEUE_DELETE( pxQueue )
547 #ifndef traceTASK_CREATE
548 #define traceTASK_CREATE( pxNewTCB )
551 #ifndef traceTASK_CREATE_FAILED
552 #define traceTASK_CREATE_FAILED()
555 #ifndef traceTASK_DELETE
556 #define traceTASK_DELETE( pxTaskToDelete )
559 #ifndef traceTASK_DELAY_UNTIL
560 #define traceTASK_DELAY_UNTIL( x )
563 #ifndef traceTASK_DELAY
564 #define traceTASK_DELAY()
567 #ifndef traceTASK_PRIORITY_SET
568 #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
571 #ifndef traceTASK_SUSPEND
572 #define traceTASK_SUSPEND( pxTaskToSuspend )
575 #ifndef traceTASK_RESUME
576 #define traceTASK_RESUME( pxTaskToResume )
579 #ifndef traceTASK_RESUME_FROM_ISR
580 #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
583 #ifndef traceTASK_INCREMENT_TICK
584 #define traceTASK_INCREMENT_TICK( xTickCount )
587 #ifndef traceTIMER_CREATE
588 #define traceTIMER_CREATE( pxNewTimer )
591 #ifndef traceTIMER_CREATE_FAILED
592 #define traceTIMER_CREATE_FAILED()
595 #ifndef traceTIMER_COMMAND_SEND
596 #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
599 #ifndef traceTIMER_EXPIRED
600 #define traceTIMER_EXPIRED( pxTimer )
603 #ifndef traceTIMER_COMMAND_RECEIVED
604 #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
608 #define traceMALLOC( pvAddress, uiSize )
612 #define traceFREE( pvAddress, uiSize )
615 #ifndef traceEVENT_GROUP_CREATE
616 #define traceEVENT_GROUP_CREATE( xEventGroup )
619 #ifndef traceEVENT_GROUP_CREATE_FAILED
620 #define traceEVENT_GROUP_CREATE_FAILED()
623 #ifndef traceEVENT_GROUP_SYNC_BLOCK
624 #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
627 #ifndef traceEVENT_GROUP_SYNC_END
628 #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
631 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
632 #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
635 #ifndef traceEVENT_GROUP_WAIT_BITS_END
636 #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
639 #ifndef traceEVENT_GROUP_CLEAR_BITS
640 #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
643 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
644 #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
647 #ifndef traceEVENT_GROUP_SET_BITS
648 #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
651 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
652 #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
655 #ifndef traceEVENT_GROUP_DELETE
656 #define traceEVENT_GROUP_DELETE( xEventGroup )
659 #ifndef tracePEND_FUNC_CALL
660 #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )
663 #ifndef tracePEND_FUNC_CALL_FROM_ISR
664 #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )
667 #ifndef traceQUEUE_REGISTRY_ADD
668 #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )
671 #ifndef traceTASK_NOTIFY_TAKE_BLOCK
672 #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )
675 #ifndef traceTASK_NOTIFY_TAKE
676 #define traceTASK_NOTIFY_TAKE( uxIndexToWait )
679 #ifndef traceTASK_NOTIFY_WAIT_BLOCK
680 #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )
683 #ifndef traceTASK_NOTIFY_WAIT
684 #define traceTASK_NOTIFY_WAIT( uxIndexToWait )
687 #ifndef traceTASK_NOTIFY
688 #define traceTASK_NOTIFY( uxIndexToNotify )
691 #ifndef traceTASK_NOTIFY_FROM_ISR
692 #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )
695 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
696 #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
699 #ifndef traceSTREAM_BUFFER_CREATE_FAILED
700 #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
703 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
704 #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )
707 #ifndef traceSTREAM_BUFFER_CREATE
708 #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )
711 #ifndef traceSTREAM_BUFFER_DELETE
712 #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )
715 #ifndef traceSTREAM_BUFFER_RESET
716 #define traceSTREAM_BUFFER_RESET( xStreamBuffer )
719 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND
720 #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )
723 #ifndef traceSTREAM_BUFFER_SEND
724 #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )
727 #ifndef traceSTREAM_BUFFER_SEND_FAILED
728 #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )
731 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR
732 #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )
735 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE
736 #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )
739 #ifndef traceSTREAM_BUFFER_RECEIVE
740 #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )
743 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED
744 #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )
747 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR
748 #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )
751 #ifndef configGENERATE_RUN_TIME_STATS
752 #define configGENERATE_RUN_TIME_STATS 0
755 #if ( configGENERATE_RUN_TIME_STATS == 1 )
757 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
758 #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.
759 #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
761 #ifndef portGET_RUN_TIME_COUNTER_VALUE
762 #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
763 #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.
764 #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
765 #endif /* portGET_RUN_TIME_COUNTER_VALUE */
767 #endif /* configGENERATE_RUN_TIME_STATS */
769 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
770 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
773 #ifndef configUSE_MALLOC_FAILED_HOOK
774 #define configUSE_MALLOC_FAILED_HOOK 0
777 #ifndef portPRIVILEGE_BIT
778 #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
781 #ifndef portYIELD_WITHIN_API
782 #define portYIELD_WITHIN_API portYIELD
785 #ifndef portSUPPRESS_TICKS_AND_SLEEP
786 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
789 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
790 #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
793 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
794 #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
797 #ifndef configUSE_TICKLESS_IDLE
798 #define configUSE_TICKLESS_IDLE 0
801 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
802 #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
805 #ifndef configPRE_SLEEP_PROCESSING
806 #define configPRE_SLEEP_PROCESSING( x )
809 #ifndef configPOST_SLEEP_PROCESSING
810 #define configPOST_SLEEP_PROCESSING( x )
813 #ifndef configUSE_QUEUE_SETS
814 #define configUSE_QUEUE_SETS 0
817 #ifndef portTASK_USES_FLOATING_POINT
818 #define portTASK_USES_FLOATING_POINT()
821 #ifndef portALLOCATE_SECURE_CONTEXT
822 #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
825 #ifndef portDONT_DISCARD
826 #define portDONT_DISCARD
829 #ifndef configUSE_TIME_SLICING
830 #define configUSE_TIME_SLICING 1
833 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
834 #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
837 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
838 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
841 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
842 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
845 #ifndef configUSE_TRACE_FACILITY
846 #define configUSE_TRACE_FACILITY 0
849 #ifndef mtCOVERAGE_TEST_MARKER
850 #define mtCOVERAGE_TEST_MARKER()
853 #ifndef mtCOVERAGE_TEST_DELAY
854 #define mtCOVERAGE_TEST_DELAY()
857 #ifndef portASSERT_IF_IN_ISR
858 #define portASSERT_IF_IN_ISR()
861 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
862 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
865 #ifndef configAPPLICATION_ALLOCATED_HEAP
866 #define configAPPLICATION_ALLOCATED_HEAP 0
869 #ifndef configUSE_TASK_NOTIFICATIONS
870 #define configUSE_TASK_NOTIFICATIONS 1
873 #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
874 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
877 #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
878 #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
881 #ifndef configUSE_POSIX_ERRNO
882 #define configUSE_POSIX_ERRNO 0
885 #ifndef portTICK_TYPE_IS_ATOMIC
886 #define portTICK_TYPE_IS_ATOMIC 0
889 #ifndef configSUPPORT_STATIC_ALLOCATION
890 /* Defaults to 0 for backward compatibility. */
891 #define configSUPPORT_STATIC_ALLOCATION 0
894 #ifndef configSUPPORT_DYNAMIC_ALLOCATION
895 /* Defaults to 1 for backward compatibility. */
896 #define configSUPPORT_DYNAMIC_ALLOCATION 1
899 #ifndef configSTACK_DEPTH_TYPE
901 /* Defaults to uint16_t for backward compatibility, but can be overridden
902 * in FreeRTOSConfig.h if uint16_t is too restrictive. */
903 #define configSTACK_DEPTH_TYPE uint16_t
906 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE
908 /* Defaults to size_t for backward compatibility, but can be overridden
909 * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
911 #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
914 /* Sanity check the configuration. */
915 #if ( configUSE_TICKLESS_IDLE != 0 )
916 #if ( INCLUDE_vTaskSuspend != 1 )
917 #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
918 #endif /* INCLUDE_vTaskSuspend */
919 #endif /* configUSE_TICKLESS_IDLE */
921 #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
922 #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
925 #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
926 #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
929 #ifndef configINITIAL_TICK_COUNT
930 #define configINITIAL_TICK_COUNT 0
933 #if ( portTICK_TYPE_IS_ATOMIC == 0 )
935 /* Either variables of tick type cannot be read atomically, or
936 * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
937 * the tick count is returned to the standard critical section macros. */
938 #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
939 #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
940 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
941 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
944 /* The tick type can be read atomically, so critical sections used when the
945 * tick count is returned can be defined away. */
946 #define portTICK_TYPE_ENTER_CRITICAL()
947 #define portTICK_TYPE_EXIT_CRITICAL()
948 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
949 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x
950 #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */
952 /* Definitions to allow backward compatibility with FreeRTOS versions prior to
954 #ifndef configENABLE_BACKWARD_COMPATIBILITY
955 #define configENABLE_BACKWARD_COMPATIBILITY 1
960 /* configPRINTF() was not defined, so define it away to nothing. To use
961 * configPRINTF() then define it as follows (where MyPrintFunction() is
962 * provided by the application writer):
964 * void MyPrintFunction(const char *pcFormat, ... );
965 #define configPRINTF( X ) MyPrintFunction X
967 * Then call like a standard printf() function, but placing brackets around
968 * all parameters so they are passed as a single parameter. For example:
969 * configPRINTF( ("Value = %d", MyVariable) ); */
970 #define configPRINTF( X )
975 /* The application writer has not provided their own MAX macro, so define
976 * the following generic implementation. */
977 #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
982 /* The application writer has not provided their own MAX macro, so define
983 * the following generic implementation. */
984 #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
987 #if configENABLE_BACKWARD_COMPATIBILITY == 1
988 #define eTaskStateGet eTaskGetState
989 #define portTickType TickType_t
990 #define xTaskHandle TaskHandle_t
991 #define xQueueHandle QueueHandle_t
992 #define xSemaphoreHandle SemaphoreHandle_t
993 #define xQueueSetHandle QueueSetHandle_t
994 #define xQueueSetMemberHandle QueueSetMemberHandle_t
995 #define xTimeOutType TimeOut_t
996 #define xMemoryRegion MemoryRegion_t
997 #define xTaskParameters TaskParameters_t
998 #define xTaskStatusType TaskStatus_t
999 #define xTimerHandle TimerHandle_t
1000 #define xCoRoutineHandle CoRoutineHandle_t
1001 #define pdTASK_HOOK_CODE TaskHookFunction_t
1002 #define portTICK_RATE_MS portTICK_PERIOD_MS
1003 #define pcTaskGetTaskName pcTaskGetName
1004 #define pcTimerGetTimerName pcTimerGetName
1005 #define pcQueueGetQueueName pcQueueGetName
1006 #define vTaskGetTaskInfo vTaskGetInfo
1007 #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
1009 /* Backward compatibility within the scheduler code only - these definitions
1010 * are not really required but are included for completeness. */
1011 #define tmrTIMER_CALLBACK TimerCallbackFunction_t
1012 #define pdTASK_CODE TaskFunction_t
1013 #define xListItem ListItem_t
1014 #define xList List_t
1016 /* For libraries that break the list data hiding, and access list structure
1017 * members directly (which is not supposed to be done). */
1018 #define pxContainer pvContainer
1019 #endif /* configENABLE_BACKWARD_COMPATIBILITY */
1021 #if ( configUSE_ALTERNATIVE_API != 0 )
1022 #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0
1025 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
1026 * if floating point hardware is otherwise supported by the FreeRTOS port in use.
1027 * This constant is not supported by all FreeRTOS ports that include floating
1029 #ifndef configUSE_TASK_FPU_SUPPORT
1030 #define configUSE_TASK_FPU_SUPPORT 1
1033 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is
1034 * currently used in ARMv8M ports. */
1035 #ifndef configENABLE_MPU
1036 #define configENABLE_MPU 0
1039 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is
1040 * currently used in ARMv8M ports. */
1041 #ifndef configENABLE_FPU
1042 #define configENABLE_FPU 1
1045 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
1046 * This is currently used in ARMv8M ports. */
1047 #ifndef configENABLE_TRUSTZONE
1048 #define configENABLE_TRUSTZONE 1
1051 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on
1052 * the Secure Side only. */
1053 #ifndef configRUN_FREERTOS_SECURE_ONLY
1054 #define configRUN_FREERTOS_SECURE_ONLY 0
1057 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
1058 * dynamically allocated RAM, in which case when any task is deleted it is known
1059 * that both the task's stack and TCB need to be freed. Sometimes the
1060 * FreeRTOSConfig.h settings only allow a task to be created using statically
1061 * allocated RAM, in which case when any task is deleted it is known that neither
1062 * the task's stack or TCB should be freed. Sometimes the FreeRTOSConfig.h
1063 * settings allow a task to be created using either statically or dynamically
1064 * allocated RAM, in which case a member of the TCB is used to record whether the
1065 * stack and/or TCB were allocated statically or dynamically, so when a task is
1066 * deleted the RAM that was allocated dynamically is freed again and no attempt is
1067 * made to free the RAM that was allocated statically.
1068 * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a
1069 * task to be created using either statically or dynamically allocated RAM. Note
1070 * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with
1071 * a statically allocated stack and a dynamically allocated TCB.
1073 * The following table lists various combinations of portUSING_MPU_WRAPPERS,
1074 * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and
1075 * when it is possible to have both static and dynamic allocation:
1076 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1077 * | MPU | Dynamic | Static | Available Functions | Possible Allocations | Both Dynamic and | Need Free |
1078 * | | | | | | Static Possible | |
1079 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1080 * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack - Static | No | No |
1081 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1082 * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack - Dynamic | No | Yes |
1083 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1084 * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1085 * | | | | xTaskCreateStatic | 2. TCB - Static, Stack - Static | | |
1086 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1087 * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack - Static | No | No |
1088 * | | | | xTaskCreateRestrictedStatic | | | |
1089 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1090 * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1091 * | | | | xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | |
1092 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
1093 * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
1094 * | | | | xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | |
1095 * | | | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | | |
1096 * | | | | xTaskCreateRestrictedStatic | | | |
1097 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
1099 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE \
1100 ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \
1101 ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )
1104 * In line with software engineering best practice, FreeRTOS implements a strict
1105 * data hiding policy, so the real structures used by FreeRTOS to maintain the
1106 * state of tasks, queues, semaphores, etc. are not accessible to the application
1107 * code. However, if the application writer wants to statically allocate such
1108 * an object then the size of the object needs to be know. Dummy structures
1109 * that are guaranteed to have the same size and alignment requirements of the
1110 * real objects are used for this purpose. The dummy list and list item
1111 * structures below are used for inclusion in such a dummy structure.
1113 struct xSTATIC_LIST_ITEM
1115 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1119 void * pvDummy3[ 4 ];
1120 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1124 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
1126 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1127 struct xSTATIC_MINI_LIST_ITEM
1129 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1133 void * pvDummy3[ 2 ];
1135 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
1137 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
1138 typedef struct xSTATIC_LIST
1140 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1143 UBaseType_t uxDummy2;
1145 StaticMiniListItem_t xDummy4;
1146 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
1152 * In line with software engineering best practice, especially when supplying a
1153 * library that is likely to change in future versions, FreeRTOS implements a
1154 * strict data hiding policy. This means the Task structure used internally by
1155 * FreeRTOS is not accessible to application code. However, if the application
1156 * writer wants to statically allocate the memory required to create a task then
1157 * the size of the task object needs to be know. The StaticTask_t structure
1158 * below is provided for this purpose. Its sizes and alignment requirements are
1159 * guaranteed to match those of the genuine structure, no matter which
1160 * architecture is being used, and no matter how the values in FreeRTOSConfig.h
1161 * are set. Its contents are somewhat obfuscated in the hope users will
1162 * recognise that it would be unwise to make direct use of the structure members.
1164 typedef struct xSTATIC_TCB
1167 #if ( portUSING_MPU_WRAPPERS == 1 )
1168 xMPU_SETTINGS xDummy2;
1170 StaticListItem_t xDummy3[ 2 ];
1171 UBaseType_t uxDummy5;
1173 uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
1174 #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
1177 #if ( portCRITICAL_NESTING_IN_TCB == 1 )
1178 UBaseType_t uxDummy9;
1180 #if ( configUSE_TRACE_FACILITY == 1 )
1181 UBaseType_t uxDummy10[ 2 ];
1183 #if ( configUSE_MUTEXES == 1 )
1184 UBaseType_t uxDummy12[ 2 ];
1186 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
1189 #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
1190 void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
1192 #if ( configGENERATE_RUN_TIME_STATS == 1 )
1195 #if ( configUSE_NEWLIB_REENTRANT == 1 )
1196 struct _reent xDummy17;
1198 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
1199 uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
1200 uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
1202 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
1206 #if ( INCLUDE_xTaskAbortDelay == 1 )
1209 #if ( configUSE_POSIX_ERRNO == 1 )
1215 * In line with software engineering best practice, especially when supplying a
1216 * library that is likely to change in future versions, FreeRTOS implements a
1217 * strict data hiding policy. This means the Queue structure used internally by
1218 * FreeRTOS is not accessible to application code. However, if the application
1219 * writer wants to statically allocate the memory required to create a queue
1220 * then the size of the queue object needs to be know. The StaticQueue_t
1221 * structure below is provided for this purpose. Its sizes and alignment
1222 * requirements are guaranteed to match those of the genuine structure, no
1223 * matter which architecture is being used, and no matter how the values in
1224 * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope
1225 * users will recognise that it would be unwise to make direct use of the
1226 * structure members.
1228 typedef struct xSTATIC_QUEUE
1230 void * pvDummy1[ 3 ];
1235 UBaseType_t uxDummy2;
1238 StaticList_t xDummy3[ 2 ];
1239 UBaseType_t uxDummy4[ 3 ];
1240 uint8_t ucDummy5[ 2 ];
1242 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
1246 #if ( configUSE_QUEUE_SETS == 1 )
1250 #if ( configUSE_TRACE_FACILITY == 1 )
1251 UBaseType_t uxDummy8;
1255 typedef StaticQueue_t StaticSemaphore_t;
1258 * In line with software engineering best practice, especially when supplying a
1259 * library that is likely to change in future versions, FreeRTOS implements a
1260 * strict data hiding policy. This means the event group structure used
1261 * internally by FreeRTOS is not accessible to application code. However, if
1262 * the application writer wants to statically allocate the memory required to
1263 * create an event group then the size of the event group object needs to be
1264 * know. The StaticEventGroup_t structure below is provided for this purpose.
1265 * Its sizes and alignment requirements are guaranteed to match those of the
1266 * genuine structure, no matter which architecture is being used, and no matter
1267 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat
1268 * obfuscated in the hope users will recognise that it would be unwise to make
1269 * direct use of the structure members.
1271 typedef struct xSTATIC_EVENT_GROUP
1274 StaticList_t xDummy2;
1276 #if ( configUSE_TRACE_FACILITY == 1 )
1277 UBaseType_t uxDummy3;
1280 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
1283 } StaticEventGroup_t;
1286 * In line with software engineering best practice, especially when supplying a
1287 * library that is likely to change in future versions, FreeRTOS implements a
1288 * strict data hiding policy. This means the software timer structure used
1289 * internally by FreeRTOS is not accessible to application code. However, if
1290 * the application writer wants to statically allocate the memory required to
1291 * create a software timer then the size of the queue object needs to be know.
1292 * The StaticTimer_t structure below is provided for this purpose. Its sizes
1293 * and alignment requirements are guaranteed to match those of the genuine
1294 * structure, no matter which architecture is being used, and no matter how the
1295 * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in
1296 * the hope users will recognise that it would be unwise to make direct use of
1297 * the structure members.
1299 typedef struct xSTATIC_TIMER
1302 StaticListItem_t xDummy2;
1305 TaskFunction_t pvDummy6;
1306 #if ( configUSE_TRACE_FACILITY == 1 )
1307 UBaseType_t uxDummy7;
1313 * In line with software engineering best practice, especially when supplying a
1314 * library that is likely to change in future versions, FreeRTOS implements a
1315 * strict data hiding policy. This means the stream buffer structure used
1316 * internally by FreeRTOS is not accessible to application code. However, if
1317 * the application writer wants to statically allocate the memory required to
1318 * create a stream buffer then the size of the stream buffer object needs to be
1319 * know. The StaticStreamBuffer_t structure below is provided for this purpose.
1320 * Its size and alignment requirements are guaranteed to match those of the
1321 * genuine structure, no matter which architecture is being used, and no matter
1322 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat
1323 * obfuscated in the hope users will recognise that it would be unwise to make
1324 * direct use of the structure members.
1326 typedef struct xSTATIC_STREAM_BUFFER
1328 size_t uxDummy1[ 4 ];
1329 void * pvDummy2[ 3 ];
1331 #if ( configUSE_TRACE_FACILITY == 1 )
1332 UBaseType_t uxDummy4;
1334 } StaticStreamBuffer_t;
1336 /* Message buffers are built on stream buffers. */
1337 typedef StaticStreamBuffer_t StaticMessageBuffer_t;
1345 #endif /* INC_FREERTOS_H */