From acaed497142244f7e95d25bc3a13e4a6f1c886a0 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sun, 22 Mar 2020 12:39:46 +0100 Subject: [PATCH] Use platformio's extend feature (#149) * Use platformio's extend feature * Pin ESP32 platform version * Do not use env: prefix for base envs By using a custom prefix base:, we don't need to list the environments we *want* to build explicitly. * Fix espressif32 platform version --- platformio.ini | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/platformio.ini b/platformio.ini index b13ecda..3ba9c9b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,10 @@ [platformio] src_dir = ESP8266WirelessPrintAsync + +# common variables shared by the environments [common] +framework = arduino lib_deps = https://github.com/greiman/SdFat#3b79f38 https://github.com/me-no-dev/ESPAsyncWebServer#95dedf7 @@ -22,24 +25,37 @@ lib_deps = https://github.com/bblanchon/ArduinoJson#3df4efd https://github.com/Makuna/NeoPixelBus#9619fef -[env:nodemcuv2] -platform = espressif8266@2.0.0 ; Corresponds to https://github.com/platformio/platform-espressif8266/releases/tag/v2.0.0 = https://github.com/esp8266/Arduino/releases/tag/2.5.0 -board = nodemcuv2 -framework = arduino + +# base environments +# can be extended by board-specific environments +[base:esp8266] +; corresponds to https://github.com/platformio/platform-espressif8266/releases/tag/v2.0.0 +; see https://github.com/esp8266/Arduino/releases/tag/2.5.0 +platform = espressif8266@2.0.0 +framework = ${common.framework} +lib_deps = ${common.lib_deps} + +[base:esp32] +; corresponds to https://github.com/platformio/platform-espressif32/releases/tag/v1.8.0 +; see https://github.com/espressif/arduino-esp32/releases/tag/1.0.2 +platform = espressif32@1.8.0 +framework = ${common.framework} lib_deps = ${common.lib_deps} + https://github.com/bbx10/Hash_tng + + +[env:nodemcuv2] +board = nodemcuv2 +extends = base:esp8266 [env:d1_mini] -platform = espressif8266@2.0.0 ; Corresponds to https://github.com/platformio/platform-espressif8266/releases/tag/v2.0.0 = https://github.com/esp8266/Arduino/releases/tag/2.5.0 board = d1_mini -framework = arduino -lib_deps = - ${common.lib_deps} +extends = base:esp8266 +# esp32dev works for the majority of ESP32 based dev boards +# there are more specific board configurations available, feel free to send PRs adding new ones [env:esp32dev] -platform = espressif32@1.8.0 ; Corresponds to https://github.com/platformio/platform-espressif32/releases/tag/v1.8.0 = https://github.com/espressif/arduino-esp32/releases/tag/1.0.2 board = esp32dev -framework = arduino -lib_deps = - ${common.lib_deps} - https://github.com/bbx10/Hash_tng +extends = base:esp32 +