create 2 variants (env)

This commit is contained in:
Flo
2026-03-10 07:34:25 +01:00
parent c49c537dbc
commit 3cfabb85df
3 changed files with 25 additions and 10 deletions
+21 -8
View File
@@ -8,18 +8,31 @@
; Please visit documentation for the other options and examples ; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[env:nodemcu-32s] [common]
platform = espressif32 platform = espressif32
board = nodemcu-32s board = nodemcu-32s
framework = arduino framework = arduino
upload_port = COM3
upload_speed = 921600 upload_speed = 921600
monitor_speed = 115200 monitor_speed = 115200
build_flags = build_flags =
-I ./src/xcp -I ./src/xcp
-I ./src/Receivers433 -I ./src/Receivers433
-I ./src/Receivers433/Receivers3ByteKeys -I ./src/Receivers433/Receivers3ByteKeys
lib_deps = lib_deps =
adafruit/Adafruit GFX Library@^1.12.4 adafruit/Adafruit GFX Library@^1.12.4
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.6.1 thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.6.1
knolleary/PubSubClient @ ^2.8 knolleary/PubSubClient @ ^2.8
[env:EG]
extends = common
upload_port = COM3
build_flags =
${common.build_flags}
-D VERSION_DG_ONLY=0
[env:DG]
extends = common
upload_port = COM3
build_flags =
${common.build_flags}
-D VERSION_DG_ONLY=1
+1 -1
View File
@@ -124,7 +124,7 @@ void MyMqttClient::onLoop()
{ {
char payload[48]; char payload[48];
snprintf(payload, sizeof(payload), snprintf(payload, sizeof(payload),
"{\"event\":\"rssi\",\"rssi\":%d}", (int)WiFi.RSSI()); "{\"event\":\"rssi\",\"rssi\":%d, \"variant\": \"" PROJECT_VARIANT "\" }", (int)WiFi.RSSI());
mqttClient.publish(MQTT_TOPIC_STATUS, payload); mqttClient.publish(MQTT_TOPIC_STATUS, payload);
} }
} }
+3 -1
View File
@@ -22,7 +22,9 @@
/* --------- SYMBOLIC CONSTANTS ---------*/ /* --------- SYMBOLIC CONSTANTS ---------*/
#define VERSION_DG_ONLY 0 #ifndef VERSION_DG_ONLY
#define VERSION_DG_ONLY 0 /* default: EG — overridden by build environment */
#endif
#define VERSION_SMALL_DISPLAY 1 #define VERSION_SMALL_DISPLAY 1