commit
d32d4e21e9
@ -32,4 +32,4 @@ install:
|
||||
- pip install -U platformio
|
||||
- platformio update
|
||||
script:
|
||||
- platformio ci --project-conf=./platformio.ini -v
|
||||
- platformio ci --project-conf=./platformio.ini
|
||||
|
@ -10,6 +10,7 @@ lib_dir = ./wled00/src
|
||||
; env_default = nodemcuv2
|
||||
; env_default = esp01
|
||||
; env_default = esp01_1m
|
||||
; env_default = esp07
|
||||
; env_default = d1_mini
|
||||
; env_default = esp32dev
|
||||
; env_default = esp8285_4CH_MagicHome
|
||||
@ -43,7 +44,9 @@ lib_deps_external =
|
||||
#Timezone@1.2.1
|
||||
#For use SSD1306 0.91" OLED display uncomment following
|
||||
#U8g2@~2.27.2
|
||||
|
||||
#For Dallas sensor uncomment following 2 lines
|
||||
#DallasTemperature@~3.8.0
|
||||
#OneWire@~2.3.5
|
||||
[common:esp8266]
|
||||
# ------------------------------------------------------------------------------
|
||||
# PLATFORM:
|
||||
@ -156,6 +159,18 @@ build_flags =
|
||||
lib_deps =
|
||||
${common.lib_deps_external}
|
||||
|
||||
[env:esp07]
|
||||
board = esp07
|
||||
platform = ${common:esp8266.platform}
|
||||
monitor_speed = ${common.monitor_speed}
|
||||
upload_speed = ${common.upload_speed}
|
||||
framework = ${common.framework}
|
||||
build_flags =
|
||||
${common.build_flags}
|
||||
${common:esp8266.build_flags}
|
||||
lib_deps =
|
||||
${common.lib_deps_external}
|
||||
|
||||
# see: http://docs.platformio.org/en/latest/platforms/espressif32.html
|
||||
[env:esp32dev]
|
||||
board = esp32dev
|
||||
|
@ -39,6 +39,8 @@ uint8_t knownMode = 0;
|
||||
uint8_t knownPalette = 0;
|
||||
|
||||
long lastUpdate = 0;
|
||||
long lastRedraw = 0;
|
||||
bool displayTurnedOff = false;
|
||||
// How often we are redrawing screen
|
||||
#define USER_LOOP_REFRESH_RATE_MS 5000
|
||||
|
||||
@ -50,8 +52,14 @@ void userLoop() {
|
||||
}
|
||||
lastUpdate = millis();
|
||||
|
||||
// Check if values which are shown on display changed from the last tiem.
|
||||
if ((apActive == true ? String(apSSID) : WiFi.SSID()) != knownSsid) {
|
||||
// Turn off display after 3 minutes with no change.
|
||||
if(!displayTurnedOff && millis() - lastRedraw > 3*60*1000) {
|
||||
u8x8.setPowerSave(1);
|
||||
displayTurnedOff = true;
|
||||
}
|
||||
|
||||
// Check if values which are shown on display changed from the last time.
|
||||
if (((apActive) ? String(apSSID) : WiFi.SSID()) != knownSsid) {
|
||||
needRedraw = true;
|
||||
} else if (knownIp != (apActive ? IPAddress(4, 3, 2, 1) : WiFi.localIP())) {
|
||||
needRedraw = true;
|
||||
@ -68,6 +76,13 @@ void userLoop() {
|
||||
}
|
||||
needRedraw = false;
|
||||
|
||||
if (displayTurnedOff)
|
||||
{
|
||||
u8x8.setPowerSave(0);
|
||||
displayTurnedOff = false;
|
||||
}
|
||||
lastRedraw = millis();
|
||||
|
||||
// Update last known values.
|
||||
#if defined(ESP8266)
|
||||
knownSsid = apActive ? WiFi.softAPSSID() : WiFi.SSID();
|
||||
|
Loading…
Reference in New Issue
Block a user