Skip to content

Commit 2692d9a

Browse files
authored
Propogate changed pico_cmake_set_default values to the compilation (#2034)
* Propogate non-default pico_cmake_set_default values through to compile definitions Add PICO_BOARD_CMAKE_OVERRIDES common scope variable, to contain any pico_cmake_set_default CMake variables which have been overwritten. This allows passing CMake arguments to the build, without needing extra target_compile_definitions. Also add pico_cmake_set_default PICO_RP2350_A2_SUPPORTED to enable/disable the E10 abs-block fix * Fix more board files missing pico_cmake_set_default PICO_RP2350_A2_SUPPORTED * Apply @lurch's patch to check_board_header.py
1 parent 338f99f commit 2692d9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+84
-11
lines changed

cmake/generic_board.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ if (EXISTS ${PICO_BOARD_HEADER_FILE})
2626
if (LINE MATCHES "^[ \t\]*//[ \t\]*pico_cmake_set_default[ \t\]*([a-zA-Z_][a-zA-Z0-9_]*)[ \t\]*=[ \t\]*(.*)")
2727
if (NOT DEFINED "${CMAKE_MATCH_1}")
2828
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
29+
else()
30+
list(APPEND PICO_BOARD_CMAKE_OVERRIDES ${CMAKE_MATCH_1})
2931
endif()
3032
endif()
3133
endwhile()

pico_sdk_init.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ if (NOT TARGET _pico_sdk_pre_init_marker)
7575
PICO_SDK_POST_LIST_FILES
7676
PICO_CONFIG_HEADER_FILES
7777
PICO_RP2040_CONFIG_HEADER_FILES
78+
PICO_BOARD_CMAKE_OVERRIDES
7879
)
7980

8081
macro(pico_promote_common_scope_vars)

src/boards/include/boards/adafruit_feather_rp2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
7979
#endif
8080

81+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8182
#ifndef PICO_RP2350_A2_SUPPORTED
8283
#define PICO_RP2350_A2_SUPPORTED 1
8384
#endif

src/boards/include/boards/datanoisetv_rp2350_dsp.h

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
4949
#endif
5050

51+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
5152
#ifndef PICO_RP2350_A2_SUPPORTED
5253
#define PICO_RP2350_A2_SUPPORTED 1
5354
#endif

src/boards/include/boards/defcon32_badge.h

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
109109
#endif
110110

111+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
111112
#ifndef PICO_RP2350_A2_SUPPORTED
112113
#define PICO_RP2350_A2_SUPPORTED 1
113114
#endif

src/boards/include/boards/gen4_rp2350_24.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_24ct.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_24t.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_28.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_28ct.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_28t.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_32.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_32ct.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_32t.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_35.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_35ct.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/gen4_rp2350_35t.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7777
#endif
7878

79+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
7980
#ifndef PICO_RP2350_A2_SUPPORTED
8081
#define PICO_RP2350_A2_SUPPORTED 1
8182
#endif

src/boards/include/boards/hellbender_0001.h

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
// --- RP2350 VARIANT ---
141141
#define PICO_RP2350B 1
142142

143+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
143144
#ifndef PICO_RP2350_A2_SUPPORTED
144145
#define PICO_RP2350_A2_SUPPORTED 1
145146
#endif

src/boards/include/boards/hellbender_2350A_devboard.h

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
// --- RP2350 VARIANT ---
9292
#define PICO_RP2350A 1
9393

94+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
9495
#ifndef PICO_RP2350_A2_SUPPORTED
9596
#define PICO_RP2350_A2_SUPPORTED 1
9697
#endif

src/boards/include/boards/ilabs_challenger_rp2350_bconnect.h

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
8484
#endif
8585

86+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8687
#ifndef PICO_RP2350_A2_SUPPORTED
8788
#define PICO_RP2350_A2_SUPPORTED 1
8889
#endif

src/boards/include/boards/ilabs_challenger_rp2350_wifi_ble.h

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
8181
#endif
8282

83+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8384
#ifndef PICO_RP2350_A2_SUPPORTED
8485
#define PICO_RP2350_A2_SUPPORTED 1
8586
#endif

src/boards/include/boards/melopero_perpetuo_rp2350_lora.h

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282

8383

8484

85+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8586
#ifndef PICO_RP2350_A2_SUPPORTED
8687
#define PICO_RP2350_A2_SUPPORTED 1
8788
#endif

src/boards/include/boards/phyx_rick_tny_rp2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
8181
#endif
8282

83+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8384
#ifndef PICO_RP2350_A2_SUPPORTED
8485
#define PICO_RP2350_A2_SUPPORTED 1
8586
#endif

src/boards/include/boards/pico2.h

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
#define PICO_VSYS_PIN 29
9494
#endif
9595

96+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
9697
#ifndef PICO_RP2350_A2_SUPPORTED
9798
#define PICO_RP2350_A2_SUPPORTED 1
9899
#endif

src/boards/include/boards/pico2_w.h

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
#define PICO_VSYS_PIN 29
110110
#endif
111111

112+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
112113
#ifndef PICO_RP2350_A2_SUPPORTED
113114
#define PICO_RP2350_A2_SUPPORTED 1
114115
#endif

src/boards/include/boards/pimoroni_pga2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
// no PICO_VBUS_PIN
8686
// no PICO_VSYS_PIN
8787

88+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8889
#ifndef PICO_RP2350_A2_SUPPORTED
8990
#define PICO_RP2350_A2_SUPPORTED 1
9091
#endif

src/boards/include/boards/pimoroni_pico_plus2_rp2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
#define PICO_VSYS_PIN 43
100100
#endif
101101

102+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
102103
#ifndef PICO_RP2350_A2_SUPPORTED
103104
#define PICO_RP2350_A2_SUPPORTED 1
104105
#endif

src/boards/include/boards/pimoroni_plasma2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
110110
#endif
111111

112+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
112113
#ifndef PICO_RP2350_A2_SUPPORTED
113114
#define PICO_RP2350_A2_SUPPORTED 1
114115
#endif

src/boards/include/boards/pimoroni_tiny2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
9090
#endif
9191

92+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
9293
#ifndef PICO_RP2350_A2_SUPPORTED
9394
#define PICO_RP2350_A2_SUPPORTED 1
9495
#endif

src/boards/include/boards/seeed_xiao_rp2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
143143
#endif
144144

145+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
145146
#ifndef PICO_RP2350_A2_SUPPORTED
146147
#define PICO_RP2350_A2_SUPPORTED 1
147148
#endif

src/boards/include/boards/solderparty_rp2350_stamp.h

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7979
#endif
8080

81+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8182
#ifndef PICO_RP2350_A2_SUPPORTED
8283
#define PICO_RP2350_A2_SUPPORTED 1
8384
#endif

src/boards/include/boards/solderparty_rp2350_stamp_xl.h

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
7979
#endif
8080

81+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8182
#ifndef PICO_RP2350_A2_SUPPORTED
8283
#define PICO_RP2350_A2_SUPPORTED 1
8384
#endif

src/boards/include/boards/sparkfun_promicro_rp2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
// --- RP2350 VARIANT ---
8282
#define PICO_RP2350A 1
8383

84+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8485
#ifndef PICO_RP2350_A2_SUPPORTED
8586
#define PICO_RP2350_A2_SUPPORTED 1
8687
#endif

src/boards/include/boards/switchscience_picossci2_conta_base.h

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
8080
#endif
8181

82+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8283
#ifndef PICO_RP2350_A2_SUPPORTED
8384
#define PICO_RP2350_A2_SUPPORTED 1
8485
#endif

src/boards/include/boards/switchscience_picossci2_dev_board.h

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
8181
#endif
8282

83+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8384
#ifndef PICO_RP2350_A2_SUPPORTED
8485
#define PICO_RP2350_A2_SUPPORTED 1
8586
#endif

src/boards/include/boards/switchscience_picossci2_micro.h

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
6767
#endif
6868

69+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
6970
#ifndef PICO_RP2350_A2_SUPPORTED
7071
#define PICO_RP2350_A2_SUPPORTED 1
7172
#endif

src/boards/include/boards/switchscience_picossci2_rp2350_breakout.h

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
8080
#endif
8181

82+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8283
#ifndef PICO_RP2350_A2_SUPPORTED
8384
#define PICO_RP2350_A2_SUPPORTED 1
8485
#endif

src/boards/include/boards/switchscience_picossci2_tiny.h

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
8080
#endif
8181

82+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
8283
#ifndef PICO_RP2350_A2_SUPPORTED
8384
#define PICO_RP2350_A2_SUPPORTED 1
8485
#endif

src/boards/include/boards/tinycircuits_thumby_color_rp2350.h

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
#define PICO_VSYS_PIN 29
9494
#endif
9595

96+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
9697
#ifndef PICO_RP2350_A2_SUPPORTED
9798
#define PICO_RP2350_A2_SUPPORTED 1
9899
#endif

src/common/pico_base_headers/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ if (NOT TARGET pico_base_headers)
66
target_compile_definitions(pico_base_headers INTERFACE
77
PICO_BOARD="${PICO_BOARD}")
88

9+
foreach(override ${PICO_BOARD_CMAKE_OVERRIDES})
10+
target_compile_definitions(pico_base_headers INTERFACE
11+
${override}=${${override}})
12+
endforeach()
13+
914
target_link_libraries(pico_base_headers INTERFACE pico_platform_headers)
1015

1116
list(APPEND PICO_SDK_POST_LIST_FILES ${CMAKE_CURRENT_LIST_DIR}/generate_config_header.cmake)

tools/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function(pico_add_uf2_output TARGET)
400400
endif()
401401

402402
get_target_property(extra_uf2_args ${TARGET} PICOTOOL_EXTRA_UF2_ARGS)
403-
if (1) # TODO: A2 only (Errata RP2350-E9)
403+
if (PICO_RP2350_A2_SUPPORTED)
404404
if (NOT extra_uf2_args)
405405
set(extra_uf2_args "--abs-block")
406406
elseif(NOT "--abs-block" IN_LIST extra_uf2_args)

0 commit comments

Comments
 (0)