create 2 variants (env)
This commit is contained in:
+15
-2
@@ -8,11 +8,10 @@
|
|||||||
; 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 =
|
||||||
@@ -23,3 +22,17 @@ 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
|
||||||
|
|||||||
@@ -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
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user