1 /* 2 * FreeRTOS Kernel V10.3.1 3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a copy 6 * of this software and associated documentation files (the "Software"), to deal 7 * in the Software without restriction, including without limitation the rights 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 * copies of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in 13 * all copies or substantial portions of the Software. 14 * 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, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 * 23 * http://www.FreeRTOS.org 24 * http://aws.amazon.com/freertos 25 * 26 * 1 tab == 4 spaces! 27 */ 28 29 #ifndef INC_FREERTOS_H 30 #define INC_FREERTOS_H 31 32 /* 33 * Include the generic headers required for the FreeRTOS port being used. 34 */ 35 #include <stddef.h> 36 37 /* 38 * If stdint.h cannot be located then: 39 * + If using GCC ensure the -nostdint options is *not* being used. 40 * + Ensure the project's include path includes the directory in which your 41 * compiler stores stdint.h. 42 * + Set any compiler options necessary for it to support C99, as technically 43 * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any 44 * other way). 45 * + The FreeRTOS download includes a simple stdint.h definition that can be 46 * used in cases where none is provided by the compiler. The files only 47 * contains the typedefs required to build FreeRTOS. Read the instructions 48 * in FreeRTOS/source/stdint.readme for more information. 49 */ 50 #include <stdint.h> /* READ COMMENT ABOVE. */ 51 52 #ifdef __cplusplus 53 extern "C" { 54 #endif 55 56 /* Application specific configuration options. */ 57 #include "FreeRTOSConfig.h" 58 59 /* Basic FreeRTOS definitions. */ 60 #include "projdefs.h" 61 62 /* Definitions specific to the port being used. */ 63 #include "portable.h" 64 65 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */ 66 #ifndef configUSE_NEWLIB_REENTRANT 67 # define configUSE_NEWLIB_REENTRANT 0 68 #endif 69 70 /* Required if struct _reent is used. */ 71 #if (configUSE_NEWLIB_REENTRANT == 1) 72 # include <reent.h> 73 #endif 74 /* 75 * Check all the required application specific macros have been defined. 76 * These macros are application specific and (as downloaded) are defined 77 * within FreeRTOSConfig.h. 78 */ 79 80 #ifndef configMINIMAL_STACK_SIZE 81 #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. 82 #endif 83 84 #ifndef configMAX_PRIORITIES 85 #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details. 86 #endif 87 88 #if configMAX_PRIORITIES < 1 89 # error configMAX_PRIORITIES must be defined to be greater than or equal to 1. 90 #endif 91 92 #ifndef configUSE_PREEMPTION 93 #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. 94 #endif 95 96 #ifndef configUSE_IDLE_HOOK 97 #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. 98 #endif 99 100 #ifndef configUSE_TICK_HOOK 101 #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. 102 #endif 103 104 #ifndef configUSE_16_BIT_TICKS 105 #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. 106 #endif 107 108 #ifndef configUSE_CO_ROUTINES 109 # define configUSE_CO_ROUTINES 0 110 #endif 111 112 #ifndef INCLUDE_vTaskPrioritySet 113 # define INCLUDE_vTaskPrioritySet 0 114 #endif 115 116 #ifndef INCLUDE_uxTaskPriorityGet 117 # define INCLUDE_uxTaskPriorityGet 0 118 #endif 119 120 #ifndef INCLUDE_vTaskDelete 121 # define INCLUDE_vTaskDelete 0 122 #endif 123 124 #ifndef INCLUDE_vTaskSuspend 125 # define INCLUDE_vTaskSuspend 0 126 #endif 127 128 #ifndef INCLUDE_vTaskDelayUntil 129 # define INCLUDE_vTaskDelayUntil 0 130 #endif 131 132 #ifndef INCLUDE_vTaskDelay 133 # define INCLUDE_vTaskDelay 0 134 #endif 135 136 #ifndef INCLUDE_xTaskGetIdleTaskHandle 137 # define INCLUDE_xTaskGetIdleTaskHandle 0 138 #endif 139 140 #ifndef INCLUDE_xTaskAbortDelay 141 # define INCLUDE_xTaskAbortDelay 0 142 #endif 143 144 #ifndef INCLUDE_xQueueGetMutexHolder 145 # define INCLUDE_xQueueGetMutexHolder 0 146 #endif 147 148 #ifndef INCLUDE_xSemaphoreGetMutexHolder 149 # define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder 150 #endif 151 152 #ifndef INCLUDE_xTaskGetHandle 153 # define INCLUDE_xTaskGetHandle 0 154 #endif 155 156 #ifndef INCLUDE_uxTaskGetStackHighWaterMark 157 # define INCLUDE_uxTaskGetStackHighWaterMark 0 158 #endif 159 160 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2 161 # define INCLUDE_uxTaskGetStackHighWaterMark2 0 162 #endif 163 164 #ifndef INCLUDE_eTaskGetState 165 # define INCLUDE_eTaskGetState 0 166 #endif 167 168 #ifndef INCLUDE_xTaskResumeFromISR 169 # define INCLUDE_xTaskResumeFromISR 1 170 #endif 171 172 #ifndef INCLUDE_xTimerPendFunctionCall 173 # define INCLUDE_xTimerPendFunctionCall 0 174 #endif 175 176 #ifndef INCLUDE_xTaskGetSchedulerState 177 # define INCLUDE_xTaskGetSchedulerState 0 178 #endif 179 180 #ifndef INCLUDE_xTaskGetCurrentTaskHandle 181 # define INCLUDE_xTaskGetCurrentTaskHandle 0 182 #endif 183 184 #if configUSE_CO_ROUTINES != 0 185 # ifndef configMAX_CO_ROUTINE_PRIORITIES 186 # error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1. 187 # endif 188 #endif 189 190 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK 191 # define configUSE_DAEMON_TASK_STARTUP_HOOK 0 192 #endif 193 194 #ifndef configUSE_APPLICATION_TASK_TAG 195 # define configUSE_APPLICATION_TASK_TAG 0 196 #endif 197 198 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS 199 # define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 200 #endif 201 202 #ifndef configUSE_RECURSIVE_MUTEXES 203 # define configUSE_RECURSIVE_MUTEXES 0 204 #endif 205 206 #ifndef configUSE_MUTEXES 207 # define configUSE_MUTEXES 0 208 #endif 209 210 #ifndef configUSE_TIMERS 211 # define configUSE_TIMERS 0 212 #endif 213 214 #ifndef configUSE_COUNTING_SEMAPHORES 215 # define configUSE_COUNTING_SEMAPHORES 0 216 #endif 217 218 #ifndef configUSE_ALTERNATIVE_API 219 # define configUSE_ALTERNATIVE_API 0 220 #endif 221 222 #ifndef portCRITICAL_NESTING_IN_TCB 223 # define portCRITICAL_NESTING_IN_TCB 0 224 #endif 225 226 #ifndef configMAX_TASK_NAME_LEN 227 # define configMAX_TASK_NAME_LEN 16 228 #endif 229 230 #ifndef configIDLE_SHOULD_YIELD 231 # define configIDLE_SHOULD_YIELD 1 232 #endif 233 234 #if configMAX_TASK_NAME_LEN < 1 235 #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h 236 #endif 237 238 #ifndef configASSERT 239 # define configASSERT(x) 240 # define configASSERT_DEFINED 0 241 #else 242 # define configASSERT_DEFINED 1 243 #endif 244 245 /* configPRECONDITION should be defined as configASSERT. 246 The CBMC proofs need a way to track assumptions and assertions. 247 A configPRECONDITION statement should express an implicit invariant or 248 assumption made. A configASSERT statement should express an invariant that must 249 hold explicit before calling the code. */ 250 #ifndef configPRECONDITION 251 # define configPRECONDITION(X) configASSERT(X) 252 # define configPRECONDITION_DEFINED 0 253 #else 254 # define configPRECONDITION_DEFINED 1 255 #endif 256 257 #ifndef portMEMORY_BARRIER 258 # define portMEMORY_BARRIER() 259 #endif 260 261 #ifndef portSOFTWARE_BARRIER 262 # define portSOFTWARE_BARRIER() 263 #endif 264 265 /* The timers module relies on xTaskGetSchedulerState(). */ 266 #if configUSE_TIMERS == 1 267 268 # ifndef configTIMER_TASK_PRIORITY 269 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined. 270 # endif /* configTIMER_TASK_PRIORITY */ 271 272 # ifndef configTIMER_QUEUE_LENGTH 273 #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined. 274 # endif /* configTIMER_QUEUE_LENGTH */ 275 276 # ifndef configTIMER_TASK_STACK_DEPTH 277 #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined. 278 # endif /* configTIMER_TASK_STACK_DEPTH */ 279 280 #endif /* configUSE_TIMERS */ 281 282 #ifndef portSET_INTERRUPT_MASK_FROM_ISR 283 # define portSET_INTERRUPT_MASK_FROM_ISR() 0 284 #endif 285 286 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR 287 # define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue) \ 288 (void)uxSavedStatusValue 289 #endif 290 291 #ifndef portCLEAN_UP_TCB 292 # define portCLEAN_UP_TCB(pxTCB) (void)pxTCB 293 #endif 294 295 #ifndef portPRE_TASK_DELETE_HOOK 296 # define portPRE_TASK_DELETE_HOOK(pvTaskToDelete, pxYieldPending) 297 #endif 298 299 #ifndef portSETUP_TCB 300 # define portSETUP_TCB(pxTCB) (void)pxTCB 301 #endif 302 303 #ifndef configQUEUE_REGISTRY_SIZE 304 # define configQUEUE_REGISTRY_SIZE 0U 305 #endif 306 307 #if (configQUEUE_REGISTRY_SIZE < 1) 308 # define vQueueAddToRegistry(xQueue, pcName) 309 # define vQueueUnregisterQueue(xQueue) 310 # define pcQueueGetName(xQueue) 311 #endif 312 313 #ifndef portPOINTER_SIZE_TYPE 314 # define portPOINTER_SIZE_TYPE uint32_t 315 #endif 316 317 /* Remove any unused trace macros. */ 318 #ifndef traceSTART 319 /* Used to perform any necessary initialisation - for example, open a file 320 into which trace is to be written. */ 321 # define traceSTART() 322 #endif 323 324 #ifndef traceEND 325 /* Use to close a trace, for example close a file into which trace has been 326 written. */ 327 # define traceEND() 328 #endif 329 330 #ifndef traceTASK_SWITCHED_IN 331 /* Called after a task has been selected to run. pxCurrentTCB holds a pointer 332 to the task control block of the selected task. */ 333 # define traceTASK_SWITCHED_IN() 334 #endif 335 336 #ifndef traceINCREASE_TICK_COUNT 337 /* Called before stepping the tick count after waking from tickless idle 338 sleep. */ 339 # define traceINCREASE_TICK_COUNT(x) 340 #endif 341 342 #ifndef traceLOW_POWER_IDLE_BEGIN 343 /* Called immediately before entering tickless idle. */ 344 # define traceLOW_POWER_IDLE_BEGIN() 345 #endif 346 347 #ifndef traceLOW_POWER_IDLE_END 348 /* Called when returning to the Idle task after a tickless idle. */ 349 # define traceLOW_POWER_IDLE_END() 350 #endif 351 352 #ifndef traceTASK_SWITCHED_OUT 353 /* Called before a task has been selected to run. pxCurrentTCB holds a pointer 354 to the task control block of the task being switched out. */ 355 # define traceTASK_SWITCHED_OUT() 356 #endif 357 358 #ifndef traceTASK_PRIORITY_INHERIT 359 /* Called when a task attempts to take a mutex that is already held by a 360 lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task 361 that holds the mutex. uxInheritedPriority is the priority the mutex holder 362 will inherit (the priority of the task that is attempting to obtain the 363 muted. */ 364 # define traceTASK_PRIORITY_INHERIT(pxTCBOfMutexHolder, uxInheritedPriority) 365 #endif 366 367 #ifndef traceTASK_PRIORITY_DISINHERIT 368 /* Called when a task releases a mutex, the holding of which had resulted in 369 the task inheriting the priority of a higher priority task. 370 pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the 371 mutex. uxOriginalPriority is the task's configured (base) priority. */ 372 # define traceTASK_PRIORITY_DISINHERIT( \ 373 pxTCBOfMutexHolder, uxOriginalPriority) 374 #endif 375 376 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE 377 /* Task is about to block because it cannot read from a 378 queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore 379 upon which the read was attempted. pxCurrentTCB points to the TCB of the 380 task that attempted the read. */ 381 # define traceBLOCKING_ON_QUEUE_RECEIVE(pxQueue) 382 #endif 383 384 #ifndef traceBLOCKING_ON_QUEUE_PEEK 385 /* Task is about to block because it cannot read from a 386 queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore 387 upon which the read was attempted. pxCurrentTCB points to the TCB of the 388 task that attempted the read. */ 389 # define traceBLOCKING_ON_QUEUE_PEEK(pxQueue) 390 #endif 391 392 #ifndef traceBLOCKING_ON_QUEUE_SEND 393 /* Task is about to block because it cannot write to a 394 queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore 395 upon which the write was attempted. pxCurrentTCB points to the TCB of the 396 task that attempted the write. */ 397 # define traceBLOCKING_ON_QUEUE_SEND(pxQueue) 398 #endif 399 400 #ifndef configCHECK_FOR_STACK_OVERFLOW 401 # define configCHECK_FOR_STACK_OVERFLOW 0 402 #endif 403 404 #ifndef configRECORD_STACK_HIGH_ADDRESS 405 # define configRECORD_STACK_HIGH_ADDRESS 0 406 #endif 407 408 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 409 # define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0 410 #endif 411 412 /* The following event macros are embedded in the kernel API calls. */ 413 414 #ifndef traceMOVED_TASK_TO_READY_STATE 415 # define traceMOVED_TASK_TO_READY_STATE(pxTCB) 416 #endif 417 418 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE 419 # define tracePOST_MOVED_TASK_TO_READY_STATE(pxTCB) 420 #endif 421 422 #ifndef traceQUEUE_CREATE 423 # define traceQUEUE_CREATE(pxNewQueue) 424 #endif 425 426 #ifndef traceQUEUE_CREATE_FAILED 427 # define traceQUEUE_CREATE_FAILED(ucQueueType) 428 #endif 429 430 #ifndef traceCREATE_MUTEX 431 # define traceCREATE_MUTEX(pxNewQueue) 432 #endif 433 434 #ifndef traceCREATE_MUTEX_FAILED 435 # define traceCREATE_MUTEX_FAILED() 436 #endif 437 438 #ifndef traceGIVE_MUTEX_RECURSIVE 439 # define traceGIVE_MUTEX_RECURSIVE(pxMutex) 440 #endif 441 442 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED 443 # define traceGIVE_MUTEX_RECURSIVE_FAILED(pxMutex) 444 #endif 445 446 #ifndef traceTAKE_MUTEX_RECURSIVE 447 # define traceTAKE_MUTEX_RECURSIVE(pxMutex) 448 #endif 449 450 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED 451 # define traceTAKE_MUTEX_RECURSIVE_FAILED(pxMutex) 452 #endif 453 454 #ifndef traceCREATE_COUNTING_SEMAPHORE 455 # define traceCREATE_COUNTING_SEMAPHORE() 456 #endif 457 458 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED 459 # define traceCREATE_COUNTING_SEMAPHORE_FAILED() 460 #endif 461 462 #ifndef traceQUEUE_SEND 463 # define traceQUEUE_SEND(pxQueue) 464 #endif 465 466 #ifndef traceQUEUE_SEND_FAILED 467 # define traceQUEUE_SEND_FAILED(pxQueue) 468 #endif 469 470 #ifndef traceQUEUE_RECEIVE 471 # define traceQUEUE_RECEIVE(pxQueue) 472 #endif 473 474 #ifndef traceQUEUE_PEEK 475 # define traceQUEUE_PEEK(pxQueue) 476 #endif 477 478 #ifndef traceQUEUE_PEEK_FAILED 479 # define traceQUEUE_PEEK_FAILED(pxQueue) 480 #endif 481 482 #ifndef traceQUEUE_PEEK_FROM_ISR 483 # define traceQUEUE_PEEK_FROM_ISR(pxQueue) 484 #endif 485 486 #ifndef traceQUEUE_RECEIVE_FAILED 487 # define traceQUEUE_RECEIVE_FAILED(pxQueue) 488 #endif 489 490 #ifndef traceQUEUE_SEND_FROM_ISR 491 # define traceQUEUE_SEND_FROM_ISR(pxQueue) 492 #endif 493 494 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED 495 # define traceQUEUE_SEND_FROM_ISR_FAILED(pxQueue) 496 #endif 497 498 #ifndef traceQUEUE_RECEIVE_FROM_ISR 499 # define traceQUEUE_RECEIVE_FROM_ISR(pxQueue) 500 #endif 501 502 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED 503 # define traceQUEUE_RECEIVE_FROM_ISR_FAILED(pxQueue) 504 #endif 505 506 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED 507 # define traceQUEUE_PEEK_FROM_ISR_FAILED(pxQueue) 508 #endif 509 510 #ifndef traceQUEUE_DELETE 511 # define traceQUEUE_DELETE(pxQueue) 512 #endif 513 514 #ifndef traceTASK_CREATE 515 # define traceTASK_CREATE(pxNewTCB) 516 #endif 517 518 #ifndef traceTASK_CREATE_FAILED 519 # define traceTASK_CREATE_FAILED() 520 #endif 521 522 #ifndef traceTASK_DELETE 523 # define traceTASK_DELETE(pxTaskToDelete) 524 #endif 525 526 #ifndef traceTASK_DELAY_UNTIL 527 # define traceTASK_DELAY_UNTIL(x) 528 #endif 529 530 #ifndef traceTASK_DELAY 531 # define traceTASK_DELAY() 532 #endif 533 534 #ifndef traceTASK_PRIORITY_SET 535 # define traceTASK_PRIORITY_SET(pxTask, uxNewPriority) 536 #endif 537 538 #ifndef traceTASK_SUSPEND 539 # define traceTASK_SUSPEND(pxTaskToSuspend) 540 #endif 541 542 #ifndef traceTASK_RESUME 543 # define traceTASK_RESUME(pxTaskToResume) 544 #endif 545 546 #ifndef traceTASK_RESUME_FROM_ISR 547 # define traceTASK_RESUME_FROM_ISR(pxTaskToResume) 548 #endif 549 550 #ifndef traceTASK_INCREMENT_TICK 551 # define traceTASK_INCREMENT_TICK(xTickCount) 552 #endif 553 554 #ifndef traceTIMER_CREATE 555 # define traceTIMER_CREATE(pxNewTimer) 556 #endif 557 558 #ifndef traceTIMER_CREATE_FAILED 559 # define traceTIMER_CREATE_FAILED() 560 #endif 561 562 #ifndef traceTIMER_COMMAND_SEND 563 # define traceTIMER_COMMAND_SEND( \ 564 xTimer, xMessageID, xMessageValueValue, xReturn) 565 #endif 566 567 #ifndef traceTIMER_EXPIRED 568 # define traceTIMER_EXPIRED(pxTimer) 569 #endif 570 571 #ifndef traceTIMER_COMMAND_RECEIVED 572 # define traceTIMER_COMMAND_RECEIVED(pxTimer, xMessageID, xMessageValue) 573 #endif 574 575 #ifndef traceMALLOC 576 # define traceMALLOC(pvAddress, uiSize) 577 #endif 578 579 #ifndef traceFREE 580 # define traceFREE(pvAddress, uiSize) 581 #endif 582 583 #ifndef traceEVENT_GROUP_CREATE 584 # define traceEVENT_GROUP_CREATE(xEventGroup) 585 #endif 586 587 #ifndef traceEVENT_GROUP_CREATE_FAILED 588 # define traceEVENT_GROUP_CREATE_FAILED() 589 #endif 590 591 #ifndef traceEVENT_GROUP_SYNC_BLOCK 592 # define traceEVENT_GROUP_SYNC_BLOCK( \ 593 xEventGroup, uxBitsToSet, uxBitsToWaitFor) 594 #endif 595 596 #ifndef traceEVENT_GROUP_SYNC_END 597 # define traceEVENT_GROUP_SYNC_END( \ 598 xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred) \ 599 (void)xTimeoutOccurred 600 #endif 601 602 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK 603 # define traceEVENT_GROUP_WAIT_BITS_BLOCK(xEventGroup, uxBitsToWaitFor) 604 #endif 605 606 #ifndef traceEVENT_GROUP_WAIT_BITS_END 607 # define traceEVENT_GROUP_WAIT_BITS_END( \ 608 xEventGroup, uxBitsToWaitFor, xTimeoutOccurred) \ 609 (void)xTimeoutOccurred 610 #endif 611 612 #ifndef traceEVENT_GROUP_CLEAR_BITS 613 # define traceEVENT_GROUP_CLEAR_BITS(xEventGroup, uxBitsToClear) 614 #endif 615 616 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR 617 # define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR(xEventGroup, uxBitsToClear) 618 #endif 619 620 #ifndef traceEVENT_GROUP_SET_BITS 621 # define traceEVENT_GROUP_SET_BITS(xEventGroup, uxBitsToSet) 622 #endif 623 624 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR 625 # define traceEVENT_GROUP_SET_BITS_FROM_ISR(xEventGroup, uxBitsToSet) 626 #endif 627 628 #ifndef traceEVENT_GROUP_DELETE 629 # define traceEVENT_GROUP_DELETE(xEventGroup) 630 #endif 631 632 #ifndef tracePEND_FUNC_CALL 633 # define tracePEND_FUNC_CALL( \ 634 xFunctionToPend, pvParameter1, ulParameter2, ret) 635 #endif 636 637 #ifndef tracePEND_FUNC_CALL_FROM_ISR 638 # define tracePEND_FUNC_CALL_FROM_ISR( \ 639 xFunctionToPend, pvParameter1, ulParameter2, ret) 640 #endif 641 642 #ifndef traceQUEUE_REGISTRY_ADD 643 # define traceQUEUE_REGISTRY_ADD(xQueue, pcQueueName) 644 #endif 645 646 #ifndef traceTASK_NOTIFY_TAKE_BLOCK 647 # define traceTASK_NOTIFY_TAKE_BLOCK() 648 #endif 649 650 #ifndef traceTASK_NOTIFY_TAKE 651 # define traceTASK_NOTIFY_TAKE() 652 #endif 653 654 #ifndef traceTASK_NOTIFY_WAIT_BLOCK 655 # define traceTASK_NOTIFY_WAIT_BLOCK() 656 #endif 657 658 #ifndef traceTASK_NOTIFY_WAIT 659 # define traceTASK_NOTIFY_WAIT() 660 #endif 661 662 #ifndef traceTASK_NOTIFY 663 # define traceTASK_NOTIFY() 664 #endif 665 666 #ifndef traceTASK_NOTIFY_FROM_ISR 667 # define traceTASK_NOTIFY_FROM_ISR() 668 #endif 669 670 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR 671 # define traceTASK_NOTIFY_GIVE_FROM_ISR() 672 #endif 673 674 #ifndef traceSTREAM_BUFFER_CREATE_FAILED 675 # define traceSTREAM_BUFFER_CREATE_FAILED(xIsMessageBuffer) 676 #endif 677 678 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED 679 # define traceSTREAM_BUFFER_CREATE_STATIC_FAILED(xReturn, xIsMessageBuffer) 680 #endif 681 682 #ifndef traceSTREAM_BUFFER_CREATE 683 # define traceSTREAM_BUFFER_CREATE(pxStreamBuffer, xIsMessageBuffer) 684 #endif 685 686 #ifndef traceSTREAM_BUFFER_DELETE 687 # define traceSTREAM_BUFFER_DELETE(xStreamBuffer) 688 #endif 689 690 #ifndef traceSTREAM_BUFFER_RESET 691 # define traceSTREAM_BUFFER_RESET(xStreamBuffer) 692 #endif 693 694 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND 695 # define traceBLOCKING_ON_STREAM_BUFFER_SEND(xStreamBuffer) 696 #endif 697 698 #ifndef traceSTREAM_BUFFER_SEND 699 # define traceSTREAM_BUFFER_SEND(xStreamBuffer, xBytesSent) 700 #endif 701 702 #ifndef traceSTREAM_BUFFER_SEND_FAILED 703 # define traceSTREAM_BUFFER_SEND_FAILED(xStreamBuffer) 704 #endif 705 706 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR 707 # define traceSTREAM_BUFFER_SEND_FROM_ISR(xStreamBuffer, xBytesSent) 708 #endif 709 710 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE 711 # define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE(xStreamBuffer) 712 #endif 713 714 #ifndef traceSTREAM_BUFFER_RECEIVE 715 # define traceSTREAM_BUFFER_RECEIVE(xStreamBuffer, xReceivedLength) 716 #endif 717 718 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED 719 # define traceSTREAM_BUFFER_RECEIVE_FAILED(xStreamBuffer) 720 #endif 721 722 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR 723 # define traceSTREAM_BUFFER_RECEIVE_FROM_ISR(xStreamBuffer, xReceivedLength) 724 #endif 725 726 #ifndef configGENERATE_RUN_TIME_STATS 727 # define configGENERATE_RUN_TIME_STATS 0 728 #endif 729 730 #if (configGENERATE_RUN_TIME_STATS == 1) 731 732 # ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS 733 #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. 734 # endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */ 735 736 # ifndef portGET_RUN_TIME_COUNTER_VALUE 737 # ifndef portALT_GET_RUN_TIME_COUNTER_VALUE 738 #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. 739 # endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */ 740 # endif /* portGET_RUN_TIME_COUNTER_VALUE */ 741 742 #endif /* configGENERATE_RUN_TIME_STATS */ 743 744 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS 745 # define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() 746 #endif 747 748 #ifndef configUSE_MALLOC_FAILED_HOOK 749 # define configUSE_MALLOC_FAILED_HOOK 0 750 #endif 751 752 #ifndef portPRIVILEGE_BIT 753 # define portPRIVILEGE_BIT ((UBaseType_t)0x00) 754 #endif 755 756 #ifndef portYIELD_WITHIN_API 757 # define portYIELD_WITHIN_API portYIELD 758 #endif 759 760 #ifndef portSUPPRESS_TICKS_AND_SLEEP 761 # define portSUPPRESS_TICKS_AND_SLEEP(xExpectedIdleTime) 762 #endif 763 764 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP 765 # define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2 766 #endif 767 768 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2 769 # error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2 770 #endif 771 772 #ifndef configUSE_TICKLESS_IDLE 773 # define configUSE_TICKLESS_IDLE 0 774 #endif 775 776 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING 777 # define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING(x) 778 #endif 779 780 #ifndef configPRE_SLEEP_PROCESSING 781 # define configPRE_SLEEP_PROCESSING(x) 782 #endif 783 784 #ifndef configPOST_SLEEP_PROCESSING 785 # define configPOST_SLEEP_PROCESSING(x) 786 #endif 787 788 #ifndef configUSE_QUEUE_SETS 789 # define configUSE_QUEUE_SETS 0 790 #endif 791 792 #ifndef portTASK_USES_FLOATING_POINT 793 # define portTASK_USES_FLOATING_POINT() 794 #endif 795 796 #ifndef portALLOCATE_SECURE_CONTEXT 797 # define portALLOCATE_SECURE_CONTEXT(ulSecureStackSize) 798 #endif 799 800 #ifndef portDONT_DISCARD 801 # define portDONT_DISCARD 802 #endif 803 804 #ifndef configUSE_TIME_SLICING 805 # define configUSE_TIME_SLICING 1 806 #endif 807 808 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 809 # define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0 810 #endif 811 812 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS 813 # define configUSE_STATS_FORMATTING_FUNCTIONS 0 814 #endif 815 816 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID 817 # define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() 818 #endif 819 820 #ifndef configUSE_TRACE_FACILITY 821 # define configUSE_TRACE_FACILITY 0 822 #endif 823 824 #ifndef mtCOVERAGE_TEST_MARKER 825 # define mtCOVERAGE_TEST_MARKER() 826 #endif 827 828 #ifndef mtCOVERAGE_TEST_DELAY 829 # define mtCOVERAGE_TEST_DELAY() 830 #endif 831 832 #ifndef portASSERT_IF_IN_ISR 833 # define portASSERT_IF_IN_ISR() 834 #endif 835 836 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION 837 # define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 838 #endif 839 840 #ifndef configAPPLICATION_ALLOCATED_HEAP 841 # define configAPPLICATION_ALLOCATED_HEAP 0 842 #endif 843 844 #ifndef configUSE_TASK_NOTIFICATIONS 845 # define configUSE_TASK_NOTIFICATIONS 1 846 #endif 847 848 #ifndef configUSE_POSIX_ERRNO 849 # define configUSE_POSIX_ERRNO 0 850 #endif 851 852 #ifndef portTICK_TYPE_IS_ATOMIC 853 # define portTICK_TYPE_IS_ATOMIC 0 854 #endif 855 856 #ifndef configSUPPORT_STATIC_ALLOCATION 857 /* Defaults to 0 for backward compatibility. */ 858 # define configSUPPORT_STATIC_ALLOCATION 0 859 #endif 860 861 #ifndef configSUPPORT_DYNAMIC_ALLOCATION 862 /* Defaults to 1 for backward compatibility. */ 863 # define configSUPPORT_DYNAMIC_ALLOCATION 1 864 #endif 865 866 #ifndef configSTACK_DEPTH_TYPE 867 /* Defaults to uint16_t for backward compatibility, but can be overridden 868 in FreeRTOSConfig.h if uint16_t is too restrictive. */ 869 # define configSTACK_DEPTH_TYPE uint16_t 870 #endif 871 872 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE 873 /* Defaults to size_t for backward compatibility, but can be overridden 874 in FreeRTOSConfig.h if lengths will always be less than the number of bytes 875 in a size_t. */ 876 # define configMESSAGE_BUFFER_LENGTH_TYPE size_t 877 #endif 878 879 /* Sanity check the configuration. */ 880 #if (configUSE_TICKLESS_IDLE != 0) 881 # if (INCLUDE_vTaskSuspend != 1) 882 # error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0 883 # endif /* INCLUDE_vTaskSuspend */ 884 #endif /* configUSE_TICKLESS_IDLE */ 885 886 #if ( \ 887 (configSUPPORT_STATIC_ALLOCATION == 0) && \ 888 (configSUPPORT_DYNAMIC_ALLOCATION == 0)) 889 # error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1. 890 #endif 891 892 #if ((configUSE_RECURSIVE_MUTEXES == 1) && (configUSE_MUTEXES != 1)) 893 # error configUSE_MUTEXES must be set to 1 to use recursive mutexes 894 #endif 895 896 #ifndef configINITIAL_TICK_COUNT 897 # define configINITIAL_TICK_COUNT 0 898 #endif 899 900 #if (portTICK_TYPE_IS_ATOMIC == 0) 901 /* Either variables of tick type cannot be read atomically, or 902 portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when 903 the tick count is returned to the standard critical section macros. */ 904 # define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL() 905 # define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL() 906 # define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() \ 907 portSET_INTERRUPT_MASK_FROM_ISR() 908 # define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR(x) \ 909 portCLEAR_INTERRUPT_MASK_FROM_ISR((x)) 910 #else 911 /* The tick type can be read atomically, so critical sections used when the 912 tick count is returned can be defined away. */ 913 # define portTICK_TYPE_ENTER_CRITICAL() 914 # define portTICK_TYPE_EXIT_CRITICAL() 915 # define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0 916 # define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR(x) (void)x 917 #endif 918 919 /* Definitions to allow backward compatibility with FreeRTOS versions prior to 920 V8 if desired. */ 921 #ifndef configENABLE_BACKWARD_COMPATIBILITY 922 # define configENABLE_BACKWARD_COMPATIBILITY 1 923 #endif 924 925 #ifndef configPRINTF 926 /* configPRINTF() was not defined, so define it away to nothing. To use 927 configPRINTF() then define it as follows (where MyPrintFunction() is 928 provided by the application writer): 929 930 void MyPrintFunction(const char *pcFormat, ... ); 931 #define configPRINTF( X ) MyPrintFunction X 932 933 Then call like a standard printf() function, but placing brackets around 934 all parameters so they are passed as a single parameter. For example: 935 configPRINTF( ("Value = %d", MyVariable) ); */ 936 # define configPRINTF(X) 937 #endif 938 939 #ifndef configMAX 940 /* The application writer has not provided their own MAX macro, so define 941 the following generic implementation. */ 942 # define configMAX(a, b) (((a) > (b)) ? (a) : (b)) 943 #endif 944 945 #ifndef configMIN 946 /* The application writer has not provided their own MAX macro, so define 947 the following generic implementation. */ 948 # define configMIN(a, b) (((a) < (b)) ? (a) : (b)) 949 #endif 950 951 #if configENABLE_BACKWARD_COMPATIBILITY == 1 952 # define eTaskStateGet eTaskGetState 953 # define portTickType TickType_t 954 # define xTaskHandle TaskHandle_t 955 # define xQueueHandle QueueHandle_t 956 # define xSemaphoreHandle SemaphoreHandle_t 957 # define xQueueSetHandle QueueSetHandle_t 958 # define xQueueSetMemberHandle QueueSetMemberHandle_t 959 # define xTimeOutType TimeOut_t 960 # define xMemoryRegion MemoryRegion_t 961 # define xTaskParameters TaskParameters_t 962 # define xTaskStatusType TaskStatus_t 963 # define xTimerHandle TimerHandle_t 964 # define xCoRoutineHandle CoRoutineHandle_t 965 # define pdTASK_HOOK_CODE TaskHookFunction_t 966 # define portTICK_RATE_MS portTICK_PERIOD_MS 967 # define pcTaskGetTaskName pcTaskGetName 968 # define pcTimerGetTimerName pcTimerGetName 969 # define pcQueueGetQueueName pcQueueGetName 970 # define vTaskGetTaskInfo vTaskGetInfo 971 # define xTaskGetIdleRunTimeCounter ulTaskGetIdleRunTimeCounter 972 973 /* Backward compatibility within the scheduler code only - these definitions 974 are not really required but are included for completeness. */ 975 # define tmrTIMER_CALLBACK TimerCallbackFunction_t 976 # define pdTASK_CODE TaskFunction_t 977 # define xListItem ListItem_t 978 # define xList List_t 979 980 /* For libraries that break the list data hiding, and access list structure 981 members directly (which is not supposed to be done). */ 982 # define pxContainer pvContainer 983 #endif /* configENABLE_BACKWARD_COMPATIBILITY */ 984 985 #if (configUSE_ALTERNATIVE_API != 0) 986 # error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0 987 #endif 988 989 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even 990 if floating point hardware is otherwise supported by the FreeRTOS port in use. 991 This constant is not supported by all FreeRTOS ports that include floating 992 point support. */ 993 #ifndef configUSE_TASK_FPU_SUPPORT 994 # define configUSE_TASK_FPU_SUPPORT 1 995 #endif 996 997 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is 998 currently used in ARMv8M ports. */ 999 #ifndef configENABLE_MPU 1000 # define configENABLE_MPU 0 1001 #endif 1002 1003 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is 1004 currently used in ARMv8M ports. */ 1005 #ifndef configENABLE_FPU 1006 # define configENABLE_FPU 1 1007 #endif 1008 1009 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it. 1010 This is currently used in ARMv8M ports. */ 1011 #ifndef configENABLE_TRUSTZONE 1012 # define configENABLE_TRUSTZONE 1 1013 #endif 1014 1015 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on 1016 the Secure Side only. */ 1017 #ifndef configRUN_FREERTOS_SECURE_ONLY 1018 # define configRUN_FREERTOS_SECURE_ONLY 0 1019 #endif 1020 1021 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using 1022 * dynamically allocated RAM, in which case when any task is deleted it is known 1023 * that both the task's stack and TCB need to be freed. Sometimes the 1024 * FreeRTOSConfig.h settings only allow a task to be created using statically 1025 * allocated RAM, in which case when any task is deleted it is known that 1026 * neither the task's stack or TCB should be freed. Sometimes the 1027 * FreeRTOSConfig.h settings allow a task to be created using either statically 1028 * or dynamically allocated RAM, in which case a member of the TCB is used to 1029 * record whether the stack and/or TCB were allocated statically or dynamically, 1030 * so when a task is deleted the RAM that was allocated dynamically is freed 1031 * again and no attempt is made to free the RAM that was allocated statically. 1032 * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for 1033 * a task to be created using either statically or dynamically allocated RAM. 1034 * Note that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created 1035 * with a statically allocated stack and a dynamically allocated TCB. 1036 * 1037 * The following table lists various combinations of portUSING_MPU_WRAPPERS, 1038 * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and 1039 * when it is possible to have both static and dynamic allocation: 1040 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+ 1041 * | MPU | Dynamic | Static | Available Functions | Possible 1042 * Allocations | Both Dynamic and | Need Free | | | | | | | 1043 * Static Possible | | 1044 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+ 1045 * | 0 | 0 | 1 | xTaskCreateStatic | TCB - Static, Stack 1046 * - Static | No | No | 1047 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| 1048 * | 0 | 1 | 0 | xTaskCreate | TCB - Dynamic, Stack 1049 * - Dynamic | No | Yes | 1050 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| 1051 * | 0 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, 1052 * Stack - Dynamic | Yes | Yes | | | | | 1053 * xTaskCreateStatic | 2. TCB - Static, Stack - Static | | | 1054 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| 1055 * | 1 | 0 | 1 | xTaskCreateStatic, | TCB - Static, Stack 1056 * - Static | No | No | | | | | 1057 * xTaskCreateRestrictedStatic | | | | 1058 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| 1059 * | 1 | 1 | 0 | xTaskCreate, | 1. TCB - Dynamic, 1060 * Stack - Dynamic | Yes | Yes | | | | | 1061 * xTaskCreateRestricted | 2. TCB - Dynamic, Stack - Static | | | 1062 * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------| 1063 * | 1 | 1 | 1 | xTaskCreate, | 1. TCB - Dynamic, 1064 * Stack - Dynamic | Yes | Yes | | | | | 1065 * xTaskCreateStatic, | 2. TCB - Dynamic, Stack - Static | | | | | 1066 * | | xTaskCreateRestricted, | 3. TCB - Static, Stack - Static | 1067 * | | | | | | xTaskCreateRestrictedStatic | | | | 1068 * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+ 1069 */ 1070 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE \ 1071 (((portUSING_MPU_WRAPPERS == 0) && \ 1072 (configSUPPORT_DYNAMIC_ALLOCATION == 1) && \ 1073 (configSUPPORT_STATIC_ALLOCATION == 1)) || \ 1074 ((portUSING_MPU_WRAPPERS == 1) && \ 1075 (configSUPPORT_DYNAMIC_ALLOCATION == 1))) 1076 1077 /* 1078 * In line with software engineering best practice, FreeRTOS implements a strict 1079 * data hiding policy, so the real structures used by FreeRTOS to maintain the 1080 * state of tasks, queues, semaphores, etc. are not accessible to the 1081 * application code. However, if the application writer wants to statically 1082 * allocate such an object then the size of the object needs to be know. Dummy 1083 * structures that are guaranteed to have the same size and alignment 1084 * requirements of the real objects are used for this purpose. The dummy list 1085 * and list item structures below are used for inclusion in such a dummy 1086 * structure. 1087 */ 1088 struct xSTATIC_LIST_ITEM { 1089 #if (configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1) 1090 TickType_t xDummy1; 1091 #endif 1092 TickType_t xDummy2; 1093 void *pvDummy3[4]; 1094 #if (configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1) 1095 TickType_t xDummy4; 1096 #endif 1097 }; 1098 typedef struct xSTATIC_LIST_ITEM StaticListItem_t; 1099 1100 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ 1101 struct xSTATIC_MINI_LIST_ITEM { 1102 #if (configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1) 1103 TickType_t xDummy1; 1104 #endif 1105 TickType_t xDummy2; 1106 void *pvDummy3[2]; 1107 }; 1108 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t; 1109 1110 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ 1111 typedef struct xSTATIC_LIST { 1112 #if (configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1) 1113 TickType_t xDummy1; 1114 #endif 1115 UBaseType_t uxDummy2; 1116 void *pvDummy3; 1117 StaticMiniListItem_t xDummy4; 1118 #if (configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1) 1119 TickType_t xDummy5; 1120 #endif 1121 } StaticList_t; 1122 1123 /* 1124 * In line with software engineering best practice, especially when supplying a 1125 * library that is likely to change in future versions, FreeRTOS implements a 1126 * strict data hiding policy. This means the Task structure used internally by 1127 * FreeRTOS is not accessible to application code. However, if the application 1128 * writer wants to statically allocate the memory required to create a task then 1129 * the size of the task object needs to be know. The StaticTask_t structure 1130 * below is provided for this purpose. Its sizes and alignment requirements are 1131 * guaranteed to match those of the genuine structure, no matter which 1132 * architecture is being used, and no matter how the values in FreeRTOSConfig.h 1133 * are set. Its contents are somewhat obfuscated in the hope users will 1134 * recognise that it would be unwise to make direct use of the structure 1135 * members. 1136 */ 1137 typedef struct xSTATIC_TCB { 1138 void *pxDummy1; 1139 #if (portUSING_MPU_WRAPPERS == 1) 1140 xMPU_SETTINGS xDummy2; 1141 #endif 1142 StaticListItem_t xDummy3[2]; 1143 UBaseType_t uxDummy5; 1144 void *pxDummy6; 1145 uint8_t ucDummy7[configMAX_TASK_NAME_LEN]; 1146 #if ((portSTACK_GROWTH > 0) || (configRECORD_STACK_HIGH_ADDRESS == 1)) 1147 void *pxDummy8; 1148 #endif 1149 #if (portCRITICAL_NESTING_IN_TCB == 1) 1150 UBaseType_t uxDummy9; 1151 #endif 1152 #if (configUSE_TRACE_FACILITY == 1) 1153 UBaseType_t uxDummy10[2]; 1154 #endif 1155 #if (configUSE_MUTEXES == 1) 1156 UBaseType_t uxDummy12[2]; 1157 #endif 1158 #if (configUSE_APPLICATION_TASK_TAG == 1) 1159 void *pxDummy14; 1160 #endif 1161 #if (configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0) 1162 void *pvDummy15[configNUM_THREAD_LOCAL_STORAGE_POINTERS]; 1163 #endif 1164 #if (configGENERATE_RUN_TIME_STATS == 1) 1165 uint32_t ulDummy16; 1166 #endif 1167 #if (configUSE_NEWLIB_REENTRANT == 1) 1168 struct _reent xDummy17; 1169 #endif 1170 #if (configUSE_TASK_NOTIFICATIONS == 1) 1171 uint32_t ulDummy18; 1172 uint8_t ucDummy19; 1173 #endif 1174 #if (tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0) 1175 uint8_t uxDummy20; 1176 #endif 1177 1178 #if (INCLUDE_xTaskAbortDelay == 1) 1179 uint8_t ucDummy21; 1180 #endif 1181 #if (configUSE_POSIX_ERRNO == 1) 1182 int iDummy22; 1183 #endif 1184 } StaticTask_t; 1185 1186 /* 1187 * In line with software engineering best practice, especially when supplying a 1188 * library that is likely to change in future versions, FreeRTOS implements a 1189 * strict data hiding policy. This means the Queue structure used internally by 1190 * FreeRTOS is not accessible to application code. However, if the application 1191 * writer wants to statically allocate the memory required to create a queue 1192 * then the size of the queue object needs to be know. The StaticQueue_t 1193 * structure below is provided for this purpose. Its sizes and alignment 1194 * requirements are guaranteed to match those of the genuine structure, no 1195 * matter which architecture is being used, and no matter how the values in 1196 * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope 1197 * users will recognise that it would be unwise to make direct use of the 1198 * structure members. 1199 */ 1200 typedef struct xSTATIC_QUEUE { 1201 void *pvDummy1[3]; 1202 1203 union { 1204 void *pvDummy2; 1205 UBaseType_t uxDummy2; 1206 } u; 1207 1208 StaticList_t xDummy3[2]; 1209 UBaseType_t uxDummy4[3]; 1210 uint8_t ucDummy5[2]; 1211 1212 #if ( \ 1213 (configSUPPORT_STATIC_ALLOCATION == 1) && \ 1214 (configSUPPORT_DYNAMIC_ALLOCATION == 1)) 1215 uint8_t ucDummy6; 1216 #endif 1217 1218 #if (configUSE_QUEUE_SETS == 1) 1219 void *pvDummy7; 1220 #endif 1221 1222 #if (configUSE_TRACE_FACILITY == 1) 1223 UBaseType_t uxDummy8; 1224 uint8_t ucDummy9; 1225 #endif 1226 1227 } StaticQueue_t; 1228 typedef StaticQueue_t StaticSemaphore_t; 1229 1230 /* 1231 * In line with software engineering best practice, especially when supplying a 1232 * library that is likely to change in future versions, FreeRTOS implements a 1233 * strict data hiding policy. This means the event group structure used 1234 * internally by FreeRTOS is not accessible to application code. However, if 1235 * the application writer wants to statically allocate the memory required to 1236 * create an event group then the size of the event group object needs to be 1237 * know. The StaticEventGroup_t structure below is provided for this purpose. 1238 * Its sizes and alignment requirements are guaranteed to match those of the 1239 * genuine structure, no matter which architecture is being used, and no matter 1240 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat 1241 * obfuscated in the hope users will recognise that it would be unwise to make 1242 * direct use of the structure members. 1243 */ 1244 typedef struct xSTATIC_EVENT_GROUP { 1245 TickType_t xDummy1; 1246 StaticList_t xDummy2; 1247 1248 #if (configUSE_TRACE_FACILITY == 1) 1249 UBaseType_t uxDummy3; 1250 #endif 1251 1252 #if ( \ 1253 (configSUPPORT_STATIC_ALLOCATION == 1) && \ 1254 (configSUPPORT_DYNAMIC_ALLOCATION == 1)) 1255 uint8_t ucDummy4; 1256 #endif 1257 1258 } StaticEventGroup_t; 1259 1260 /* 1261 * In line with software engineering best practice, especially when supplying a 1262 * library that is likely to change in future versions, FreeRTOS implements a 1263 * strict data hiding policy. This means the software timer structure used 1264 * internally by FreeRTOS is not accessible to application code. However, if 1265 * the application writer wants to statically allocate the memory required to 1266 * create a software timer then the size of the queue object needs to be know. 1267 * The StaticTimer_t structure below is provided for this purpose. Its sizes 1268 * and alignment requirements are guaranteed to match those of the genuine 1269 * structure, no matter which architecture is being used, and no matter how the 1270 * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in 1271 * the hope users will recognise that it would be unwise to make direct use of 1272 * the structure members. 1273 */ 1274 typedef struct xSTATIC_TIMER { 1275 void *pvDummy1; 1276 StaticListItem_t xDummy2; 1277 TickType_t xDummy3; 1278 void *pvDummy5; 1279 TaskFunction_t pvDummy6; 1280 #if (configUSE_TRACE_FACILITY == 1) 1281 UBaseType_t uxDummy7; 1282 #endif 1283 uint8_t ucDummy8; 1284 1285 } StaticTimer_t; 1286 1287 /* 1288 * In line with software engineering best practice, especially when supplying a 1289 * library that is likely to change in future versions, FreeRTOS implements a 1290 * strict data hiding policy. This means the stream buffer structure used 1291 * internally by FreeRTOS is not accessible to application code. However, if 1292 * the application writer wants to statically allocate the memory required to 1293 * create a stream buffer then the size of the stream buffer object needs to be 1294 * know. The StaticStreamBuffer_t structure below is provided for this purpose. 1295 * Its size and alignment requirements are guaranteed to match those of the 1296 * genuine structure, no matter which architecture is being used, and no matter 1297 * how the values in FreeRTOSConfig.h are set. Its contents are somewhat 1298 * obfuscated in the hope users will recognise that it would be unwise to make 1299 * direct use of the structure members. 1300 */ 1301 typedef struct xSTATIC_STREAM_BUFFER { 1302 size_t uxDummy1[4]; 1303 void *pvDummy2[3]; 1304 uint8_t ucDummy3; 1305 #if (configUSE_TRACE_FACILITY == 1) 1306 UBaseType_t uxDummy4; 1307 #endif 1308 } StaticStreamBuffer_t; 1309 1310 /* Message buffers are built on stream buffers. */ 1311 typedef StaticStreamBuffer_t StaticMessageBuffer_t; 1312 1313 #ifdef __cplusplus 1314 } 1315 #endif 1316 1317 #endif /* INC_FREERTOS_H */ 1318