Skip to content

Commit

Permalink
Enable configuring target variants (espressif#7019)
Browse files Browse the repository at this point in the history
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").
  • Loading branch information
kohlschuetter authored Aug 22, 2022
1 parent fe1d9e0 commit 4146d27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ set(BLE_SRCS
)

set(includedirs
variants/${IDF_TARGET}/
variants/${CONFIG_ARDUINO_VARIANT}/
cores/esp32/
libraries/ArduinoOTA/src
libraries/AsyncUDP/src
Expand Down Expand Up @@ -210,13 +210,13 @@ set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl b

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

string(TOUPPER ${CONFIG_IDF_TARGET} idf_target_caps)
string(TOUPPER ${CONFIG_ARDUINO_VARIANT} idf_target_caps)
target_compile_options(${COMPONENT_TARGET} PUBLIC
-DARDUINO=10812
-DARDUINO_${idf_target_caps}_DEV
-DARDUINO_ARCH_ESP32
-DARDUINO_BOARD="${idf_target_caps}_DEV"
-DARDUINO_VARIANT="${CONFIG_IDF_TARGET}"
-DARDUINO_VARIANT="${CONFIG_ARDUINO_VARIANT}"
-DESP32)

if(CONFIG_AUTOSTART_ARDUINO)
Expand Down
9 changes: 9 additions & 0 deletions Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
menu "Arduino Configuration"

config ARDUINO_VARIANT
string "Arduino target variant (board)"
default IDF_TARGET
help
The name of a target variant (e.g., a specific board) in the variants/
folder, e.g. "heltec_wifi_lora_32_V2". The name is case sensitive.
Specifying a variant name different from the target enables additional
customization, for example the definition of GPIO pins.

config ENABLE_ARDUINO_DEPENDS
bool
select LWIP_SO_RCVBUF
Expand Down

0 comments on commit 4146d27

Please sign in to comment.