|
39 | 39 | * generic file, if one is available.
|
40 | 40 | ******************************************************************************/
|
41 | 41 |
|
42 |
| -#ifndef __FREERTOS_CONFIG_H__ |
43 |
| -#define __FREERTOS_CONFIG_H__ |
| 42 | +#ifndef FREERTOS_CONFIG_H |
| 43 | +#define FREERTOS_CONFIG_H |
44 | 44 |
|
45 | 45 | /******************************************************************************/
|
46 | 46 | /* Hardware description related definitions. **********************************/
|
|
63 | 63 | * frequency, as normal, and configSYSTICK_CLOCK_HZ to the SysTick clock
|
64 | 64 | * frequency. Not used if left undefined.
|
65 | 65 | * The default value is undefined (commented out). If you need this value bring it
|
66 |
| - * back and set it to a suitable value */ |
| 66 | + * back and set it to a suitable value. */ |
67 | 67 |
|
68 | 68 | /*
|
69 | 69 | #define configSYSTICK_CLOCK_HZ [Platform specific]
|
|
79 | 79 |
|
80 | 80 | /* Set configUSE_PREEMPTION to 1 to use pre-emptive scheduling. Set
|
81 | 81 | * configUSE_PREEMPTION to 0 to use co-operative scheduling.
|
82 |
| - * See https://www.freertos.org/single-core-amp-smp-rtos-scheduling.html */ |
| 82 | + * See https://www.freertos.org/single-core-amp-smp-rtos-scheduling.html. */ |
83 | 83 | #define configUSE_PREEMPTION 1
|
84 | 84 |
|
85 | 85 | /* Set configUSE_TIME_SLICING to 1 to have the scheduler switch between Ready
|
86 | 86 | * state tasks of equal priority on every tick interrupt. Set
|
87 | 87 | * configUSE_TIME_SLICING to 0 to prevent the scheduler switching between Ready
|
88 | 88 | * state tasks just because there was a tick interrupt. See
|
89 |
| - * https://freertos.org/single-core-amp-smp-rtos-scheduling.html */ |
| 89 | + * https://freertos.org/single-core-amp-smp-rtos-scheduling.html. */ |
90 | 90 | #define configUSE_TIME_SLICING 0
|
91 | 91 |
|
92 | 92 | /* Set configUSE_PORT_OPTIMISED_TASK_SELECTION to 1 to select the next task to
|
|
162 | 162 | * Defaults to 0 if left undefined. */
|
163 | 163 | #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
|
164 | 164 |
|
| 165 | +/* When configUSE_MINI_LIST_ITEM is set to 0, MiniListItem_t and ListItem_t are |
| 166 | + * both the same. When configUSE_MINI_LIST_ITEM is set to 1, MiniListItem_t contains |
| 167 | + * 3 fewer fields than ListItem_t which saves some RAM at the cost of violating |
| 168 | + * strict aliasing rules which some compilers depend on for optimization. Defaults |
| 169 | + * to 1 if left undefined. */ |
| 170 | +#define configUSE_MINI_LIST_ITEM 1 |
| 171 | + |
165 | 172 | /* Sets the type used by the parameter to xTaskCreate() that specifies the stack
|
166 | 173 | * size of the task being created. The same type is used to return information
|
167 | 174 | * about stack usage in various other API calls. Defaults to size_t if left
|
168 | 175 | * undefined. */
|
169 | 176 | #define configSTACK_DEPTH_TYPE size_t
|
170 | 177 |
|
171 | 178 | /* configMESSAGE_BUFFER_LENGTH_TYPE sets the type used to store the length of
|
172 |
| - * each message written to a FreeRTOS message buffer (the length is also written to |
173 |
| - * the message buffer. Defaults to size_t if left undefined - but that may waste |
174 |
| - * space if messages never go above a length that could be held in a uint8_t. */ |
| 179 | + * each message written to a FreeRTOS message buffer (the length is also written to |
| 180 | + * the message buffer. Defaults to size_t if left undefined - but that may waste |
| 181 | + * space if messages never go above a length that could be held in a uint8_t. */ |
175 | 182 | #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
|
176 | 183 |
|
| 184 | +/* If configHEAP_CLEAR_MEMORY_ON_FREE is set to 1, then blocks of memory allocated |
| 185 | + * using pvPortMalloc() will be cleared (i.e. set to zero) when freed using |
| 186 | + * vPortFree(). Defaults to 0 if left undefined. */ |
| 187 | +#define configHEAP_CLEAR_MEMORY_ON_FREE 1 |
| 188 | + |
| 189 | +/* vTaskList and vTaskGetRunTimeStats APIs take a buffer as a parameter and assume |
| 190 | + * that the length of the buffer is configSTATS_BUFFER_MAX_LENGTH. Defaults to |
| 191 | + * 0xFFFF if left undefined. |
| 192 | + * New applications are recommended to use vTaskListTasks and |
| 193 | + * vTaskGetRunTimeStatistics APIs instead and supply the length of the buffer |
| 194 | + * explicitly to avoid memory corruption. */ |
| 195 | +#define configSTATS_BUFFER_MAX_LENGTH 0xFFFF |
| 196 | + |
177 | 197 | /* Set configUSE_NEWLIB_REENTRANT to 1 to have a newlib reent structure
|
178 | 198 | * allocated for each task. Set to 0 to not support newlib reent structures.
|
179 | 199 | * Default to 0 if left undefined.
|
|
194 | 214 | * build. Set to 0 to exclude software timer functionality from the build. The
|
195 | 215 | * FreeRTOS/source/timers.c source file must be included in the build if
|
196 | 216 | * configUSE_TIMERS is set to 1. Default to 0 if left undefined. See
|
197 |
| - * https://www.freertos.org/RTOS-software-timer.html */ |
| 217 | + * https://www.freertos.org/RTOS-software-timer.html. */ |
198 | 218 | #define configUSE_TIMERS 1
|
199 | 219 |
|
200 | 220 | /* configTIMER_TASK_PRIORITY sets the priority used by the timer task. Only
|
|
224 | 244 | * that create FreeRTOS objects (tasks, queues, etc.) using statically allocated
|
225 | 245 | * memory in the build. Set to 0 to exclude the ability to create statically
|
226 | 246 | * allocated objects from the build. Defaults to 0 if left undefined. See
|
227 |
| - * https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html */ |
| 247 | + * https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */ |
228 | 248 | #define configSUPPORT_STATIC_ALLOCATION 1
|
229 | 249 |
|
230 | 250 | /* Set configSUPPORT_DYNAMIC_ALLOCATION to 1 to include FreeRTOS API functions
|
231 | 251 | * that create FreeRTOS objects (tasks, queues, etc.) using dynamically allocated
|
232 | 252 | * memory in the build. Set to 0 to exclude the ability to create dynamically
|
233 | 253 | * allocated objects from the build. Defaults to 1 if left undefined. See
|
234 |
| - * https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html */ |
| 254 | + * https://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html. */ |
235 | 255 | #define configSUPPORT_DYNAMIC_ALLOCATION 1
|
236 | 256 |
|
237 | 257 | /* Sets the total size of the FreeRTOS heap, in bytes, when heap_1.c, heap_2.c
|
238 | 258 | * or heap_4.c are included in the build. This value is defaulted to 4096 bytes but
|
239 | 259 | * it must be tailored to each application. Note the heap will appear in the .bss
|
240 |
| - * section. See https://www.freertos.org/a00111.html */ |
| 260 | + * section. See https://www.freertos.org/a00111.html. */ |
241 | 261 | #define configTOTAL_HEAP_SIZE 4096
|
242 | 262 |
|
243 | 263 | /* Set configAPPLICATION_ALLOCATED_HEAP to 1 to have the application allocate
|
|
253 | 273 | * Defaults to 0 if left undefined. */
|
254 | 274 | #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
255 | 275 |
|
| 276 | +/* Set configENABLE_HEAP_PROTECTOR to 1 to enable bounds checking and obfuscation |
| 277 | + * to internal heap block pointers in heap_4.c and heap_5.c to help catch pointer |
| 278 | + * corruptions. Defaults to 0 if left undefined. */ |
| 279 | +#define configENABLE_HEAP_PROTECTOR 0 |
| 280 | + |
256 | 281 | /******************************************************************************/
|
257 | 282 | /* Interrupt nesting behaviour configuration. *********************************/
|
258 | 283 | /******************************************************************************/
|
|
283 | 308 | /* Set the following configUSE_* constants to 1 to include the named hook
|
284 | 309 | * functionality in the build. Set to 0 to exclude the hook functionality from the
|
285 | 310 | * build. The application writer is responsible for providing the hook function
|
286 |
| - * for any set to 1. See https://www.freertos.org/a00016.html */ |
| 311 | + * for any set to 1. See https://www.freertos.org/a00016.html. */ |
287 | 312 | #define configUSE_IDLE_HOOK 0
|
288 | 313 | #define configUSE_TICK_HOOK 0
|
289 | 314 | #define configUSE_MALLOC_FAILED_HOOK 0
|
290 | 315 | #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
|
291 | 316 |
|
| 317 | +/* Set configUSE_SB_COMPLETED_CALLBACK to 1 to have send and receive completed |
| 318 | + * callbacks for each instance of a stream buffer or message buffer. When the |
| 319 | + * option is set to 1, APIs xStreamBufferCreateWithCallback() and |
| 320 | + * xStreamBufferCreateStaticWithCallback() (and likewise APIs for message |
| 321 | + * buffer) can be used to create a stream buffer or message buffer instance |
| 322 | + * with application provided callbacks. Defaults to 0 if left undefined. */ |
| 323 | +#define configUSE_SB_COMPLETED_CALLBACK 0 |
| 324 | + |
292 | 325 | /* Set configCHECK_FOR_STACK_OVERFLOW to 1 or 2 for FreeRTOS to check for a
|
293 | 326 | * stack overflow at the time of a context switch. Set to 0 to not look for a
|
294 | 327 | * stack overflow. If configCHECK_FOR_STACK_OVERFLOW is 1 then the check only
|
|
307 | 340 | /******************************************************************************/
|
308 | 341 |
|
309 | 342 | /* Set configGENERATE_RUN_TIME_STATS to 1 to have FreeRTOS collect data on the
|
310 |
| -* processing time used by each task. Set to 0 to not collect the data. The |
311 |
| -* application writer needs to provide a clock source if set to 1. Defaults to 0 |
312 |
| -* if left undefined. See https://www.freertos.org/rtos-run-time-stats.html */ |
| 343 | + * processing time used by each task. Set to 0 to not collect the data. The |
| 344 | + * application writer needs to provide a clock source if set to 1. Defaults to 0 |
| 345 | + * if left undefined. See https://www.freertos.org/rtos-run-time-stats.html. */ |
313 | 346 | #define configGENERATE_RUN_TIME_STATS 0
|
314 | 347 |
|
315 | 348 | /* Set configUSE_TRACE_FACILITY to include additional task structure members
|
316 | 349 | * are used by trace and visualisation functions and tools. Set to 0 to exclude
|
317 |
| - * the additional information from the structures. Defaults to 0 if left |
| 350 | + * the additional information from the structures. Defaults to 0 if left |
318 | 351 | * undefined. */
|
319 | 352 | #define configUSE_TRACE_FACILITY 0
|
320 | 353 |
|
|
325 | 358 | * undefined. */
|
326 | 359 | #define configUSE_STATS_FORMATTING_FUNCTIONS 0
|
327 | 360 |
|
| 361 | +/******************************************************************************/ |
| 362 | +/* Co-routine related definitions. ********************************************/ |
| 363 | +/******************************************************************************/ |
| 364 | + |
| 365 | +/* Set configUSE_CO_ROUTINES to 1 to include co-routine functionality in the |
| 366 | + * build, or 0 to omit co-routine functionality from the build. To include |
| 367 | + * co-routines, croutine.c must be included in the project. Defaults to 0 if left |
| 368 | + * undefined. */ |
| 369 | +#define configUSE_CO_ROUTINES 0 |
| 370 | + |
| 371 | +/* configMAX_CO_ROUTINE_PRIORITIES defines the number of priorities available |
| 372 | + * to the application co-routines. Any number of co-routines can share the same |
| 373 | + * priority. Defaults to 0 if left undefined. */ |
| 374 | +#define configMAX_CO_ROUTINE_PRIORITIES 1 |
| 375 | + |
328 | 376 | /******************************************************************************/
|
329 | 377 | /* Debugging assistance. ******************************************************/
|
330 | 378 | /******************************************************************************/
|
|
346 | 394 | }
|
347 | 395 |
|
348 | 396 | /******************************************************************************/
|
349 |
| -/* Cortex-M MPU specific definitions. *****************************************/ |
| 397 | +/* FreeRTOS MPU specific definitions. *****************************************/ |
350 | 398 | /******************************************************************************/
|
351 | 399 |
|
352 | 400 | /* If configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS is set to 1 then
|
|
380 | 428 | * escalations originating from outside of the kernel code itself. Set to 1 to
|
381 | 429 | * allow application tasks to raise privilege. Defaults to 1 if left undefined.
|
382 | 430 | * Only used by the FreeRTOS Cortex-M MPU ports, not the standard ARMv7-M Cortex-M
|
383 |
| - * port.*/ |
| 431 | + * port. */ |
384 | 432 | #define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1
|
385 | 433 |
|
386 | 434 | /* Set configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS to 1 to allow unprivileged
|
387 | 435 | * tasks enter critical sections (effectively mask interrupts). Set to 0 to
|
388 | 436 | * prevent unprivileged tasks entering critical sections. Defaults to 1 if left
|
389 | 437 | * undefined. Only used by the FreeRTOS Cortex-M MPU ports, not the standard
|
390 |
| - * ARMv7-M Cortex-M port.*/ |
| 438 | + * ARMv7-M Cortex-M port. */ |
391 | 439 | #define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0
|
392 | 440 |
|
| 441 | +/* FreeRTOS Kernel version 10.6.0 introduced a new v2 MPU wrapper, namely |
| 442 | + * mpu_wrappers_v2.c. Set configUSE_MPU_WRAPPERS_V1 to 0 to use the new v2 MPU |
| 443 | + * wrapper. Set configUSE_MPU_WRAPPERS_V1 to 1 to use the old v1 MPU wrapper |
| 444 | + * (mpu_wrappers.c). Defaults to 0 if left undefined. */ |
| 445 | +#define configUSE_MPU_WRAPPERS_V1 0 |
| 446 | + |
| 447 | +/* When using the v2 MPU wrapper, set configPROTECTED_KERNEL_OBJECT_POOL_SIZE to |
| 448 | + * the total number of kernel objects, which includes tasks, queues, semaphores, |
| 449 | + * mutexes, event groups, timers, stream buffers and message buffers, in your |
| 450 | + * application. The application will not be able to have more than |
| 451 | + * configPROTECTED_KERNEL_OBJECT_POOL_SIZE kernel objects at any point of |
| 452 | + * time. */ |
| 453 | +#define configPROTECTED_KERNEL_OBJECT_POOL_SIZE 10 |
| 454 | + |
| 455 | +/* When using the v2 MPU wrapper, set configSYSTEM_CALL_STACK_SIZE to the size |
| 456 | + * of the system call stack in words. Each task has a statically allocated |
| 457 | + * memory buffer of this size which is used as the stack to execute system |
| 458 | + * calls. For example, if configSYSTEM_CALL_STACK_SIZE is defined as 128 and |
| 459 | + * there are 10 tasks in the application, the total amount of memory used for |
| 460 | + * system call stacks is 128 * 10 = 1280 words. */ |
| 461 | +#define configSYSTEM_CALL_STACK_SIZE 128 |
| 462 | + |
| 463 | +/* When using the v2 MPU wrapper, set configENABLE_ACCESS_CONTROL_LIST to 1 to |
| 464 | + * enable Access Control List (ACL) feature. When ACL is enabled, an |
| 465 | + * unprivileged task by default does not have access to any kernel object other |
| 466 | + * than itself. The application writer needs to explicitly grant the |
| 467 | + * unprivileged task access to the kernel objects it needs using the APIs |
| 468 | + * provided for the same. Defaults to 0 if left undefined. */ |
| 469 | +#define configENABLE_ACCESS_CONTROL_LIST 1 |
| 470 | + |
| 471 | +/******************************************************************************/ |
| 472 | +/* SMP( Symmetric MultiProcessing ) Specific Configuration definitions. *******/ |
| 473 | +/******************************************************************************/ |
| 474 | + |
| 475 | +/* Set configNUMBER_OF_CORES to the number of available processor cores. Defaults |
| 476 | + * to 1 if left undefined. */ |
| 477 | + |
| 478 | +/* |
| 479 | + #define configNUMBER_OF_CORES [Num of available cores] |
| 480 | + */ |
| 481 | + |
| 482 | +/* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set |
| 483 | + * configRUN_MULTIPLE_PRIORITIES to 0 to allow multiple tasks to run |
| 484 | + * simultaneously only if they do not have equal priority, thereby maintaining |
| 485 | + * the paradigm of a lower priority task never running if a higher priority task |
| 486 | + * is able to run. If configRUN_MULTIPLE_PRIORITIES is set to 1, multiple tasks |
| 487 | + * with different priorities may run simultaneously - so a higher and lower |
| 488 | + * priority task may run on different cores at the same time. */ |
| 489 | +#define configRUN_MULTIPLE_PRIORITIES 0 |
| 490 | + |
| 491 | +/* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set |
| 492 | + * configUSE_CORE_AFFINITY to 1 to enable core affinity feature. When core |
| 493 | + * affinity feature is enabled, the vTaskCoreAffinitySet and vTaskCoreAffinityGet |
| 494 | + * APIs can be used to set and retrieve which cores a task can run on. If |
| 495 | + * configUSE_CORE_AFFINITY is set to 0 then the FreeRTOS scheduler is free to |
| 496 | + * run any task on any available core. */ |
| 497 | +#define configUSE_CORE_AFFINITY 0 |
| 498 | + |
| 499 | +/* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), if |
| 500 | + * configUSE_TASK_PREEMPTION_DISABLE is set to 1, individual tasks can be set to |
| 501 | + * either pre-emptive or co-operative mode using the vTaskPreemptionDisable and |
| 502 | + * vTaskPreemptionEnable APIs. */ |
| 503 | +#define configUSE_TASK_PREEMPTION_DISABLE 0 |
| 504 | + |
| 505 | +/* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set |
| 506 | + * configUSE_PASSIVE_IDLE_HOOK to 1 to allow the application writer to use |
| 507 | + * the passive idle task hook to add background functionality without the overhead |
| 508 | + * of a separate task. Defaults to 0 if left undefined. */ |
| 509 | +#define configUSE_PASSIVE_IDLE_HOOK 0 |
| 510 | + |
| 511 | +/* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), |
| 512 | + * configTIMER_SERVICE_TASK_CORE_AFFINITY allows the application writer to set |
| 513 | + * the core affinity of the RTOS Daemon/Timer Service task. Defaults to |
| 514 | + * tskNO_AFFINITY if left undefined. */ |
| 515 | +#define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY |
| 516 | + |
| 517 | + |
393 | 518 | /******************************************************************************/
|
394 | 519 | /* ARMv8-M secure side port related definitions. ******************************/
|
395 | 520 | /******************************************************************************/
|
|
440 | 565 | #define INCLUDE_xTaskGetHandle 0
|
441 | 566 | #define INCLUDE_xTaskResumeFromISR 1
|
442 | 567 |
|
443 |
| -#endif /* __FREERTOS_CONFIG_H__ */ |
| 568 | +#endif /* FREERTOS_CONFIG_H */ |
0 commit comments