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