From 4146d27b8f9f89906355a5739060c2d9c14dd438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Christian=20Kohlsch=C3=BCtter?= Date: Mon, 22 Aug 2022 13:16:38 +0200 Subject: [PATCH] Enable configuring target variants (#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"). --- CMakeLists.txt | 6 +++--- Kconfig.projbuild | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53da85a45..f5c324db5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,7 +168,7 @@ set(BLE_SRCS ) set(includedirs - variants/${IDF_TARGET}/ + variants/${CONFIG_ARDUINO_VARIANT}/ cores/esp32/ libraries/ArduinoOTA/src libraries/AsyncUDP/src @@ -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) diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 40c594c07..f7ee92081 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -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 -- GitLab