Skip to content

Commit 4b51b12

Browse files
anand16158AniruddhaKanhere
authored andcommitted
Add missing configuration macros to FreeRTOSConfig.h template
Add 16 documented configuration macros that were missing from the template: configINITIAL_TICK_COUNT, configEXPECTED_IDLE_TIME_BEFORE_SLEEP, tickless idle hooks, configRECORD_STACK_HIGH_ADDRESS, configRUN_TIME_COUNTER_TYPE, configUSE_PICOLIBC_TLS, configUSE_C_RUNTIME_TLS_SUPPORT, configUSE_TASK_FPU_SUPPORT, configPRINTF, configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H, and four INCLUDE_* API toggles. Refs FreeRTOS/FreeRTOS#65
1 parent d1f551e commit 4b51b12

1 file changed

Lines changed: 83 additions & 15 deletions

File tree

examples/template_configuration/FreeRTOSConfig.h

Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,22 @@
106106
* undefined. */
107107
#define configUSE_TICKLESS_IDLE 0
108108

109+
/* configEXPECTED_IDLE_TIME_BEFORE_SLEEP sets the minimum number of idle ticks
110+
* that must pass before the kernel will consider entering tickless idle mode.
111+
* Must be >= 2. Defaults to 2 if left undefined. Only meaningful when
112+
* configUSE_TICKLESS_IDLE is set to 1. */
113+
#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
114+
115+
/* The following optional macros allow the application to hook into the tickless
116+
* idle mechanism for platform-specific low-power management. Define as needed
117+
* for your hardware. Not used if left undefined. */
118+
119+
/*
120+
#define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( xExpectedIdleTime )
121+
#define configPRE_SLEEP_PROCESSING( xExpectedIdleTime )
122+
#define configPOST_SLEEP_PROCESSING( xExpectedIdleTime )
123+
*/
124+
109125
/* configMAX_PRIORITIES Sets the number of available task priorities. Tasks can
110126
* be assigned priorities of 0 to (configMAX_PRIORITIES - 1). Zero is the
111127
* lowest priority. */
@@ -144,6 +160,12 @@
144160
* Default to 1 if left undefined. */
145161
#define configIDLE_SHOULD_YIELD 1
146162

163+
/* configINITIAL_TICK_COUNT sets the initial value of the RTOS tick counter.
164+
* Normally 0. Can be set to a value close to the maximum of TickType_t
165+
* (e.g. 0xFFFFFF00) to test tick counter overflow handling in your
166+
* application. Defaults to 0 if left undefined. */
167+
#define configINITIAL_TICK_COUNT 0
168+
147169
/* Each task has an array of task notifications.
148170
* configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in the
149171
* array. See https://www.freertos.org/RTOS-task-notifications.html Defaults to
@@ -187,6 +209,11 @@
187209
* uint8_t. */
188210
#define configMESSAGE_BUFFER_LENGTH_TYPE size_t
189211

212+
/* Set configRECORD_STACK_HIGH_ADDRESS to 1 to record the top (highest) address
213+
* of the task's stack in the TCB. This is useful for debugger stack backtrace
214+
* support. Defaults to 0 if left undefined. */
215+
#define configRECORD_STACK_HIGH_ADDRESS 0
216+
190217
/* If configHEAP_CLEAR_MEMORY_ON_FREE is set to 1, then blocks of memory
191218
* allocated using pvPortMalloc() will be cleared (i.e. set to zero) when freed
192219
* using vPortFree(). Defaults to 0 if left undefined. */
@@ -211,6 +238,17 @@
211238
* that must be provided with locks. */
212239
#define configUSE_NEWLIB_REENTRANT 0
213240

241+
/* Set configUSE_PICOLIBC_TLS to 1 to enable picolibc thread-local storage
242+
* (TLS) integration. When enabled, each task will have its own TLS block
243+
* managed by the kernel. Defaults to 0 if left undefined. */
244+
#define configUSE_PICOLIBC_TLS 0
245+
246+
/* Set configUSE_C_RUNTIME_TLS_SUPPORT to 1 to enable generic C runtime TLS
247+
* support. When enabled, the application must also define configTLS_BLOCK_TYPE,
248+
* configINIT_TLS_BLOCK, configSET_TLS_BLOCK, and configDEINIT_TLS_BLOCK.
249+
* Defaults to 0 if left undefined. */
250+
#define configUSE_C_RUNTIME_TLS_SUPPORT 0
251+
214252
/******************************************************************************/
215253
/* Software timer related definitions. ****************************************/
216254
/******************************************************************************/
@@ -375,6 +413,11 @@
375413
*/
376414
#define configGENERATE_RUN_TIME_STATS 0
377415

416+
/* configRUN_TIME_COUNTER_TYPE sets the integer type used to hold run-time
417+
* statistic counters. Defaults to uint32_t if left undefined. Use uint64_t
418+
* if your timer counter can exceed 32 bits. */
419+
#define configRUN_TIME_COUNTER_TYPE uint32_t
420+
378421
/* Set configUSE_TRACE_FACILITY to include additional task structure members
379422
* are used by trace and visualisation functions and tools. Set to 0 to exclude
380423
* the additional information from the structures. Defaults to 0 if left
@@ -426,6 +469,15 @@
426469
}
427470
/* *INDENT-ON* */
428471

472+
/* configPRINTF is an optional macro that wraps the application-provided print
473+
* function. It is used by some FreeRTOS libraries for debug logging. Define
474+
* it to call your platform's printf or logging function. Not used if left
475+
* undefined. */
476+
477+
/*
478+
#define configPRINTF( X ) printf X
479+
*/
480+
429481
/******************************************************************************/
430482
/* FreeRTOS MPU specific definitions. *****************************************/
431483
/******************************************************************************/
@@ -608,6 +660,12 @@
608660
* Cortex-M23,Cortex-M33 and Cortex-M35P ports. */
609661
#define configENABLE_MVE 1
610662

663+
/* configUSE_TASK_FPU_SUPPORT controls per-task FPU context management:
664+
* 1 = Every task starts with an FPU context (safe default).
665+
* 2 = FPU context is allocated lazily on first FPU instruction (saves RAM).
666+
* Not all ports support this option. Defaults to 1 if left undefined. */
667+
#define configUSE_TASK_FPU_SUPPORT 1
668+
611669
/******************************************************************************/
612670
/* ARMv7-M and ARMv8-M port Specific Configuration definitions. ***************/
613671
/******************************************************************************/
@@ -646,23 +704,33 @@
646704
* contain the most recent error for that task. */
647705
#define configUSE_POSIX_ERRNO 0
648706

707+
/* Set configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H to 1 to include the header
708+
* "freertos_tasks_c_additions.h" at the bottom of tasks.c. This allows the
709+
* application to add extra functions or variables to tasks.c (e.g. for
710+
* debugger integration). Defaults to 0 if left undefined. */
711+
#define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0
712+
649713
/* Set the following INCLUDE_* constants to 1 to include the named API function,
650714
* or 0 to exclude the named API function. Most linkers will remove unused
651715
* functions even when the constant is 1. */
652-
#define INCLUDE_vTaskPrioritySet 1
653-
#define INCLUDE_uxTaskPriorityGet 1
654-
#define INCLUDE_vTaskDelete 1
655-
#define INCLUDE_vTaskSuspend 1
656-
#define INCLUDE_xTaskDelayUntil 1
657-
#define INCLUDE_vTaskDelay 1
658-
#define INCLUDE_xTaskGetSchedulerState 1
659-
#define INCLUDE_xTaskGetCurrentTaskHandle 1
660-
#define INCLUDE_uxTaskGetStackHighWaterMark 0
661-
#define INCLUDE_xTaskGetIdleTaskHandle 0
662-
#define INCLUDE_eTaskGetState 0
663-
#define INCLUDE_xTimerPendFunctionCall 0
664-
#define INCLUDE_xTaskAbortDelay 0
665-
#define INCLUDE_xTaskGetHandle 0
666-
#define INCLUDE_xTaskResumeFromISR 1
716+
#define INCLUDE_vTaskPrioritySet 1
717+
#define INCLUDE_uxTaskPriorityGet 1
718+
#define INCLUDE_vTaskDelete 1
719+
#define INCLUDE_vTaskSuspend 1
720+
#define INCLUDE_xTaskDelayUntil 1
721+
#define INCLUDE_vTaskDelay 1
722+
#define INCLUDE_xTaskGetSchedulerState 1
723+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
724+
#define INCLUDE_uxTaskGetStackHighWaterMark 0
725+
#define INCLUDE_uxTaskGetStackHighWaterMark2 0
726+
#define INCLUDE_xTaskGetIdleTaskHandle 0
727+
#define INCLUDE_eTaskGetState 0
728+
#define INCLUDE_xTimerPendFunctionCall 0
729+
#define INCLUDE_xTaskAbortDelay 0
730+
#define INCLUDE_xTaskGetHandle 0
731+
#define INCLUDE_xTaskResumeFromISR 1
732+
#define INCLUDE_xQueueGetMutexHolder 0
733+
#define INCLUDE_xSemaphoreGetMutexHolder 0
734+
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
667735

668736
#endif /* FREERTOS_CONFIG_H */

0 commit comments

Comments
 (0)