platformio.ini cleanup 2

This commit is contained in:
Patrick Haßel 2025-09-08 09:59:33 +02:00
parent c390829f35
commit a31521cdfe
4 changed files with 78 additions and 49 deletions

View File

@ -6,70 +6,99 @@ build.filesystem = littlefs
lib_deps = bblanchon/ArduinoJson @ 7.4.2 lib_deps = bblanchon/ArduinoJson @ 7.4.2
knolleary/PubSubClient knolleary/PubSubClient
[Sonoff4ChPro] [ESP8285]
platform = espressif8266 platform = espressif8266
board = esp8285 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] [Ch4Pro]
platform = espressif8266 platform = ${ESP8285.platform}
board = esp8285 board = ${ESP8285.board}
build_flags = -D GosundSP111 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] [ESP32_TEST]
platform = espressif32 platform = espressif32
board = esp32dev board = esp32dev
framework = ${common.framework}
upload_speed = ${common.upload_speed}
monitor_speed = ${common.monitor_speed}
build_type = debug build_type = debug
debug_tool = esp-prog debug_tool = esp-prog
monitor_filters = esp32_exception_decoder 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 build_flags = -D ESP32_TESTBOARD -D CORE_DEBUG_LEVEL=0
[env:Sonoff4ChPro_ESP32] [env:ESP32_Ch4Pro]
platform = ${ESP32_TEST.platform} platform = ${ESP32_TEST.platform}
board = ${ESP32_TEST.board} board = ${ESP32_TEST.board}
framework = ${common.framework} framework = ${ESP32_TEST.framework}
upload_speed = ${common.upload_speed} upload_speed = ${ESP32_TEST.upload_speed}
monitor_speed = ${common.monitor_speed} monitor_speed = ${ESP32_TEST.monitor_speed}
build_type = ${ESP32_TEST.build_type} build_type = ${ESP32_TEST.build_type}
debug_tool = ${ESP32_TEST.debug_tool} debug_tool = ${ESP32_TEST.debug_tool}
monitor_filters = ${ESP32_TEST.monitor_filters} monitor_filters = ${ESP32_TEST.monitor_filters}
build.filesystem = ${common.build.filesystem} build.filesystem = ${ESP32_TEST.build.filesystem}
lib_deps = ${common.lib_deps} lib_deps = ${ESP32_TEST.lib_deps}
build_flags = ${Sonoff4ChPro.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"PatrixSonoff4ChPro_ESP32\" ${ESP32_TEST.build_flags} 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} platform = ${ESP32_TEST.platform}
board = ${ESP32_TEST.board} board = ${ESP32_TEST.board}
framework = ${common.framework} framework = ${ESP32_TEST.framework}
upload_speed = ${common.upload_speed} upload_speed = ${ESP32_TEST.upload_speed}
monitor_speed = ${common.monitor_speed} monitor_speed = ${ESP32_TEST.monitor_speed}
build_type = ${ESP32_TEST.build_type} build_type = ${ESP32_TEST.build_type}
debug_tool = ${ESP32_TEST.debug_tool} debug_tool = ${ESP32_TEST.debug_tool}
monitor_filters = ${ESP32_TEST.monitor_filters} monitor_filters = ${ESP32_TEST.monitor_filters}
build.filesystem = ${common.build.filesystem} build.filesystem = ${ESP32_TEST.build.filesystem}
lib_deps = ${common.lib_deps} lib_deps = ${ESP32_TEST.lib_deps}
build_flags = ${GosundSP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"PatrixGosundSP111_ESP32\" ${ESP32_TEST.build_flags} build_flags = ${SP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"ESP32_Test_SP111\" ${ESP32_TEST.build_flags}
[env:Greenhouse] [env:Gewaechshaus]
platform = ${Sonoff4ChPro.platform} platform = ${Ch4Pro.platform}
board = ${Sonoff4ChPro.board} board = ${Ch4Pro.board}
framework = ${common.framework} framework = ${Ch4Pro.framework}
upload_speed = ${common.upload_speed} upload_speed = ${Ch4Pro.upload_speed}
monitor_speed = ${common.monitor_speed} monitor_speed = ${Ch4Pro.monitor_speed}
build.filesystem = ${common.build.filesystem} build.filesystem = ${Ch4Pro.build.filesystem}
lib_deps = ${common.lib_deps} 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_protocol = espota
upload_port = 10.0.0.178 upload_port = 10.0.0.178
build_flags = ${Sonoff4ChPro.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"Greenhouse\"
[env:InfraredHeater] [env:Infrarotheizung]
platform = ${GosundSP111.platform} platform = ${SP111.platform}
board = ${GosundSP111.board} board = ${SP111.board}
framework = ${common.framework} framework = ${SP111.framework}
upload_speed = ${common.upload_speed} upload_speed = ${SP111.upload_speed}
monitor_speed = ${common.monitor_speed} monitor_speed = ${SP111.monitor_speed}
build.filesystem = ${common.build.filesystem} build.filesystem = ${SP111.build.filesystem}
lib_deps = ${common.lib_deps} 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_protocol = espota
upload_port = 10.0.0.179 upload_port = 10.0.0.179
build_flags = ${GosundSP111.build_flags} -D WIFI_HOSTNAME_FALLBACK=\"Heater\"

View File

@ -95,7 +95,7 @@ void httpStatus() {
const auto relays = json["relays"].to<JsonArray>(); const auto relays = json["relays"].to<JsonArray>();
relay0.json(relays.add<JsonObject>()); relay0.json(relays.add<JsonObject>());
#ifdef Sonoff4ChPro #ifdef Ch4Pro
relay1.json(relays.add<JsonObject>()); relay1.json(relays.add<JsonObject>());
relay2.json(relays.add<JsonObject>()); relay2.json(relays.add<JsonObject>());
relay3.json(relays.add<JsonObject>()); relay3.json(relays.add<JsonObject>());
@ -117,7 +117,7 @@ void httpSet() {
httpString("mqttPassword", mqttSetPassword); httpString("mqttPassword", mqttSetPassword);
httpRelay(0, relay0); httpRelay(0, relay0);
#ifdef Sonoff4ChPro #ifdef Ch4Pro
httpRelay(1, relay1); httpRelay(1, relay1);
httpRelay(2, relay2); httpRelay(2, relay2);
httpRelay(3, relay3); httpRelay(3, relay3);

View File

@ -1,6 +1,6 @@
#include "io.h" #include "io.h"
#ifdef GosundSP111 #ifdef SP111
#ifndef ESP32_TESTBOARD #ifndef ESP32_TESTBOARD
#define STATUS_PIN 0 #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); Relay relay0(0, "fallback/relay0", "RELAY #0", 15, false, true);
#ifdef GosundSP111 #ifdef SP111
Output relay0Led("relay0Led", 2, true, false); Output relay0Led("relay0Led", 2, true, false);
#endif #endif
#endif #endif
#ifdef Sonoff4ChPro #ifdef Ch4Pro
#ifndef ESP32_TESTBOARD #ifndef ESP32_TESTBOARD
#define STATUS_PIN 13 #define STATUS_PIN 13

View File

@ -12,11 +12,11 @@ extern Button button0;
extern Relay relay0; extern Relay relay0;
#ifdef GosundSP111 #ifdef SP111
extern Output relay0Led; extern Output relay0Led;
#endif #endif
#ifdef Sonoff4ChPro #ifdef Ch4Pro
extern Button button1; extern Button button1;
@ -36,10 +36,10 @@ inline void ioSetup() {
status.setup(); status.setup();
button0.setup(); button0.setup();
relay0.setup(); relay0.setup();
#ifdef GosundSP111 #ifdef SP111
relay0Led.setup(); relay0Led.setup();
#endif #endif
#ifdef Sonoff4ChPro #ifdef Ch4Pro
button1.setup(); button1.setup();
button2.setup(); button2.setup();
button3.setup(); button3.setup();
@ -53,11 +53,11 @@ inline void ioLoop() {
status.loop(); status.loop();
button0.loop(); button0.loop();
relay0.loop(); relay0.loop();
#ifdef GosundSP111 #ifdef SP111
relay0Led.set(relay0.get()); relay0Led.set(relay0.get());
relay0Led.loop(); relay0Led.loop();
#endif #endif
#ifdef Sonoff4ChPro #ifdef Ch4Pro
button1.loop(); button1.loop();
button2.loop(); button2.loop();
button3.loop(); button3.loop();