From a31521cdfee6d0f93918f9810ea1ce0bcacee671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Mon, 8 Sep 2025 09:59:33 +0200 Subject: [PATCH] platformio.ini cleanup 2 --- platformio.ini | 105 +++++++++++++++++++++++++++++++------------------ src/http.cpp | 4 +- src/io.cpp | 6 +-- src/io.h | 12 +++--- 4 files changed, 78 insertions(+), 49 deletions(-) diff --git a/platformio.ini b/platformio.ini index a788b7e..3b4361d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -6,70 +6,99 @@ build.filesystem = littlefs lib_deps = bblanchon/ArduinoJson @ 7.4.2 knolleary/PubSubClient -[Sonoff4ChPro] +[ESP8285] platform = espressif8266 board = esp8285 -build_flags = -D Sonoff4ChPro +framework = ${common.framework} +upload_speed = ${common.upload_speed} +monitor_speed = ${common.monitor_speed} +build.filesystem = ${common.build.filesystem} +lib_deps = ${common.lib_deps} +board_build.ldscript = eagle.flash.1m64.ld -[GosundSP111] -platform = espressif8266 -board = esp8285 -build_flags = -D GosundSP111 +[Ch4Pro] +platform = ${ESP8285.platform} +board = ${ESP8285.board} +framework = ${ESP8285.framework} +upload_speed = ${ESP8285.upload_speed} +monitor_speed = ${ESP8285.monitor_speed} +build.filesystem = ${ESP8285.build.filesystem} +lib_deps = ${ESP8285.lib_deps} +board_build.ldscript = ${ESP8285.board_build.ldscript} +build_flags = -D Ch4Pro + +[SP111] +platform = ${ESP8285.platform} +board = ${ESP8285.board} +framework = ${ESP8285.framework} +upload_speed = ${ESP8285.upload_speed} +monitor_speed = ${ESP8285.monitor_speed} +build.filesystem = ${ESP8285.build.filesystem} +lib_deps = ${ESP8285.lib_deps} +board_build.ldscript = ${ESP8285.board_build.ldscript} +build_flags = -D SP111 [ESP32_TEST] platform = espressif32 board = esp32dev +framework = ${common.framework} +upload_speed = ${common.upload_speed} +monitor_speed = ${common.monitor_speed} build_type = debug debug_tool = esp-prog monitor_filters = esp32_exception_decoder +build.filesystem = ${common.build.filesystem} +lib_deps = ${common.lib_deps} build_flags = -D ESP32_TESTBOARD -D CORE_DEBUG_LEVEL=0 -[env:Sonoff4ChPro_ESP32] +[env:ESP32_Ch4Pro] platform = ${ESP32_TEST.platform} board = ${ESP32_TEST.board} -framework = ${common.framework} -upload_speed = ${common.upload_speed} -monitor_speed = ${common.monitor_speed} +framework = ${ESP32_TEST.framework} +upload_speed = ${ESP32_TEST.upload_speed} +monitor_speed = ${ESP32_TEST.monitor_speed} build_type = ${ESP32_TEST.build_type} debug_tool = ${ESP32_TEST.debug_tool} monitor_filters = ${ESP32_TEST.monitor_filters} -build.filesystem = ${common.build.filesystem} -lib_deps = ${common.lib_deps} -build_flags = ${Sonoff4ChPro.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"PatrixSonoff4ChPro_ESP32\" ${ESP32_TEST.build_flags} +build.filesystem = ${ESP32_TEST.build.filesystem} +lib_deps = ${ESP32_TEST.lib_deps} +build_flags = ${Ch4Pro.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"ESP32_Test_Ch4Pro\" ${ESP32_TEST.build_flags} -[env:GosundSP111_ESP32] +[env:ESP32_SP111] platform = ${ESP32_TEST.platform} board = ${ESP32_TEST.board} -framework = ${common.framework} -upload_speed = ${common.upload_speed} -monitor_speed = ${common.monitor_speed} +framework = ${ESP32_TEST.framework} +upload_speed = ${ESP32_TEST.upload_speed} +monitor_speed = ${ESP32_TEST.monitor_speed} build_type = ${ESP32_TEST.build_type} debug_tool = ${ESP32_TEST.debug_tool} monitor_filters = ${ESP32_TEST.monitor_filters} -build.filesystem = ${common.build.filesystem} -lib_deps = ${common.lib_deps} -build_flags = ${GosundSP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"PatrixGosundSP111_ESP32\" ${ESP32_TEST.build_flags} +build.filesystem = ${ESP32_TEST.build.filesystem} +lib_deps = ${ESP32_TEST.lib_deps} +build_flags = ${SP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"ESP32_Test_SP111\" ${ESP32_TEST.build_flags} -[env:Greenhouse] -platform = ${Sonoff4ChPro.platform} -board = ${Sonoff4ChPro.board} -framework = ${common.framework} -upload_speed = ${common.upload_speed} -monitor_speed = ${common.monitor_speed} -build.filesystem = ${common.build.filesystem} -lib_deps = ${common.lib_deps} +[env:Gewaechshaus] +platform = ${Ch4Pro.platform} +board = ${Ch4Pro.board} +framework = ${Ch4Pro.framework} +upload_speed = ${Ch4Pro.upload_speed} +monitor_speed = ${Ch4Pro.monitor_speed} +build.filesystem = ${Ch4Pro.build.filesystem} +lib_deps = ${Ch4Pro.lib_deps} +board_build.ldscript = ${Ch4Pro.board_build.ldscript} +build_flags = ${Ch4Pro.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"Gewaechshaus\" upload_protocol = espota upload_port = 10.0.0.178 -build_flags = ${Sonoff4ChPro.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"Greenhouse\" -[env:InfraredHeater] -platform = ${GosundSP111.platform} -board = ${GosundSP111.board} -framework = ${common.framework} -upload_speed = ${common.upload_speed} -monitor_speed = ${common.monitor_speed} -build.filesystem = ${common.build.filesystem} -lib_deps = ${common.lib_deps} +[env:Infrarotheizung] +platform = ${SP111.platform} +board = ${SP111.board} +framework = ${SP111.framework} +upload_speed = ${SP111.upload_speed} +monitor_speed = ${SP111.monitor_speed} +build.filesystem = ${SP111.build.filesystem} +lib_deps = ${SP111.lib_deps} +board_build.ldscript = ${SP111.board_build.ldscript} +build_flags = ${SP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"Infrarotheizung\" upload_protocol = espota upload_port = 10.0.0.179 -build_flags = ${GosundSP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"Heater\" diff --git a/src/http.cpp b/src/http.cpp index 0620469..50e3bdd 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -95,7 +95,7 @@ void httpStatus() { const auto relays = json["relays"].to(); relay0.json(relays.add()); -#ifdef Sonoff4ChPro +#ifdef Ch4Pro relay1.json(relays.add()); relay2.json(relays.add()); relay3.json(relays.add()); @@ -117,7 +117,7 @@ void httpSet() { httpString("mqttPassword", mqttSetPassword); httpRelay(0, relay0); -#ifdef Sonoff4ChPro +#ifdef Ch4Pro httpRelay(1, relay1); httpRelay(2, relay2); httpRelay(3, relay3); diff --git a/src/io.cpp b/src/io.cpp index 26c3e2c..8b379e8 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -1,6 +1,6 @@ #include "io.h" -#ifdef GosundSP111 +#ifdef SP111 #ifndef ESP32_TESTBOARD #define STATUS_PIN 0 @@ -11,13 +11,13 @@ Button button0(13, true, true, [](const ButtonEvent event) { buttonCallback(rela Relay relay0(0, "fallback/relay0", "RELAY #0", 15, false, true); -#ifdef GosundSP111 +#ifdef SP111 Output relay0Led("relay0Led", 2, true, false); #endif #endif -#ifdef Sonoff4ChPro +#ifdef Ch4Pro #ifndef ESP32_TESTBOARD #define STATUS_PIN 13 diff --git a/src/io.h b/src/io.h index 9f42ba2..995e3cf 100644 --- a/src/io.h +++ b/src/io.h @@ -12,11 +12,11 @@ extern Button button0; extern Relay relay0; -#ifdef GosundSP111 +#ifdef SP111 extern Output relay0Led; #endif -#ifdef Sonoff4ChPro +#ifdef Ch4Pro extern Button button1; @@ -36,10 +36,10 @@ inline void ioSetup() { status.setup(); button0.setup(); relay0.setup(); -#ifdef GosundSP111 +#ifdef SP111 relay0Led.setup(); #endif -#ifdef Sonoff4ChPro +#ifdef Ch4Pro button1.setup(); button2.setup(); button3.setup(); @@ -53,11 +53,11 @@ inline void ioLoop() { status.loop(); button0.loop(); relay0.loop(); -#ifdef GosundSP111 +#ifdef SP111 relay0Led.set(relay0.get()); relay0Led.loop(); #endif -#ifdef Sonoff4ChPro +#ifdef Ch4Pro button1.loop(); button2.loop(); button3.loop();