Skip to content

Commit 296b792

Browse files
Remove duplicate FreeRTOSConfig.h files (#460)
Include FreeRTOSConfig_examples_common.h, similar to what we do for lwipopts.h
1 parent bf15aea commit 296b792

File tree

5 files changed

+153
-280
lines changed

5 files changed

+153
-280
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/*
2+
* FreeRTOS V202111.00
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 of
6+
* this software and associated documentation files (the "Software"), to deal in
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so,
10+
* subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* 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, FITNESS
17+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* http://www.FreeRTOS.org
23+
* http://aws.amazon.com/freertos
24+
*
25+
* 1 tab == 4 spaces!
26+
*/
27+
28+
#ifndef FREERTOS_CONFIG_EXAMPLES_COMMON_H
29+
#define FREERTOS_CONFIG_EXAMPLES_COMMON_H
30+
31+
/*-----------------------------------------------------------
32+
* Application specific definitions.
33+
*
34+
* These definitions should be adjusted for your particular hardware and
35+
* application requirements.
36+
*
37+
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
38+
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
39+
*
40+
* See http://www.freertos.org/a00110.html
41+
*----------------------------------------------------------*/
42+
43+
/* Scheduler Related */
44+
#define configUSE_PREEMPTION 1
45+
#define configUSE_TICKLESS_IDLE 0
46+
#define configUSE_IDLE_HOOK 0
47+
#define configUSE_TICK_HOOK 0
48+
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
49+
#define configMAX_PRIORITIES 32
50+
#define configMINIMAL_STACK_SIZE ( configSTACK_DEPTH_TYPE ) 256
51+
#define configUSE_16_BIT_TICKS 0
52+
53+
#define configIDLE_SHOULD_YIELD 1
54+
55+
/* Synchronization Related */
56+
#define configUSE_MUTEXES 1
57+
#define configUSE_RECURSIVE_MUTEXES 1
58+
#define configUSE_APPLICATION_TASK_TAG 0
59+
#define configUSE_COUNTING_SEMAPHORES 1
60+
#define configQUEUE_REGISTRY_SIZE 8
61+
#define configUSE_QUEUE_SETS 1
62+
#define configUSE_TIME_SLICING 1
63+
#define configUSE_NEWLIB_REENTRANT 0
64+
// todo need this for lwip FreeRTOS sys_arch to compile
65+
#define configENABLE_BACKWARD_COMPATIBILITY 1
66+
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5
67+
68+
/* System */
69+
#define configSTACK_DEPTH_TYPE uint32_t
70+
#define configMESSAGE_BUFFER_LENGTH_TYPE size_t
71+
72+
/* Memory allocation related definitions. */
73+
#define configSUPPORT_STATIC_ALLOCATION 0
74+
#define configSUPPORT_DYNAMIC_ALLOCATION 1
75+
#define configTOTAL_HEAP_SIZE (128*1024)
76+
#define configAPPLICATION_ALLOCATED_HEAP 0
77+
78+
/* Hook function related definitions. */
79+
#define configCHECK_FOR_STACK_OVERFLOW 0
80+
#define configUSE_MALLOC_FAILED_HOOK 0
81+
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
82+
83+
/* Run time and task stats gathering related definitions. */
84+
#define configGENERATE_RUN_TIME_STATS 0
85+
#define configUSE_TRACE_FACILITY 1
86+
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
87+
88+
/* Co-routine related definitions. */
89+
#define configUSE_CO_ROUTINES 0
90+
#define configMAX_CO_ROUTINE_PRIORITIES 1
91+
92+
/* Software timer related definitions. */
93+
#define configUSE_TIMERS 1
94+
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
95+
#define configTIMER_QUEUE_LENGTH 10
96+
#define configTIMER_TASK_STACK_DEPTH 1024
97+
98+
/* Interrupt nesting behaviour configuration. */
99+
/*
100+
#define configKERNEL_INTERRUPT_PRIORITY [dependent of processor]
101+
#define configMAX_SYSCALL_INTERRUPT_PRIORITY [dependent on processor and application]
102+
#define configMAX_API_CALL_INTERRUPT_PRIORITY [dependent on processor and application]
103+
*/
104+
105+
#if FREE_RTOS_KERNEL_SMP // set by the RP2040 SMP port of FreeRTOS
106+
/* SMP port only */
107+
#define configNUM_CORES 2
108+
#define configNUMBER_OF_CORES configNUM_CORES
109+
#define configTICK_CORE 0
110+
#define configRUN_MULTIPLE_PRIORITIES 1
111+
#define configUSE_CORE_AFFINITY 1
112+
#define configUSE_PASSIVE_IDLE_HOOK 0
113+
#endif
114+
115+
/* RP2040 specific */
116+
#define configSUPPORT_PICO_SYNC_INTEROP 1
117+
#define configSUPPORT_PICO_TIME_INTEROP 1
118+
119+
#include <assert.h>
120+
/* Define to trap errors during development. */
121+
#define configASSERT(x) assert(x)
122+
123+
/* Set the following definitions to 1 to include the API function, or zero
124+
to exclude the API function. */
125+
#define INCLUDE_vTaskPrioritySet 1
126+
#define INCLUDE_uxTaskPriorityGet 1
127+
#define INCLUDE_vTaskDelete 1
128+
#define INCLUDE_vTaskSuspend 1
129+
#define INCLUDE_vTaskDelayUntil 1
130+
#define INCLUDE_vTaskDelay 1
131+
#define INCLUDE_xTaskGetSchedulerState 1
132+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
133+
#define INCLUDE_uxTaskGetStackHighWaterMark 1
134+
#define INCLUDE_xTaskGetIdleTaskHandle 1
135+
#define INCLUDE_eTaskGetState 1
136+
#define INCLUDE_xTimerPendFunctionCall 1
137+
#define INCLUDE_xTaskAbortDelay 1
138+
#define INCLUDE_xTaskGetHandle 1
139+
#define INCLUDE_xTaskResumeFromISR 1
140+
#define INCLUDE_xQueueGetMutexHolder 1
141+
142+
/* A header file that defines trace macro can be included here. */
143+
144+
#endif /* FREERTOS_CONFIG_H */
145+

pico_w/wifi/freertos/iperf/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ target_compile_definitions(picow_freertos_iperf_server_nosys PRIVATE
77
)
88
target_include_directories(picow_freertos_iperf_server_nosys PRIVATE
99
${CMAKE_CURRENT_LIST_DIR}
10+
${CMAKE_CURRENT_LIST_DIR}/.. # for our common FreeRTOSConfig
1011
${CMAKE_CURRENT_LIST_DIR}/../.. # for our common lwipopts
1112
)
1213
target_link_libraries(picow_freertos_iperf_server_nosys
@@ -27,6 +28,7 @@ target_compile_definitions(picow_freertos_iperf_server_sys PRIVATE
2728
)
2829
target_include_directories(picow_freertos_iperf_server_sys PRIVATE
2930
${CMAKE_CURRENT_LIST_DIR}
31+
${CMAKE_CURRENT_LIST_DIR}/.. # for our common FreeRTOSConfig
3032
${CMAKE_CURRENT_LIST_DIR}/../.. # for our common lwipopts
3133
)
3234
target_link_libraries(picow_freertos_iperf_server_sys
Lines changed: 2 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,7 @@
1-
/*
2-
* FreeRTOS V202111.00
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 of
6-
* this software and associated documentation files (the "Software"), to deal in
7-
* the Software without restriction, including without limitation the rights to
8-
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9-
* the Software, and to permit persons to whom the Software is furnished to do so,
10-
* subject to the following conditions:
11-
*
12-
* The above copyright notice and this permission notice shall be included in all
13-
* 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, FITNESS
17-
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18-
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19-
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20-
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21-
*
22-
* http://www.FreeRTOS.org
23-
* http://aws.amazon.com/freertos
24-
*
25-
* 1 tab == 4 spaces!
26-
*/
27-
281
#ifndef FREERTOS_CONFIG_H
292
#define FREERTOS_CONFIG_H
303

31-
/*-----------------------------------------------------------
32-
* Application specific definitions.
33-
*
34-
* These definitions should be adjusted for your particular hardware and
35-
* application requirements.
36-
*
37-
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
38-
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
39-
*
40-
* See http://www.freertos.org/a00110.html
41-
*----------------------------------------------------------*/
42-
43-
/* Scheduler Related */
44-
#define configUSE_PREEMPTION 1
45-
#define configUSE_TICKLESS_IDLE 0
46-
#define configUSE_IDLE_HOOK 0
47-
#define configUSE_TICK_HOOK 0
48-
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
49-
#define configMAX_PRIORITIES 32
50-
#define configMINIMAL_STACK_SIZE ( configSTACK_DEPTH_TYPE ) 256
51-
#define configUSE_16_BIT_TICKS 0
52-
53-
#define configIDLE_SHOULD_YIELD 1
54-
55-
/* Synchronization Related */
56-
#define configUSE_MUTEXES 1
57-
#define configUSE_RECURSIVE_MUTEXES 1
58-
#define configUSE_APPLICATION_TASK_TAG 0
59-
#define configUSE_COUNTING_SEMAPHORES 1
60-
#define configQUEUE_REGISTRY_SIZE 8
61-
#define configUSE_QUEUE_SETS 1
62-
#define configUSE_TIME_SLICING 1
63-
#define configUSE_NEWLIB_REENTRANT 0
64-
// todo need this for lwip FreeRTOS sys_arch to compile
65-
#define configENABLE_BACKWARD_COMPATIBILITY 1
66-
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5
67-
68-
/* System */
69-
#define configSTACK_DEPTH_TYPE uint32_t
70-
#define configMESSAGE_BUFFER_LENGTH_TYPE size_t
71-
72-
/* Memory allocation related definitions. */
73-
#define configSUPPORT_STATIC_ALLOCATION 0
74-
#define configSUPPORT_DYNAMIC_ALLOCATION 1
75-
#define configTOTAL_HEAP_SIZE (128*1024)
76-
#define configAPPLICATION_ALLOCATED_HEAP 0
77-
78-
/* Hook function related definitions. */
79-
#define configCHECK_FOR_STACK_OVERFLOW 0
80-
#define configUSE_MALLOC_FAILED_HOOK 0
81-
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
82-
83-
/* Run time and task stats gathering related definitions. */
84-
#define configGENERATE_RUN_TIME_STATS 0
85-
#define configUSE_TRACE_FACILITY 1
86-
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
87-
88-
/* Co-routine related definitions. */
89-
#define configUSE_CO_ROUTINES 0
90-
#define configMAX_CO_ROUTINE_PRIORITIES 1
4+
// This example uses a common include to avoid repetition
5+
#include "FreeRTOSConfig_examples_common.h"
916

92-
/* Software timer related definitions. */
93-
#define configUSE_TIMERS 1
94-
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
95-
#define configTIMER_QUEUE_LENGTH 10
96-
#define configTIMER_TASK_STACK_DEPTH 1024
97-
98-
/* Interrupt nesting behaviour configuration. */
99-
/*
100-
#define configKERNEL_INTERRUPT_PRIORITY [dependent of processor]
101-
#define configMAX_SYSCALL_INTERRUPT_PRIORITY [dependent on processor and application]
102-
#define configMAX_API_CALL_INTERRUPT_PRIORITY [dependent on processor and application]
103-
*/
104-
105-
#if FREE_RTOS_KERNEL_SMP // set by the RP2040 SMP port of FreeRTOS
106-
/* SMP port only */
107-
#define configNUM_CORES 2
108-
#define configNUMBER_OF_CORES configNUM_CORES
109-
#define configTICK_CORE 0
110-
#define configRUN_MULTIPLE_PRIORITIES 1
111-
#define configUSE_CORE_AFFINITY 1
112-
#define configUSE_PASSIVE_IDLE_HOOK 0
1137
#endif
114-
115-
/* RP2040 specific */
116-
#define configSUPPORT_PICO_SYNC_INTEROP 1
117-
#define configSUPPORT_PICO_TIME_INTEROP 1
118-
119-
#include <assert.h>
120-
/* Define to trap errors during development. */
121-
#define configASSERT(x) assert(x)
122-
123-
/* Set the following definitions to 1 to include the API function, or zero
124-
to exclude the API function. */
125-
#define INCLUDE_vTaskPrioritySet 1
126-
#define INCLUDE_uxTaskPriorityGet 1
127-
#define INCLUDE_vTaskDelete 1
128-
#define INCLUDE_vTaskSuspend 1
129-
#define INCLUDE_vTaskDelayUntil 1
130-
#define INCLUDE_vTaskDelay 1
131-
#define INCLUDE_xTaskGetSchedulerState 1
132-
#define INCLUDE_xTaskGetCurrentTaskHandle 1
133-
#define INCLUDE_uxTaskGetStackHighWaterMark 1
134-
#define INCLUDE_xTaskGetIdleTaskHandle 1
135-
#define INCLUDE_eTaskGetState 1
136-
#define INCLUDE_xTimerPendFunctionCall 1
137-
#define INCLUDE_xTaskAbortDelay 1
138-
#define INCLUDE_xTaskGetHandle 1
139-
#define INCLUDE_xTaskResumeFromISR 1
140-
#define INCLUDE_xQueueGetMutexHolder 1
141-
142-
/* A header file that defines trace macro can be included here. */
143-
144-
#endif /* FREERTOS_CONFIG_H */
145-

pico_w/wifi/freertos/ping/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (EXISTS ${PICO_LWIP_CONTRIB_PATH}/apps/ping/ping.c)
99
)
1010
target_include_directories(picow_freertos_ping_nosys PRIVATE
1111
${CMAKE_CURRENT_LIST_DIR}
12+
${CMAKE_CURRENT_LIST_DIR}/.. # for our common FreeRTOSConfig
1213
${CMAKE_CURRENT_LIST_DIR}/../.. # for our common lwipopts
1314
${PICO_LWIP_CONTRIB_PATH}/apps/ping
1415
)
@@ -33,6 +34,7 @@ if (EXISTS ${PICO_LWIP_CONTRIB_PATH}/apps/ping/ping.c)
3334
)
3435
target_include_directories(picow_freertos_ping_sys PRIVATE
3536
${CMAKE_CURRENT_LIST_DIR}
37+
${CMAKE_CURRENT_LIST_DIR}/.. # for our common FreeRTOSConfig
3638
${CMAKE_CURRENT_LIST_DIR}/../.. # for our common lwipopts
3739
${PICO_LWIP_CONTRIB_PATH}/apps/ping
3840
)

0 commit comments

Comments
 (0)