Skip to content

Commit 48c4c20

Browse files
authored
Allow reconfiguring individual FreeRTOS config items - fixes #2398 (#2407)
1 parent 6a5f98c commit 48c4c20

File tree

1 file changed

+137
-1
lines changed

1 file changed

+137
-1
lines changed

libraries/FreeRTOS/src/FreeRTOSConfig.h

Lines changed: 137 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,231 @@
1+
#ifndef configNUMBER_OF_CORES
12
#define configNUMBER_OF_CORES 2
3+
#endif
4+
#ifndef configUSE_CORE_AFFINITY
25
#define configUSE_CORE_AFFINITY 1
6+
#endif
7+
#ifndef configRUN_MULTIPLE_PRIORITIES
38
#define configRUN_MULTIPLE_PRIORITIES 1
9+
#endif
410

11+
#ifndef configUSE_PREEMPTION
512
#define configUSE_PREEMPTION 1
13+
#endif
14+
#ifndef configUSE_IDLE_HOOK
615
#define configUSE_IDLE_HOOK 1
16+
#endif
17+
#ifndef configUSE_PASSIVE_IDLE_HOOK
718
#define configUSE_PASSIVE_IDLE_HOOK 1
19+
#endif
20+
#ifndef configUSE_TICK_HOOK
821
#define configUSE_TICK_HOOK 1
22+
#endif
23+
#ifndef configCPU_CLOCK_HZ
924
#define configCPU_CLOCK_HZ ( ( unsigned long ) F_CPU )
25+
#endif
26+
#ifndef configTICK_RATE_HZ
1027
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
28+
#endif
29+
#ifndef configMAX_PRIORITIES
1130
#define configMAX_PRIORITIES ( 8 )
31+
#endif
32+
#ifndef configMINIMAL_STACK_SIZE
1233
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
34+
#endif
35+
#ifndef configTOTAL_HEAP_SIZE
1336
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 164 * 1024 ) )
37+
#endif
38+
#ifndef configMAX_TASK_NAME_LEN
1439
#define configMAX_TASK_NAME_LEN ( 10 )
40+
#endif
41+
#ifndef configUSE_TRACE_FACILITY
1542
#define configUSE_TRACE_FACILITY 1
43+
#endif
44+
#ifndef configUSE_16_BIT_TICKS
1645
#define configUSE_16_BIT_TICKS 0
46+
#endif
47+
#ifndef configIDLE_SHOULD_YIELD
1748
#define configIDLE_SHOULD_YIELD 1
49+
#endif
50+
#ifndef configUSE_MUTEXES
1851
#define configUSE_MUTEXES 1
52+
#endif
53+
#ifndef configQUEUE_REGISTRY_SIZE
1954
#define configQUEUE_REGISTRY_SIZE 8
55+
#endif
56+
#ifndef configUSE_RECURSIVE_MUTEXES
2057
#define configUSE_RECURSIVE_MUTEXES 1
58+
#endif
59+
#ifndef configUSE_MALLOC_FAILED_HOOK
2160
#define configUSE_MALLOC_FAILED_HOOK 1
61+
#endif
62+
#ifndef configUSE_APPLICATION_TASK_TAG
2263
#define configUSE_APPLICATION_TASK_TAG 0
64+
#endif
65+
#ifndef configUSE_COUNTING_SEMAPHORES
2366
#define configUSE_COUNTING_SEMAPHORES 1
67+
#endif
68+
#ifndef configUSE_QUEUE_SETS
2469
#define configUSE_QUEUE_SETS 1
70+
#endif
71+
#ifndef configSUPPORT_DYNAMIC_ALLOCATION
2572
#define configSUPPORT_DYNAMIC_ALLOCATION 1
73+
#endif
74+
#ifndef configSUPPORT_STATIC_ALLOCATION
2675
#define configSUPPORT_STATIC_ALLOCATION 1
76+
#endif
77+
#ifndef configSTACK_DEPTH_TYPE
2778
#define configSTACK_DEPTH_TYPE uint32_t
79+
#endif
80+
#ifndef configUSE_TASK_PREEMPTION_DISABLE
2881
#define configUSE_TASK_PREEMPTION_DISABLE 1
82+
#endif
2983

84+
#ifndef configUSE_NEWLIB_REENTRANT
3085
#define configUSE_NEWLIB_REENTRANT 1
86+
#endif
87+
#ifndef configNEWLIB_REENTRANT_IS_DYNAMIC
3188
#define configNEWLIB_REENTRANT_IS_DYNAMIC 1
89+
#endif
3290

3391
/* Run time stats related definitions. */
92+
#ifndef configGENERATE_RUN_TIME_STATS
93+
#define configGENERATE_RUN_TIME_STATS 1
94+
#endif
95+
#ifdef configGENERATE_RUN_TIME_STATS
3496
extern void vMainConfigureTimerForRunTimeStats(void);
3597
extern unsigned long ulMainGetRunTimeCounterValue(void);
36-
#define configGENERATE_RUN_TIME_STATS 1
3798
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() //vMainConfigureTimerForRunTimeStats()
3899
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
100+
#endif
39101

40102
/* Co-routine definitions. */
103+
#ifndef configUSE_CO_ROUTINES
41104
#define configUSE_CO_ROUTINES 0
105+
#endif
106+
#ifndef configMAX_CO_ROUTINE_PRIORITIES
42107
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
108+
#endif
43109

44110
/* Software timer definitions. */
111+
#ifndef configUSE_TIMERS
45112
#define configUSE_TIMERS 1
113+
#endif
114+
#ifndef configTIMER_TASK_PRIORITY
46115
#define configTIMER_TASK_PRIORITY ( 2 )
116+
#endif
117+
#ifndef configTIMER_QUEUE_LENGTH
47118
#define configTIMER_QUEUE_LENGTH 5
119+
#endif
120+
#ifndef configTIMER_TASK_STACK_DEPTH
48121
#define configTIMER_TASK_STACK_DEPTH ( 1024 )
122+
#endif
49123

50124
/* Set the following definitions to 1 to include the API function, or zero
51125
to exclude the API function. */
126+
#ifndef INCLUDE_eTaskGetState
52127
#define INCLUDE_eTaskGetState 1
128+
#endif
129+
#ifndef INCLUDE_uxTaskGetStackHighWaterMark
53130
#define INCLUDE_uxTaskGetStackHighWaterMark 1
131+
#endif
132+
#ifndef INCLUDE_uxTaskPriorityGet
54133
#define INCLUDE_uxTaskPriorityGet 1
134+
#endif
135+
#ifndef INCLUDE_vTaskCleanUpResources
55136
#define INCLUDE_vTaskCleanUpResources 1
137+
#endif
138+
#ifndef INCLUDE_vTaskDelay
56139
#define INCLUDE_vTaskDelay 1
140+
#endif
141+
#ifndef INCLUDE_vTaskDelayUntil
57142
#define INCLUDE_vTaskDelayUntil 1
143+
#endif
144+
#ifndef INCLUDE_vTaskDelete
58145
#define INCLUDE_vTaskDelete 1
146+
#endif
147+
#ifndef INCLUDE_vTaskPrioritySet
59148
#define INCLUDE_vTaskPrioritySet 1
149+
#endif
150+
#ifndef INCLUDE_vTaskSuspend
60151
#define INCLUDE_vTaskSuspend 1
152+
#endif
153+
#ifndef INCLUDE_xQueueGetMutexHolder
61154
#define INCLUDE_xQueueGetMutexHolder 1
155+
#endif
156+
#ifndef INCLUDE_xTaskAbortDelay
62157
#define INCLUDE_xTaskAbortDelay 1
158+
#endif
159+
#ifndef INCLUDE_xTaskGetCurrentTaskHandle
63160
#define INCLUDE_xTaskGetCurrentTaskHandle 1
161+
#endif
162+
#ifndef INCLUDE_xTaskGetHandle
64163
#define INCLUDE_xTaskGetHandle 1
164+
#endif
165+
#ifndef INCLUDE_xTaskGetIdleTaskHandle
65166
#define INCLUDE_xTaskGetIdleTaskHandle 1
167+
#endif
168+
#ifndef INCLUDE_xTaskGetSchedulerState
66169
#define INCLUDE_xTaskGetSchedulerState 1
170+
#endif
171+
#ifndef INCLUDE_xTaskResumeFromISR
67172
#define INCLUDE_xTaskResumeFromISR 1
173+
#endif
174+
#ifndef INCLUDE_xTimerPendFunctionCall
68175
#define INCLUDE_xTimerPendFunctionCall 1
176+
#endif
69177

178+
#ifndef configUSE_STATS_FORMATTING_FUNCTIONS
70179
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
180+
#endif
71181

182+
#ifndef configUSE_MUTEXES
72183
#define configUSE_MUTEXES 1
184+
#endif
185+
#ifndef configUSE_MALLOC_FAILED_HOOK
73186
#define configUSE_MALLOC_FAILED_HOOK 1
187+
#endif
188+
#ifndef configCHECK_FOR_STACK_OVERFLOW
74189
#define configCHECK_FOR_STACK_OVERFLOW 2
190+
#endif
75191

76192
/* Cortex-M specific definitions. */
193+
#ifndef configPRIO_BITS
77194
#undef __NVIC_PRIO_BITS
78195
#ifdef __NVIC_PRIO_BITS
79196
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
80197
#define configPRIO_BITS __NVIC_PRIO_BITS
81198
#else
82199
#define configPRIO_BITS 3 /* 8 priority levels */
83200
#endif
201+
#endif
84202

85203
/* The lowest interrupt priority that can be used in a call to a "set priority"
86204
function. */
205+
#ifndef configLIBRARY_LOWEST_INTERRUPT_PRIORITY
87206
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
207+
#endif
88208

89209
/* The highest interrupt priority that can be used by any interrupt service
90210
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
91211
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
92212
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
213+
#ifndef configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY
93214
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
215+
#endif
94216

95217
/* Interrupt priorities used by the kernel port layer itself. These are generic
96218
to all Cortex-M ports, and do not rely on any particular library functions. */
219+
#ifndef configKERNEL_INTERRUPT_PRIORITY
97220
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
221+
#endif
98222
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
99223
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
224+
#ifndef configMAX_SYSCALL_INTERRUPT_PRIORITY
100225
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
226+
#endif
101227

228+
#ifndef configASSERT
102229
#ifdef __cplusplus
103230
extern "C" {
104231
#endif
@@ -109,11 +236,20 @@ void rtosFatalError(void);
109236

110237
#define configASSERT( x ) \
111238
if( ( x ) == 0 ) { portDISABLE_INTERRUPTS(); rtosFatalError(); }
239+
#endif
112240

241+
#ifndef configUSE_DYNAMIC_EXCEPTION_HANDLERS
113242
#define configUSE_DYNAMIC_EXCEPTION_HANDLERS 0
243+
#endif
244+
#ifndef configSUPPORT_PICO_SYNC_INTEROP
114245
#define configSUPPORT_PICO_SYNC_INTEROP 1
246+
#endif
247+
#ifndef configSUPPORT_PICO_TIME_INTEROP
115248
#define configSUPPORT_PICO_TIME_INTEROP 1
249+
#endif
116250

251+
#ifndef LIB_PICO_MULTICORE
117252
#define LIB_PICO_MULTICORE 1
253+
#endif
118254

119255
#include "rp2040_config.h"

0 commit comments

Comments
 (0)