2 * FreeRTOS Kernel V10.4.4
\r
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * SPDX-License-Identifier: MIT
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
8 * this software and associated documentation files (the "Software"), to deal in
\r
9 * the Software without restriction, including without limitation the rights to
\r
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
11 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
12 * subject to the following conditions:
\r
14 * The above copyright notice and this permission notice shall be included in all
\r
15 * copies or substantial portions of the Software.
\r
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
24 * https://www.FreeRTOS.org
\r
25 * https://github.com/FreeRTOS
\r
29 #ifndef INC_FREERTOS_H
\r
30 #define INC_FREERTOS_H
\r
33 * Include the generic headers required for the FreeRTOS port being used.
\r
38 * If stdint.h cannot be located then:
\r
39 * + If using GCC ensure the -nostdint options is *not* being used.
\r
40 * + Ensure the project's include path includes the directory in which your
\r
41 * compiler stores stdint.h.
\r
42 * + Set any compiler options necessary for it to support C99, as technically
\r
43 * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any
\r
45 * + The FreeRTOS download includes a simple stdint.h definition that can be
\r
46 * used in cases where none is provided by the compiler. The files only
\r
47 * contains the typedefs required to build FreeRTOS. Read the instructions
\r
48 * in FreeRTOS/source/stdint.readme for more information.
\r
50 #include <stdint.h> /* READ COMMENT ABOVE. */
\r
58 /* Application specific configuration options. */
\r
59 #include "FreeRTOSConfig.h"
\r
61 /* Basic FreeRTOS definitions. */
\r
62 #include "projdefs.h"
\r
64 /* Definitions specific to the port being used. */
\r
65 #include "portable.h"
\r
67 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */
\r
68 #ifndef configUSE_NEWLIB_REENTRANT
\r
69 #define configUSE_NEWLIB_REENTRANT 0
\r
72 /* Required if struct _reent is used. */
\r
73 #if ( configUSE_NEWLIB_REENTRANT == 1 )
\r
78 * Check all the required application specific macros have been defined.
\r
79 * These macros are application specific and (as downloaded) are defined
\r
80 * within FreeRTOSConfig.h.
\r
83 #ifndef configMINIMAL_STACK_SIZE
\r
84 #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.
\r
87 #ifndef configMAX_PRIORITIES
\r
88 #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
\r
91 #if configMAX_PRIORITIES < 1
\r
92 #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.
\r
95 #ifndef configUSE_PREEMPTION
\r
96 #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.
\r
99 #ifndef configUSE_IDLE_HOOK
\r
100 #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.
\r
103 #ifndef configUSE_TICK_HOOK
\r
104 #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.
\r
107 #ifndef configUSE_16_BIT_TICKS
\r
108 #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.
\r
111 #ifndef configUSE_CO_ROUTINES
\r
112 #define configUSE_CO_ROUTINES 0
\r
115 #ifndef INCLUDE_vTaskPrioritySet
\r
116 #define INCLUDE_vTaskPrioritySet 0
\r
119 #ifndef INCLUDE_uxTaskPriorityGet
\r
120 #define INCLUDE_uxTaskPriorityGet 0
\r
123 #ifndef INCLUDE_vTaskDelete
\r
124 #define INCLUDE_vTaskDelete 0
\r
127 #ifndef INCLUDE_vTaskSuspend
\r
128 #define INCLUDE_vTaskSuspend 0
\r
131 #ifdef INCLUDE_xTaskDelayUntil
\r
132 #ifdef INCLUDE_vTaskDelayUntil
\r
133 /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil. Backward
\r
134 * compatibility is maintained if only one or the other is defined, but
\r
135 * there is a conflict if both are defined. */
\r
136 #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined. INCLUDE_vTaskDelayUntil is no longer required and should be removed
\r
140 #ifndef INCLUDE_xTaskDelayUntil
\r
141 #ifdef INCLUDE_vTaskDelayUntil
\r
142 /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then
\r
143 * the project's FreeRTOSConfig.h probably pre-dates the introduction of
\r
144 * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever
\r
145 * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.
\r
147 #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil
\r
151 #ifndef INCLUDE_xTaskDelayUntil
\r
152 #define INCLUDE_xTaskDelayUntil 0
\r
155 #ifndef INCLUDE_vTaskDelay
\r
156 #define INCLUDE_vTaskDelay 0
\r
159 #ifndef INCLUDE_xTaskGetIdleTaskHandle
\r
160 #define INCLUDE_xTaskGetIdleTaskHandle 0
\r
163 #ifndef INCLUDE_xTaskAbortDelay
\r
164 #define INCLUDE_xTaskAbortDelay 0
\r
167 #ifndef INCLUDE_xQueueGetMutexHolder
\r
168 #define INCLUDE_xQueueGetMutexHolder 0
\r
171 #ifndef INCLUDE_xSemaphoreGetMutexHolder
\r
172 #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
\r
175 #ifndef INCLUDE_xTaskGetHandle
\r
176 #define INCLUDE_xTaskGetHandle 0
\r
179 #ifndef INCLUDE_uxTaskGetStackHighWaterMark
\r
180 #define INCLUDE_uxTaskGetStackHighWaterMark 0
\r
183 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2
\r
184 #define INCLUDE_uxTaskGetStackHighWaterMark2 0
\r
187 #ifndef INCLUDE_eTaskGetState
\r
188 #define INCLUDE_eTaskGetState 0
\r
191 #ifndef INCLUDE_xTaskResumeFromISR
\r
192 #define INCLUDE_xTaskResumeFromISR 1
\r
195 #ifndef INCLUDE_xTimerPendFunctionCall
\r
196 #define INCLUDE_xTimerPendFunctionCall 0
\r
199 #ifndef INCLUDE_xTaskGetSchedulerState
\r
200 #define INCLUDE_xTaskGetSchedulerState 0
\r
203 #ifndef INCLUDE_xTaskGetCurrentTaskHandle
\r
204 #define INCLUDE_xTaskGetCurrentTaskHandle 0
\r
207 #if configUSE_CO_ROUTINES != 0
\r
208 #ifndef configMAX_CO_ROUTINE_PRIORITIES
\r
209 #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.
\r
213 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK
\r
214 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
\r
217 #ifndef configUSE_APPLICATION_TASK_TAG
\r
218 #define configUSE_APPLICATION_TASK_TAG 0
\r
221 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
\r
222 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
\r
225 #ifndef configUSE_RECURSIVE_MUTEXES
\r
226 #define configUSE_RECURSIVE_MUTEXES 0
\r
229 #ifndef configUSE_MUTEXES
\r
230 #define configUSE_MUTEXES 0
\r
233 #ifndef configUSE_TIMERS
\r
234 #define configUSE_TIMERS 0
\r
237 #ifndef configUSE_COUNTING_SEMAPHORES
\r
238 #define configUSE_COUNTING_SEMAPHORES 0
\r
241 #ifndef configUSE_ALTERNATIVE_API
\r
242 #define configUSE_ALTERNATIVE_API 0
\r
245 #ifndef portCRITICAL_NESTING_IN_TCB
\r
246 #define portCRITICAL_NESTING_IN_TCB 0
\r
249 #ifndef configMAX_TASK_NAME_LEN
\r
250 #define configMAX_TASK_NAME_LEN 16
\r
253 #ifndef configIDLE_SHOULD_YIELD
\r
254 #define configIDLE_SHOULD_YIELD 1
\r
257 #if configMAX_TASK_NAME_LEN < 1
\r
258 #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
\r
261 #ifndef configASSERT
\r
262 #define configASSERT( x )
\r
263 #define configASSERT_DEFINED 0
\r
265 #define configASSERT_DEFINED 1
\r
268 /* configPRECONDITION should be defined as configASSERT.
\r
269 * The CBMC proofs need a way to track assumptions and assertions.
\r
270 * A configPRECONDITION statement should express an implicit invariant or
\r
271 * assumption made. A configASSERT statement should express an invariant that must
\r
272 * hold explicit before calling the code. */
\r
273 #ifndef configPRECONDITION
\r
274 #define configPRECONDITION( X ) configASSERT( X )
\r
275 #define configPRECONDITION_DEFINED 0
\r
277 #define configPRECONDITION_DEFINED 1
\r
280 #ifndef portMEMORY_BARRIER
\r
281 #define portMEMORY_BARRIER()
\r
284 #ifndef portSOFTWARE_BARRIER
\r
285 #define portSOFTWARE_BARRIER()
\r
288 /* The timers module relies on xTaskGetSchedulerState(). */
\r
289 #if configUSE_TIMERS == 1
\r
291 #ifndef configTIMER_TASK_PRIORITY
\r
292 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
\r
293 #endif /* configTIMER_TASK_PRIORITY */
\r
295 #ifndef configTIMER_QUEUE_LENGTH
\r
296 #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
\r
297 #endif /* configTIMER_QUEUE_LENGTH */
\r
299 #ifndef configTIMER_TASK_STACK_DEPTH
\r
300 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
\r
301 #endif /* configTIMER_TASK_STACK_DEPTH */
\r
303 #endif /* configUSE_TIMERS */
\r
305 #ifndef portSET_INTERRUPT_MASK_FROM_ISR
\r
306 #define portSET_INTERRUPT_MASK_FROM_ISR() 0
\r
309 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
\r
310 #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
\r
313 #ifndef portCLEAN_UP_TCB
\r
314 #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
\r
317 #ifndef portPRE_TASK_DELETE_HOOK
\r
318 #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
\r
321 #ifndef portSETUP_TCB
\r
322 #define portSETUP_TCB( pxTCB ) ( void ) pxTCB
\r
325 #ifndef configQUEUE_REGISTRY_SIZE
\r
326 #define configQUEUE_REGISTRY_SIZE 0U
\r
329 #if ( configQUEUE_REGISTRY_SIZE < 1 )
\r
330 #define vQueueAddToRegistry( xQueue, pcName )
\r
331 #define vQueueUnregisterQueue( xQueue )
\r
332 #define pcQueueGetName( xQueue )
\r
335 #ifndef portPOINTER_SIZE_TYPE
\r
336 #define portPOINTER_SIZE_TYPE uint32_t
\r
339 /* Remove any unused trace macros. */
\r
342 /* Used to perform any necessary initialisation - for example, open a file
\r
343 * into which trace is to be written. */
\r
344 #define traceSTART()
\r
349 /* Use to close a trace, for example close a file into which trace has been
\r
354 #ifndef traceTASK_SWITCHED_IN
\r
356 /* Called after a task has been selected to run. pxCurrentTCB holds a pointer
\r
357 * to the task control block of the selected task. */
\r
358 #define traceTASK_SWITCHED_IN()
\r
361 #ifndef traceINCREASE_TICK_COUNT
\r
363 /* Called before stepping the tick count after waking from tickless idle
\r
365 #define traceINCREASE_TICK_COUNT( x )
\r
368 #ifndef traceLOW_POWER_IDLE_BEGIN
\r
369 /* Called immediately before entering tickless idle. */
\r
370 #define traceLOW_POWER_IDLE_BEGIN()
\r
373 #ifndef traceLOW_POWER_IDLE_END
\r
374 /* Called when returning to the Idle task after a tickless idle. */
\r
375 #define traceLOW_POWER_IDLE_END()
\r
378 #ifndef traceTASK_SWITCHED_OUT
\r
380 /* Called before a task has been selected to run. pxCurrentTCB holds a pointer
\r
381 * to the task control block of the task being switched out. */
\r
382 #define traceTASK_SWITCHED_OUT()
\r
385 #ifndef traceTASK_PRIORITY_INHERIT
\r
387 /* Called when a task attempts to take a mutex that is already held by a
\r
388 * lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
\r
389 * that holds the mutex. uxInheritedPriority is the priority the mutex holder
\r
390 * will inherit (the priority of the task that is attempting to obtain the
\r
392 #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
\r
395 #ifndef traceTASK_PRIORITY_DISINHERIT
\r
397 /* Called when a task releases a mutex, the holding of which had resulted in
\r
398 * the task inheriting the priority of a higher priority task.
\r
399 * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
\r
400 * mutex. uxOriginalPriority is the task's configured (base) priority. */
\r
401 #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
\r
404 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
\r
406 /* Task is about to block because it cannot read from a
\r
407 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
\r
408 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
\r
409 * task that attempted the read. */
\r
410 #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
\r
413 #ifndef traceBLOCKING_ON_QUEUE_PEEK
\r
415 /* Task is about to block because it cannot read from a
\r
416 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
\r
417 * upon which the read was attempted. pxCurrentTCB points to the TCB of the
\r
418 * task that attempted the read. */
\r
419 #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )
\r
422 #ifndef traceBLOCKING_ON_QUEUE_SEND
\r
424 /* Task is about to block because it cannot write to a
\r
425 * queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
\r
426 * upon which the write was attempted. pxCurrentTCB points to the TCB of the
\r
427 * task that attempted the write. */
\r
428 #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
\r
431 #ifndef configCHECK_FOR_STACK_OVERFLOW
\r
432 #define configCHECK_FOR_STACK_OVERFLOW 0
\r
435 #ifndef configRECORD_STACK_HIGH_ADDRESS
\r
436 #define configRECORD_STACK_HIGH_ADDRESS 0
\r
439 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H
\r
440 #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0
\r
443 /* The following event macros are embedded in the kernel API calls. */
\r
445 #ifndef traceMOVED_TASK_TO_READY_STATE
\r
446 #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
\r
449 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE
\r
450 #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )
\r
453 #ifndef traceQUEUE_CREATE
\r
454 #define traceQUEUE_CREATE( pxNewQueue )
\r
457 #ifndef traceQUEUE_CREATE_FAILED
\r
458 #define traceQUEUE_CREATE_FAILED( ucQueueType )
\r
461 #ifndef traceCREATE_MUTEX
\r
462 #define traceCREATE_MUTEX( pxNewQueue )
\r
465 #ifndef traceCREATE_MUTEX_FAILED
\r
466 #define traceCREATE_MUTEX_FAILED()
\r
469 #ifndef traceGIVE_MUTEX_RECURSIVE
\r
470 #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
\r
473 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
\r
474 #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
\r
477 #ifndef traceTAKE_MUTEX_RECURSIVE
\r
478 #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
\r
481 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
\r
482 #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
\r
485 #ifndef traceCREATE_COUNTING_SEMAPHORE
\r
486 #define traceCREATE_COUNTING_SEMAPHORE()
\r
489 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
\r
490 #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
\r
493 #ifndef traceQUEUE_SET_SEND
\r
494 #define traceQUEUE_SET_SEND traceQUEUE_SEND
\r
497 #ifndef traceQUEUE_SEND
\r
498 #define traceQUEUE_SEND( pxQueue )
\r
501 #ifndef traceQUEUE_SEND_FAILED
\r
502 #define traceQUEUE_SEND_FAILED( pxQueue )
\r
505 #ifndef traceQUEUE_RECEIVE
\r
506 #define traceQUEUE_RECEIVE( pxQueue )
\r
509 #ifndef traceQUEUE_PEEK
\r
510 #define traceQUEUE_PEEK( pxQueue )
\r
513 #ifndef traceQUEUE_PEEK_FAILED
\r
514 #define traceQUEUE_PEEK_FAILED( pxQueue )
\r
517 #ifndef traceQUEUE_PEEK_FROM_ISR
\r
518 #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
\r
521 #ifndef traceQUEUE_RECEIVE_FAILED
\r
522 #define traceQUEUE_RECEIVE_FAILED( pxQueue )
\r
525 #ifndef traceQUEUE_SEND_FROM_ISR
\r
526 #define traceQUEUE_SEND_FROM_ISR( pxQueue )
\r
529 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
\r
530 #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
\r
533 #ifndef traceQUEUE_RECEIVE_FROM_ISR
\r
534 #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
\r
537 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
\r
538 #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
\r
541 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
\r
542 #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
\r
545 #ifndef traceQUEUE_DELETE
\r
546 #define traceQUEUE_DELETE( pxQueue )
\r
549 #ifndef traceTASK_CREATE
\r
550 #define traceTASK_CREATE( pxNewTCB )
\r
553 #ifndef traceTASK_CREATE_FAILED
\r
554 #define traceTASK_CREATE_FAILED()
\r
557 #ifndef traceTASK_DELETE
\r
558 #define traceTASK_DELETE( pxTaskToDelete )
\r
561 #ifndef traceTASK_DELAY_UNTIL
\r
562 #define traceTASK_DELAY_UNTIL( x )
\r
565 #ifndef traceTASK_DELAY
\r
566 #define traceTASK_DELAY()
\r
569 #ifndef traceTASK_PRIORITY_SET
\r
570 #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
\r
573 #ifndef traceTASK_SUSPEND
\r
574 #define traceTASK_SUSPEND( pxTaskToSuspend )
\r
577 #ifndef traceTASK_RESUME
\r
578 #define traceTASK_RESUME( pxTaskToResume )
\r
581 #ifndef traceTASK_RESUME_FROM_ISR
\r
582 #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
\r
585 #ifndef traceTASK_INCREMENT_TICK
\r
586 #define traceTASK_INCREMENT_TICK( xTickCount )
\r
589 #ifndef traceTIMER_CREATE
\r
590 #define traceTIMER_CREATE( pxNewTimer )
\r
593 #ifndef traceTIMER_CREATE_FAILED
\r
594 #define traceTIMER_CREATE_FAILED()
\r
597 #ifndef traceTIMER_COMMAND_SEND
\r
598 #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
\r
601 #ifndef traceTIMER_EXPIRED
\r
602 #define traceTIMER_EXPIRED( pxTimer )
\r
605 #ifndef traceTIMER_COMMAND_RECEIVED
\r
606 #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
\r
609 #ifndef traceMALLOC
\r
610 #define traceMALLOC( pvAddress, uiSize )
\r
614 #define traceFREE( pvAddress, uiSize )
\r
617 #ifndef traceEVENT_GROUP_CREATE
\r
618 #define traceEVENT_GROUP_CREATE( xEventGroup )
\r
621 #ifndef traceEVENT_GROUP_CREATE_FAILED
\r
622 #define traceEVENT_GROUP_CREATE_FAILED()
\r
625 #ifndef traceEVENT_GROUP_SYNC_BLOCK
\r
626 #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
\r
629 #ifndef traceEVENT_GROUP_SYNC_END
\r
630 #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
\r
633 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
\r
634 #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
\r
637 #ifndef traceEVENT_GROUP_WAIT_BITS_END
\r
638 #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
\r
641 #ifndef traceEVENT_GROUP_CLEAR_BITS
\r
642 #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
\r
645 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
\r
646 #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
\r
649 #ifndef traceEVENT_GROUP_SET_BITS
\r
650 #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
\r
653 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
\r
654 #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
\r
657 #ifndef traceEVENT_GROUP_DELETE
\r
658 #define traceEVENT_GROUP_DELETE( xEventGroup )
\r
661 #ifndef tracePEND_FUNC_CALL
\r
662 #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )
\r
665 #ifndef tracePEND_FUNC_CALL_FROM_ISR
\r
666 #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )
\r
669 #ifndef traceQUEUE_REGISTRY_ADD
\r
670 #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )
\r
673 #ifndef traceTASK_NOTIFY_TAKE_BLOCK
\r
674 #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )
\r
677 #ifndef traceTASK_NOTIFY_TAKE
\r
678 #define traceTASK_NOTIFY_TAKE( uxIndexToWait )
\r
681 #ifndef traceTASK_NOTIFY_WAIT_BLOCK
\r
682 #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )
\r
685 #ifndef traceTASK_NOTIFY_WAIT
\r
686 #define traceTASK_NOTIFY_WAIT( uxIndexToWait )
\r
689 #ifndef traceTASK_NOTIFY
\r
690 #define traceTASK_NOTIFY( uxIndexToNotify )
\r
693 #ifndef traceTASK_NOTIFY_FROM_ISR
\r
694 #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )
\r
697 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
\r
698 #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
\r
701 #ifndef traceSTREAM_BUFFER_CREATE_FAILED
\r
702 #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )
\r
705 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED
\r
706 #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )
\r
709 #ifndef traceSTREAM_BUFFER_CREATE
\r
710 #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )
\r
713 #ifndef traceSTREAM_BUFFER_DELETE
\r
714 #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )
\r
717 #ifndef traceSTREAM_BUFFER_RESET
\r
718 #define traceSTREAM_BUFFER_RESET( xStreamBuffer )
\r
721 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND
\r
722 #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )
\r
725 #ifndef traceSTREAM_BUFFER_SEND
\r
726 #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )
\r
729 #ifndef traceSTREAM_BUFFER_SEND_FAILED
\r
730 #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )
\r
733 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR
\r
734 #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )
\r
737 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE
\r
738 #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )
\r
741 #ifndef traceSTREAM_BUFFER_RECEIVE
\r
742 #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )
\r
745 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED
\r
746 #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )
\r
749 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR
\r
750 #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )
\r
753 #ifndef configGENERATE_RUN_TIME_STATS
\r
754 #define configGENERATE_RUN_TIME_STATS 0
\r
757 #if ( configGENERATE_RUN_TIME_STATS == 1 )
\r
759 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
\r
760 #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.
\r
761 #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
\r
763 #ifndef portGET_RUN_TIME_COUNTER_VALUE
\r
764 #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
\r
765 #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.
\r
766 #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
\r
767 #endif /* portGET_RUN_TIME_COUNTER_VALUE */
\r
769 #endif /* configGENERATE_RUN_TIME_STATS */
\r
771 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
\r
772 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
\r
775 #ifndef configUSE_MALLOC_FAILED_HOOK
\r
776 #define configUSE_MALLOC_FAILED_HOOK 0
\r
779 #ifndef portPRIVILEGE_BIT
\r
780 #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
\r
783 #ifndef portYIELD_WITHIN_API
\r
784 #define portYIELD_WITHIN_API portYIELD
\r
787 #ifndef portSUPPRESS_TICKS_AND_SLEEP
\r
788 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
\r
791 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
\r
792 #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
\r
795 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
\r
796 #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
\r
799 #ifndef configUSE_TICKLESS_IDLE
\r
800 #define configUSE_TICKLESS_IDLE 0
\r
803 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING
\r
804 #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )
\r
807 #ifndef configPRE_SLEEP_PROCESSING
\r
808 #define configPRE_SLEEP_PROCESSING( x )
\r
811 #ifndef configPOST_SLEEP_PROCESSING
\r
812 #define configPOST_SLEEP_PROCESSING( x )
\r
815 #ifndef configUSE_QUEUE_SETS
\r
816 #define configUSE_QUEUE_SETS 0
\r
819 #ifndef portTASK_USES_FLOATING_POINT
\r
820 #define portTASK_USES_FLOATING_POINT()
\r
823 #ifndef portALLOCATE_SECURE_CONTEXT
\r
824 #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )
\r
827 #ifndef portDONT_DISCARD
\r
828 #define portDONT_DISCARD
\r
831 #ifndef configUSE_TIME_SLICING
\r
832 #define configUSE_TIME_SLICING 1
\r
835 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
\r
836 #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
\r
839 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
\r
840 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
\r
843 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
\r
844 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
\r
847 #ifndef configUSE_TRACE_FACILITY
\r
848 #define configUSE_TRACE_FACILITY 0
\r
851 #ifndef mtCOVERAGE_TEST_MARKER
\r
852 #define mtCOVERAGE_TEST_MARKER()
\r
855 #ifndef mtCOVERAGE_TEST_DELAY
\r
856 #define mtCOVERAGE_TEST_DELAY()
\r
859 #ifndef portASSERT_IF_IN_ISR
\r
860 #define portASSERT_IF_IN_ISR()
\r
863 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
\r
864 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
\r
867 #ifndef configAPPLICATION_ALLOCATED_HEAP
\r
868 #define configAPPLICATION_ALLOCATED_HEAP 0
\r
871 #ifndef configUSE_TASK_NOTIFICATIONS
\r
872 #define configUSE_TASK_NOTIFICATIONS 1
\r
875 #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES
\r
876 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
\r
879 #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1
\r
880 #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1
\r
883 #ifndef configUSE_POSIX_ERRNO
\r
884 #define configUSE_POSIX_ERRNO 0
\r
887 #ifndef portTICK_TYPE_IS_ATOMIC
\r
888 #define portTICK_TYPE_IS_ATOMIC 0
\r
891 #ifndef configSUPPORT_STATIC_ALLOCATION
\r
892 /* Defaults to 0 for backward compatibility. */
\r
893 #define configSUPPORT_STATIC_ALLOCATION 0
\r
896 #ifndef configSUPPORT_DYNAMIC_ALLOCATION
\r
897 /* Defaults to 1 for backward compatibility. */
\r
898 #define configSUPPORT_DYNAMIC_ALLOCATION 1
\r
901 #ifndef configSTACK_DEPTH_TYPE
\r
903 /* Defaults to uint16_t for backward compatibility, but can be overridden
\r
904 * in FreeRTOSConfig.h if uint16_t is too restrictive. */
\r
905 #define configSTACK_DEPTH_TYPE uint16_t
\r
908 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE
\r
910 /* Defaults to size_t for backward compatibility, but can be overridden
\r
911 * in FreeRTOSConfig.h if lengths will always be less than the number of bytes
\r
913 #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
\r
916 /* Sanity check the configuration. */
\r
917 #if ( configUSE_TICKLESS_IDLE != 0 )
\r
918 #if ( INCLUDE_vTaskSuspend != 1 )
\r
919 #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
\r
920 #endif /* INCLUDE_vTaskSuspend */
\r
921 #endif /* configUSE_TICKLESS_IDLE */
\r
923 #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
\r
924 #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
\r
927 #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
\r
928 #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
\r
931 #ifndef configINITIAL_TICK_COUNT
\r
932 #define configINITIAL_TICK_COUNT 0
\r
935 #if ( portTICK_TYPE_IS_ATOMIC == 0 )
\r
937 /* Either variables of tick type cannot be read atomically, or
\r
938 * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
\r
939 * the tick count is returned to the standard critical section macros. */
\r
940 #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
\r
941 #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
\r
942 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
\r
943 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
\r
946 /* The tick type can be read atomically, so critical sections used when the
\r
947 * tick count is returned can be defined away. */
\r
948 #define portTICK_TYPE_ENTER_CRITICAL()
\r
949 #define portTICK_TYPE_EXIT_CRITICAL()
\r
950 #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
\r
951 #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x
\r
952 #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */
\r
954 /* Definitions to allow backward compatibility with FreeRTOS versions prior to
\r
955 * V8 if desired. */
\r
956 #ifndef configENABLE_BACKWARD_COMPATIBILITY
\r
957 #define configENABLE_BACKWARD_COMPATIBILITY 1
\r
960 #ifndef configPRINTF
\r
962 /* configPRINTF() was not defined, so define it away to nothing. To use
\r
963 * configPRINTF() then define it as follows (where MyPrintFunction() is
\r
964 * provided by the application writer):
\r
966 * void MyPrintFunction(const char *pcFormat, ... );
\r
967 #define configPRINTF( X ) MyPrintFunction X
\r
969 * Then call like a standard printf() function, but placing brackets around
\r
970 * all parameters so they are passed as a single parameter. For example:
\r
971 * configPRINTF( ("Value = %d", MyVariable) ); */
\r
972 #define configPRINTF( X )
\r
977 /* The application writer has not provided their own MAX macro, so define
\r
978 * the following generic implementation. */
\r
979 #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
\r
984 /* The application writer has not provided their own MIN macro, so define
\r
985 * the following generic implementation. */
\r
986 #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
\r
989 #if configENABLE_BACKWARD_COMPATIBILITY == 1
\r
990 #define eTaskStateGet eTaskGetState
\r
991 #define portTickType TickType_t
\r
992 #define xTaskHandle TaskHandle_t
\r
993 #define xQueueHandle QueueHandle_t
\r
994 #define xSemaphoreHandle SemaphoreHandle_t
\r
995 #define xQueueSetHandle QueueSetHandle_t
\r
996 #define xQueueSetMemberHandle QueueSetMemberHandle_t
\r
997 #define xTimeOutType TimeOut_t
\r
998 #define xMemoryRegion MemoryRegion_t
\r
999 #define xTaskParameters TaskParameters_t
\r
1000 #define xTaskStatusType TaskStatus_t
\r
1001 #define xTimerHandle TimerHandle_t
\r
1002 #define xCoRoutineHandle CoRoutineHandle_t
\r
1003 #define pdTASK_HOOK_CODE TaskHookFunction_t
\r
1004 #define portTICK_RATE_MS portTICK_PERIOD_MS
\r
1005 #define pcTaskGetTaskName pcTaskGetName
\r
1006 #define pcTimerGetTimerName pcTimerGetName
\r
1007 #define pcQueueGetQueueName pcQueueGetName
\r
1008 #define vTaskGetTaskInfo vTaskGetInfo
\r
1009 #define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter
\r
1011 /* Backward compatibility within the scheduler code only - these definitions
\r
1012 * are not really required but are included for completeness. */
\r
1013 #define tmrTIMER_CALLBACK TimerCallbackFunction_t
\r
1014 #define pdTASK_CODE TaskFunction_t
\r
1015 #define xListItem ListItem_t
\r
1016 #define xList List_t
\r
1018 /* For libraries that break the list data hiding, and access list structure
\r
1019 * members directly (which is not supposed to be done). */
\r
1020 #define pxContainer pvContainer
\r
1021 #endif /* configENABLE_BACKWARD_COMPATIBILITY */
\r
1023 #if ( configUSE_ALTERNATIVE_API != 0 )
\r
1024 #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0
\r
1027 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
\r
1028 * if floating point hardware is otherwise supported by the FreeRTOS port in use.
\r
1029 * This constant is not supported by all FreeRTOS ports that include floating
\r
1030 * point support. */
\r
1031 #ifndef configUSE_TASK_FPU_SUPPORT
\r
1032 #define configUSE_TASK_FPU_SUPPORT 1
\r
1035 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is
\r
1036 * currently used in ARMv8M ports. */
\r
1037 #ifndef configENABLE_MPU
\r
1038 #define configENABLE_MPU 0
\r
1041 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is
\r
1042 * currently used in ARMv8M ports. */
\r
1043 #ifndef configENABLE_FPU
\r
1044 #define configENABLE_FPU 1
\r
1047 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.
\r
1048 * This is currently used in ARMv8M ports. */
\r
1049 #ifndef configENABLE_TRUSTZONE
\r
1050 #define configENABLE_TRUSTZONE 1
\r
1053 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on
\r
1054 * the Secure Side only. */
\r
1055 #ifndef configRUN_FREERTOS_SECURE_ONLY
\r
1056 #define configRUN_FREERTOS_SECURE_ONLY 0
\r
1059 #ifndef configRUN_ADDITIONAL_TESTS
\r
1060 #define configRUN_ADDITIONAL_TESTS 0
\r
1064 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
\r
1065 * dynamically allocated RAM, in which case when any task is deleted it is known
\r
1066 * that both the task's stack and TCB need to be freed. Sometimes the
\r
1067 * FreeRTOSConfig.h settings only allow a task to be created using statically
\r
1068 * allocated RAM, in which case when any task is deleted it is known that neither
\r
1069 * the task's stack or TCB should be freed. Sometimes the FreeRTOSConfig.h
\r
1070 * settings allow a task to be created using either statically or dynamically
\r
1071 * allocated RAM, in which case a member of the TCB is used to record whether the
\r
1072 * stack and/or TCB were allocated statically or dynamically, so when a task is
\r
1073 * deleted the RAM that was allocated dynamically is freed again and no attempt is
\r
1074 * made to free the RAM that was allocated statically.
\r
1075 * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a
\r
1076 * task to be created using either statically or dynamically allocated RAM. Note
\r
1077 * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with
\r
1078 * a statically allocated stack and a dynamically allocated TCB.
\r
1080 * The following table lists various combinations of portUSING_MPU_WRAPPERS,
\r
1081 * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and
\r
1082 * when it is possible to have both static and dynamic allocation:
\r
1083 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
\r
1084 * | MPU | Dynamic | Static | Available Functions | Possible Allocations | Both Dynamic and | Need Free |
\r
1085 * | | | | | | Static Possible | |
\r
1086 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
\r
1087 * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack - Static | No | No |
\r
1088 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
\r
1089 * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack - Dynamic | No | Yes |
\r
1090 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
\r
1091 * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
\r
1092 * | | | | xTaskCreateStatic | 2. TCB - Static, Stack - Static | | |
\r
1093 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
\r
1094 * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack - Static | No | No |
\r
1095 * | | | | xTaskCreateRestrictedStatic | | | |
\r
1096 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
\r
1097 * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
\r
1098 * | | | | xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | |
\r
1099 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|
\r
1100 * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, Stack - Dynamic | Yes | Yes |
\r
1101 * | | | | xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | |
\r
1102 * | | | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | | |
\r
1103 * | | | | xTaskCreateRestrictedStatic | | | |
\r
1104 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+
\r
1106 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE \
\r
1107 ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \
\r
1108 ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )
\r
1111 * In line with software engineering best practice, FreeRTOS implements a strict
\r
1112 * data hiding policy, so the real structures used by FreeRTOS to maintain the
\r
1113 * state of tasks, queues, semaphores, etc. are not accessible to the application
\r
1114 * code. However, if the application writer wants to statically allocate such
\r
1115 * an object then the size of the object needs to be known. Dummy structures
\r
1116 * that are guaranteed to have the same size and alignment requirements of the
\r
1117 * real objects are used for this purpose. The dummy list and list item
\r
1118 * structures below are used for inclusion in such a dummy structure.
\r
1120 struct xSTATIC_LIST_ITEM
\r
1122 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
\r
1123 TickType_t xDummy1;
\r
1125 TickType_t xDummy2;
\r
1126 void * pvDummy3[ 4 ];
\r
1127 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
\r
1128 TickType_t xDummy4;
\r
1131 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;
\r
1133 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
\r
1134 struct xSTATIC_MINI_LIST_ITEM
\r
1136 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
\r
1137 TickType_t xDummy1;
\r
1139 TickType_t xDummy2;
\r
1140 void * pvDummy3[ 2 ];
\r
1142 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;
\r
1144 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */
\r
1145 typedef struct xSTATIC_LIST
\r
1147 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
\r
1148 TickType_t xDummy1;
\r
1150 UBaseType_t uxDummy2;
\r
1152 StaticMiniListItem_t xDummy4;
\r
1153 #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
\r
1154 TickType_t xDummy5;
\r
1159 * In line with software engineering best practice, especially when supplying a
\r
1160 * library that is likely to change in future versions, FreeRTOS implements a
\r
1161 * strict data hiding policy. This means the Task structure used internally by
\r
1162 * FreeRTOS is not accessible to application code. However, if the application
\r
1163 * writer wants to statically allocate the memory required to create a task then
\r
1164 * the size of the task object needs to be known. The StaticTask_t structure
\r
1165 * below is provided for this purpose. Its sizes and alignment requirements are
\r
1166 * guaranteed to match those of the genuine structure, no matter which
\r
1167 * architecture is being used, and no matter how the values in FreeRTOSConfig.h
\r
1168 * are set. Its contents are somewhat obfuscated in the hope users will
\r
1169 * recognise that it would be unwise to make direct use of the structure members.
\r
1171 typedef struct xSTATIC_TCB
\r
1174 #if ( portUSING_MPU_WRAPPERS == 1 )
\r
1175 xMPU_SETTINGS xDummy2;
\r
1177 StaticListItem_t xDummy3[ 2 ];
\r
1178 UBaseType_t uxDummy5;
\r
1180 uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
\r
1181 #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
\r
1184 #if ( portCRITICAL_NESTING_IN_TCB == 1 )
\r
1185 UBaseType_t uxDummy9;
\r
1187 #if ( configUSE_TRACE_FACILITY == 1 )
\r
1188 UBaseType_t uxDummy10[ 2 ];
\r
1190 #if ( configUSE_MUTEXES == 1 )
\r
1191 UBaseType_t uxDummy12[ 2 ];
\r
1193 #if ( configUSE_APPLICATION_TASK_TAG == 1 )
\r
1196 #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
\r
1197 void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
\r
1199 #if ( configGENERATE_RUN_TIME_STATS == 1 )
\r
1200 uint32_t ulDummy16;
\r
1202 #if ( configUSE_NEWLIB_REENTRANT == 1 )
\r
1203 struct _reent xDummy17;
\r
1205 #if ( configUSE_TASK_NOTIFICATIONS == 1 )
\r
1206 uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
\r
1207 uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];
\r
1209 #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )
\r
1210 uint8_t uxDummy20;
\r
1213 #if ( INCLUDE_xTaskAbortDelay == 1 )
\r
1214 uint8_t ucDummy21;
\r
1216 #if ( configUSE_POSIX_ERRNO == 1 )
\r
1222 * In line with software engineering best practice, especially when supplying a
\r
1223 * library that is likely to change in future versions, FreeRTOS implements a
\r
1224 * strict data hiding policy. This means the Queue structure used internally by
\r
1225 * FreeRTOS is not accessible to application code. However, if the application
\r
1226 * writer wants to statically allocate the memory required to create a queue
\r
1227 * then the size of the queue object needs to be known. The StaticQueue_t
\r
1228 * structure below is provided for this purpose. Its sizes and alignment
\r
1229 * requirements are guaranteed to match those of the genuine structure, no
\r
1230 * matter which architecture is being used, and no matter how the values in
\r
1231 * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope
\r
1232 * users will recognise that it would be unwise to make direct use of the
\r
1233 * structure members.
\r
1235 typedef struct xSTATIC_QUEUE
\r
1237 void * pvDummy1[ 3 ];
\r
1242 UBaseType_t uxDummy2;
\r
1245 StaticList_t xDummy3[ 2 ];
\r
1246 UBaseType_t uxDummy4[ 3 ];
\r
1247 uint8_t ucDummy5[ 2 ];
\r
1249 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
\r
1253 #if ( configUSE_QUEUE_SETS == 1 )
\r
1257 #if ( configUSE_TRACE_FACILITY == 1 )
\r
1258 UBaseType_t uxDummy8;
\r
1262 typedef StaticQueue_t StaticSemaphore_t;
\r
1265 * In line with software engineering best practice, especially when supplying a
\r
1266 * library that is likely to change in future versions, FreeRTOS implements a
\r
1267 * strict data hiding policy. This means the event group structure used
\r
1268 * internally by FreeRTOS is not accessible to application code. However, if
\r
1269 * the application writer wants to statically allocate the memory required to
\r
1270 * create an event group then the size of the event group object needs to be
\r
1271 * know. The StaticEventGroup_t structure below is provided for this purpose.
\r
1272 * Its sizes and alignment requirements are guaranteed to match those of the
\r
1273 * genuine structure, no matter which architecture is being used, and no matter
\r
1274 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat
\r
1275 * obfuscated in the hope users will recognise that it would be unwise to make
\r
1276 * direct use of the structure members.
\r
1278 typedef struct xSTATIC_EVENT_GROUP
\r
1280 TickType_t xDummy1;
\r
1281 StaticList_t xDummy2;
\r
1283 #if ( configUSE_TRACE_FACILITY == 1 )
\r
1284 UBaseType_t uxDummy3;
\r
1287 #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
\r
1290 } StaticEventGroup_t;
\r
1293 * In line with software engineering best practice, especially when supplying a
\r
1294 * library that is likely to change in future versions, FreeRTOS implements a
\r
1295 * strict data hiding policy. This means the software timer structure used
\r
1296 * internally by FreeRTOS is not accessible to application code. However, if
\r
1297 * the application writer wants to statically allocate the memory required to
\r
1298 * create a software timer then the size of the queue object needs to be known.
\r
1299 * The StaticTimer_t structure below is provided for this purpose. Its sizes
\r
1300 * and alignment requirements are guaranteed to match those of the genuine
\r
1301 * structure, no matter which architecture is being used, and no matter how the
\r
1302 * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in
\r
1303 * the hope users will recognise that it would be unwise to make direct use of
\r
1304 * the structure members.
\r
1306 typedef struct xSTATIC_TIMER
\r
1309 StaticListItem_t xDummy2;
\r
1310 TickType_t xDummy3;
\r
1312 TaskFunction_t pvDummy6;
\r
1313 #if ( configUSE_TRACE_FACILITY == 1 )
\r
1314 UBaseType_t uxDummy7;
\r
1320 * In line with software engineering best practice, especially when supplying a
\r
1321 * library that is likely to change in future versions, FreeRTOS implements a
\r
1322 * strict data hiding policy. This means the stream buffer structure used
\r
1323 * internally by FreeRTOS is not accessible to application code. However, if
\r
1324 * the application writer wants to statically allocate the memory required to
\r
1325 * create a stream buffer then the size of the stream buffer object needs to be
\r
1326 * known. The StaticStreamBuffer_t structure below is provided for this
\r
1327 * purpose. Its size and alignment requirements are guaranteed to match those
\r
1328 * of the genuine structure, no matter which architecture is being used, and
\r
1329 * no matter how the values in FreeRTOSConfig.h are set. Its contents are
\r
1330 * somewhat obfuscated in the hope users will recognise that it would be unwise
\r
1331 * to make direct use of the structure members.
\r
1333 typedef struct xSTATIC_STREAM_BUFFER
\r
1335 size_t uxDummy1[ 4 ];
\r
1336 void * pvDummy2[ 3 ];
\r
1338 #if ( configUSE_TRACE_FACILITY == 1 )
\r
1339 UBaseType_t uxDummy4;
\r
1341 } StaticStreamBuffer_t;
\r
1343 /* Message buffers are built on stream buffers. */
\r
1344 typedef StaticStreamBuffer_t StaticMessageBuffer_t;
\r
1346 /* *INDENT-OFF* */
\r
1347 #ifdef __cplusplus
\r
1352 #endif /* INC_FREERTOS_H */
\r