Skip to content

Commit 4146d27

Browse files
Enable configuring target variants (espressif#7019)
This change enables picking the right board configuration from the variants/ folder. Previously, we would always pick the default configuration (e.g., "esp32" instead of "heltec_wifi_lora_32_V2").
1 parent fe1d9e0 commit 4146d27

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ set(BLE_SRCS
168168
)
169169

170170
set(includedirs
171-
variants/${IDF_TARGET}/
171+
variants/${CONFIG_ARDUINO_VARIANT}/
172172
cores/esp32/
173173
libraries/ArduinoOTA/src
174174
libraries/AsyncUDP/src
@@ -210,13 +210,13 @@ set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl b
210210

211211
idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
212212

213-
string(TOUPPER ${CONFIG_IDF_TARGET} idf_target_caps)
213+
string(TOUPPER ${CONFIG_ARDUINO_VARIANT} idf_target_caps)
214214
target_compile_options(${COMPONENT_TARGET} PUBLIC
215215
-DARDUINO=10812
216216
-DARDUINO_${idf_target_caps}_DEV
217217
-DARDUINO_ARCH_ESP32
218218
-DARDUINO_BOARD="${idf_target_caps}_DEV"
219-
-DARDUINO_VARIANT="${CONFIG_IDF_TARGET}"
219+
-DARDUINO_VARIANT="${CONFIG_ARDUINO_VARIANT}"
220220
-DESP32)
221221

222222
if(CONFIG_AUTOSTART_ARDUINO)

Kconfig.projbuild

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
menu "Arduino Configuration"
22

3+
config ARDUINO_VARIANT
4+
string "Arduino target variant (board)"
5+
default IDF_TARGET
6+
help
7+
The name of a target variant (e.g., a specific board) in the variants/
8+
folder, e.g. "heltec_wifi_lora_32_V2". The name is case sensitive.
9+
Specifying a variant name different from the target enables additional
10+
customization, for example the definition of GPIO pins.
11+
312
config ENABLE_ARDUINO_DEPENDS
413
bool
514
select LWIP_SO_RCVBUF

0 commit comments

Comments
 (0)