Re-added support for 512K flash ESPs

This commit is contained in:
cschwinne 2018-09-17 11:15:08 +02:00
parent 4715180a32
commit bb7f673ff9
9 changed files with 181 additions and 213 deletions

View File

@ -64,10 +64,11 @@ var displayElement=pr.getElementsByClassName("rangeValues")[0];displayElement.in
)=====";
#else
const char PAGE_indexM[] PROGMEM = R"=====(
The Mobile UI is not supported due to limited flash storage. Please go to IP/settings/ui and change the UI mode to "Classic".
Mobile UI is unsupported (limited storage). Go to /settings/ui and change UI mode to "Classic".
)=====";
#endif
/*
* Classic UI Index html
*/

View File

@ -1,10 +1,14 @@
/*
* Settings html
*/
//common CSS of settings pages
const char PAGE_settingsCss[] PROGMEM = R"=====(
body{font-family:var(--cFn),sans-serif;text-align:center;background:var(--cCol);color:var(--tCol);line-height:200%;margin:0;background-attachment:fixed}hr{border-color:var(--dCol);filter:drop-shadow(-5px -5px 5px var(--sCol))}button{background:var(--bCol);color:var(--tCol);font-family:var(--cFn),sans-serif;border:.3ch solid var(--bCol);display:inline-block;filter:drop-shadow(-5px -5px 5px var(--sCol));font-size:20px;margin:8px;margin-top:12px}.helpB{text-align:left;position:absolute;width:60px}input{background:var(--bCol);color:var(--tCol);font-family:var(--cFn),sans-serif;border:.5ch solid var(--bCol);filter:drop-shadow(-5px -5px 5px var(--sCol))}input[type=number]{width:3em}select{background:var(--bCol);color:var(--tCol);font-family:var(--cFn),sans-serif;border:0.5ch solid var(--bCol);filter:drop-shadow( -5px -5px 5px var(--sCol) );}</style>
)=====";
//settings menu
const char PAGE_settings0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head><title>WLED Settings</title>
@ -26,11 +30,14 @@ body{text-align:center;background:var(--cCol);height:100%;margin:0;background-at
</html>
)=====";
//wifi settings
const char PAGE_settings_wifi0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<title>WiFi Settings</title><script>function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#wifi-settings");}function B(){window.history.back();}function GetV(){var d = document;
)=====";
const char PAGE_settings_wifi1[] PROGMEM = R"=====(
</head>
<body onload="GetV()">
@ -72,11 +79,14 @@ AP IP: <span class="sip"> Not active </span><hr>
</html>
)=====";
//LED settings
const char PAGE_settings_leds0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<title>LED Settings</title><script>function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#led-settings");}function B(){window.history.back();}function GetV(){var d = document;
)=====";
const char PAGE_settings_leds1[] PROGMEM = R"=====(
</head>
<body onload="GetV()">
@ -138,12 +148,15 @@ Skip first LED: <input type="checkbox" name="SL"><hr>
</html>
)=====";
//User Interface settings
const char PAGE_settings_ui0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<title>UI Settings</title><script>
function gId(s){return document.getElementById(s);}function S(){GetV();Ct();}function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#user-interface-settings");}function B(){window.history.back();}function Ct(){if (gId("co").selected){gId("cth").style.display="block";}else{gId("cth").style.display="none";}}function GetV(){var d = document;
)=====";
const char PAGE_settings_ui1[] PROGMEM = R"=====(
</head>
<body onload="S()">
@ -195,11 +208,14 @@ Make sure the font you use is installed on your system!<br>
</html>
)=====";
//sync settings
const char PAGE_settings_sync0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head><title>Sync Settings</title>
<script>function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#sync-settings");}function B(){window.open("/settings","_self");}function GetV(){var d = document;
)=====";
const char PAGE_settings_sync1[] PROGMEM = R"=====(
</head>
<body onload="GetV()">
@ -252,11 +268,14 @@ Hue status: <span class="hms"> Internal ESP Error! </span><hr>
</html>
)=====";
//time and macro settings
const char PAGE_settings_time0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head><title>Time Settings</title>
<script>function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#time-settings");}function B(){window.open("/settings","_self");}function S(){GetV();Cs();}function gId(s){return document.getElementById(s);}function Cs(){gId("cac").style.display="none";gId("coc").style.display="block";gId("ccc").style.display="none";if (gId("ca").selected){gId("cac").style.display="block";}if (gId("cc").selected){gId("coc").style.display="none";gId("ccc").style.display="block";}if (gId("cn").selected){gId("coc").style.display="none";}}function GetV(){var d = document;
)=====";
const char PAGE_settings_time1[] PROGMEM = R"=====(
</head>
<body onload="S()">
@ -338,12 +357,15 @@ Timed-Light-Over Macro: <input name="MN" type="number" min="0" max="16" required
</html>
)=====";
//security settings and about
const char PAGE_settings_sec0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<title>Misc Settings</title>
<script>function H(){window.open("https://github.com/Aircoookie/WLED/wiki/Settings#security-settings");}function B(){window.open("/settings","_self");}function U(){window.open("/update","_self");}function GetV(){var d = document;
)=====";
const char PAGE_settings_sec1[] PROGMEM = R"=====(
</head>
<body onload="GetV()">

View File

@ -1,27 +1,36 @@
//USER HTML
/*
* Various pages
*/
//USER HTML HERE (/u subpage)
const char PAGE_usermod[] PROGMEM = R"=====(
<html><body>There is no usermod installed or it doesn't specify a custom web page.</body></html>
)=====";
/*
* Various
*/
//server message
const char PAGE_msg0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<title>WLED Message</title>
<script>function B(){window.history.back()};function RS(){window.location = "/settings";}function RP(){top.location.href="/";}</script>
)=====";
const char PAGE_msg1[] PROGMEM = R"=====(
button{background:var(--bCol);color:var(--tCol);font-family:var(--cFn),sans-serif;border:.3ch solid var(--bCol);display:inline-block;filter:drop-shadow(-5px -5px 5px var(--sCol));font-size:20px;margin:8px;margin-top:12px}body{font-family:var(--cFn),sans-serif;text-align:center;background:var(--cCol);color:var(--tCol);line-height:200%;margin:0;background-attachment:fixed}</style>
</head>
<body>
)=====";
//new user welcome page
#ifndef WLED_FLASH_512K_MODE
const char PAGE_welcome0[] PROGMEM = R"=====(
<!DOCTYPE html>
<html><head>
<title>WLED Welcome!</title>
)=====";
const char PAGE_welcome1[] PROGMEM = R"=====(
body{font-family:var(--cFn),sans-serif;text-align:center;background:linear-gradient(var(--bCol),black);height:100%;margin:0;background-repeat:no-repeat;background-attachment: fixed;color: var(--tCol);}svg {fill: var(--dCol);}
</style></head>
@ -41,6 +50,11 @@ Connect the module to your local WiFi <a href="/settings/wifi">here</a>!<br><br>
<i>Just trying this out in AP mode?</i> <a href="/sliders">Here are the controls.</a><br>
</body></html>
)=====";
#else
const char PAGE_welcome0[] PROGMEM = "";
const char PAGE_welcome1[] PROGMEM = "";
#endif
/*
* SPIFFS editor html
@ -54,6 +68,8 @@ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a
#else
const char PAGE_edit[] PROGMEM = R"=====(SPIFFS disabled)=====";
#endif
/*
* favicon
*/

View File

@ -1,4 +1,9 @@
/*
* Color palettes for FastLED effects (65-73).
*/
// From ColorWavesWithPalettes by Mark Kriegsman: https://gist.github.com/kriegsman/8281905786e8b2632aeb
// Unfortunaltely, these are stored in RAM!
// Gradient palette "ib_jul01_gp", originally from
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/xmas/tn/ib_jul01.png.index.html

View File

@ -8,9 +8,8 @@
*/
//ESP8266-01 got too little storage space to work with all features of WLED. To use it, you must use ESP8266 Arduino Core v2.3.0 and the setting 512K(64K SPIFFS).
//Uncomment the following line to disable some features (currently Mobile UI) to compile for ESP8266-01
//#define WLED_FLASH_512K_MODE
//NOT SUPPORTED IN CURRENT VERSION
//Uncomment the following line to disable some features (currently Mobile UI, welcome page and single digit + cronixie overlays) to compile for ESP8266-01
#define WLED_FLASH_512K_MODE
//library inclusions
@ -44,7 +43,7 @@
//version code in format yymmddb (b = daily build)
#define VERSION 1809151
#define VERSION 1809162
char versionString[] = "0.8.0-a";
@ -58,7 +57,7 @@ char otaPass[33] = "wledota";
//to toggle usb serial debug (un)comment following line(s)
#define DEBUG
//#define DEBUG
//Hardware CONFIG (only changeble HERE, not at runtime)
@ -157,7 +156,7 @@ bool arlsDisableGammaCorrection = true; //activate if gamma correction is
bool arlsForceMaxBri = false; //enable to force max brightness if source has very dark colors that would be black
bool e131Enabled = true; //settings for E1.31 (sACN) protocol
byte e131Universe = 1;
uint16_t e131Universe = 1;
bool e131Multicast = false;
bool huePollingEnabled = false; //poll hue bridge for light state

View File

@ -13,6 +13,8 @@ void _setRandomColor(bool _sec,bool fromButton=false)
if (fromButton) colorUpdated(2);
}
//called upon POST settings form submit
void handleSettingsSet(byte subPage)
{
//0: menu 1: wifi 2: leds 3: ui 4: sync 5: time 6: sec
@ -21,59 +23,42 @@ void handleSettingsSet(byte subPage)
//WIFI SETTINGS
if (subPage == 1)
{
if (server.hasArg("CS")) strcpy(clientSSID,server.arg("CS").c_str());
if (server.hasArg("CP"))
{
if (!server.arg("CP").indexOf('*') == 0)
{
strcpy(clientPass,server.arg("CP").c_str());
}
}
if (server.hasArg("CM")) strcpy(cmDNS,server.arg("CM").c_str());
if (server.hasArg("AT"))
{
int i = server.arg("AT").toInt();
if (i >= 0 && i <= 255) apWaitTimeSecs = i;
}
if (server.hasArg("AS")) strcpy(apSSID,server.arg("AS").c_str());
strcpy(clientSSID,server.arg("CS").c_str());
if (server.arg("CP").charAt(0) != '*') strcpy(clientPass, server.arg("CP").c_str());
strcpy(cmDNS, server.arg("CM").c_str());
int t = server.arg("AT").toInt(); if (t > 9 && t <= 255) apWaitTimeSecs = t;
strcpy(apSSID, server.arg("AS").c_str());
apHide = server.hasArg("AH");
if (server.hasArg("AP"))
{
if (server.arg("AP").charAt(0) != '*') strcpy(apPass,server.arg("AP").c_str());
}
if (server.hasArg("AC"))
{
int chan = server.arg("AC").toInt();
if (chan > 0 && chan < 14) apChannel = chan;
}
char k[3]; k[2] = 0; int j = 0;
if (server.arg("AP").charAt(0) != '*') strcpy(apPass, server.arg("AP").c_str());
t = server.arg("AC").toInt(); if (t > 0 && t < 14) apChannel = t;
char k[3]; k[2] = 0;
for (int i = 0; i<4; i++)
{
k[1] = i+48;
k[1] = i+48;//ascii 0,1,2,3
k[0] = 'I'; //static IP
if (server.hasArg(k)) j = server.arg(k).toInt();
if (j >= 0 && j <= 255) staticIP[i] = j;
staticIP[i] = server.arg(k).toInt();
k[0] = 'G'; //gateway
if (server.hasArg(k)) j = server.arg(k).toInt();
if (j >= 0 && j <= 255) staticGateway[i] = j;
staticGateway[i] = server.arg(k).toInt();
k[0] = 'S'; //subnet
if (server.hasArg(k)) j = server.arg(k).toInt();
if (j >= 0 && j <= 255) staticSubnet[i] = j;
staticSubnet[i] = server.arg(k).toInt();
}
}
//LED SETTINGS
if (subPage == 2)
{
if (server.hasArg("LC"))
{
int i = server.arg("LC").toInt();
if (i > 0 && i <= 1200) ledCount = i;
int t = server.arg("LC").toInt();
if (t > 0 && t <= 1200) ledCount = t;
//RMT eats up too much RAM
#ifdef ARDUINO_ARCH_ESP32
if (ledCount > 600) ledCount = 600;
#endif
}
useRGBW = server.hasArg("EW");
autoRGBtoRGBW = server.hasArg("AW");
if (server.hasArg("IS")) //ignore settings and save current brightness, colors and fx as default
@ -81,141 +66,75 @@ void handleSettingsSet(byte subPage)
colS[0] = col[0];
colS[1] = col[1];
colS[2] = col[2];
if (useRGBW) whiteS = white;
colSecS[0] = colSec[0];
colSecS[1] = colSec[1];
colSecS[2] = colSec[2];
whiteS = white;
whiteSecS = whiteSec;
briS = bri;
effectDefault = effectCurrent;
effectSpeedDefault = effectSpeed;
effectIntensityDefault = effectIntensity;
effectPaletteDefault = effectPalette;
} else {
if (server.hasArg("CR"))
{
int i = server.arg("CR").toInt();
if (i >= 0 && i <= 255) colS[0] = i;
}
if (server.hasArg("CG"))
{
int i = server.arg("CG").toInt();
if (i >= 0 && i <= 255) colS[1] = i;
}
if (server.hasArg("CB"))
{
int i = server.arg("CB").toInt();
if (i >= 0 && i <= 255) colS[2] = i;
}
if (server.hasArg("SR"))
{
int i = server.arg("SR").toInt();
if (i >= 0 && i <= 255) colSecS[0] = i;
}
if (server.hasArg("SG"))
{
int i = server.arg("SG").toInt();
if (i >= 0 && i <= 255) colSecS[1] = i;
}
if (server.hasArg("SB"))
{
int i = server.arg("SB").toInt();
if (i >= 0 && i <= 255) colSecS[2] = i;
}
if (server.hasArg("SW"))
{
int i = server.arg("SW").toInt();
if (i >= 0 && i <= 255) whiteSecS = i;
}
if (server.hasArg("CW"))
{
int i = server.arg("CW").toInt();
if (i >= 0 && i <= 255) whiteS = i;
}
if (server.hasArg("CA"))
{
int i = server.arg("CA").toInt();
if (i >= 0 && i <= 255) briS = i;
}
if (server.hasArg("FX"))
{
int i = server.arg("FX").toInt();
if (i >= 0 && i <= 255) effectDefault = i;
}
if (server.hasArg("SX"))
{
int i = server.arg("SX").toInt();
if (i >= 0 && i <= 255) effectSpeedDefault = i;
}
if (server.hasArg("IX"))
{
int i = server.arg("IX").toInt();
if (i >= 0 && i <= 255) effectIntensityDefault = i;
}
if (server.hasArg("FP"))
{
int i = server.arg("FP").toInt();
if (i >= 0 && i <= 255) effectPaletteDefault = i;
}
colS[0] = server.arg("CR").toInt();
colS[1] = server.arg("CG").toInt();
colS[2] = server.arg("CB").toInt();
colSecS[0] = server.arg("SR").toInt();
colSecS[1] = server.arg("SG").toInt();
colSecS[2] = server.arg("SB").toInt();
whiteS = server.arg("CW").toInt();
whiteSecS = server.arg("SW").toInt();
briS = server.arg("CA").toInt();
effectDefault = server.arg("FX").toInt();
effectSpeedDefault = server.arg("SX").toInt();
effectIntensityDefault = server.arg("IX").toInt();
effectPaletteDefault = server.arg("FP").toInt();
}
saveCurrPresetCycConf = server.hasArg("PC");
turnOnAtBoot = server.hasArg("BO");
if (server.hasArg("BP"))
{
int i = server.arg("BP").toInt();
if (i >= 0 && i <= 25) bootPreset = i;
}
t = server.arg("BP").toInt();
if (t <= 25) bootPreset = t;
useGammaCorrectionBri = server.hasArg("GB");
useGammaCorrectionRGB = server.hasArg("GC");
fadeTransition = server.hasArg("TF");
if (server.hasArg("TD"))
{
int i = server.arg("TD").toInt();
if (i > 0){
transitionDelay = i;
}
}
t = server.arg("TD").toInt();
if (t > 0) transitionDelay = t;
strip.paletteFade = server.hasArg("PF");
enableSecTransition = server.hasArg("T2");
if (server.hasArg("TB"))
{
nightlightTargetBri = server.arg("TB").toInt();
}
if (server.hasArg("TL"))
{
int i = server.arg("TL").toInt();
if (i > 0) nightlightDelayMins = i;
}
t = server.arg("TL").toInt();
if (t > 0) nightlightDelayMins = t;
nightlightFade = server.hasArg("TW");
reverseMode = server.hasArg("RV");
if (server.hasArg("PB"))
{
int i = server.arg("PB").toInt();
if (i >= 0){
strip.paletteBlend = i;
}
}
t = server.arg("PB").toInt();
if (t >= 0 && t < 4) strip.paletteBlend = t;
initLedsLast = server.hasArg("EI");
reverseMode = server.hasArg("RV");
strip.setReverseMode(reverseMode);
skipFirstLed = server.hasArg("SL");
if (server.hasArg("BF"))
{
int i = server.arg("BF").toInt();
if (i > 0) briMultiplier = i;
}
t = server.arg("BF").toInt();
if (t > 0) briMultiplier = t;
}
//UI
if (subPage == 3)
{
if (server.hasArg("UI")) uiConfiguration = server.arg("UI").toInt();
if (server.hasArg("DS")) strcpy(serverDescription,server.arg("DS").c_str());
int t = server.arg("UI").toInt();
if (t >= 0 && t < 3) uiConfiguration = t;
strcpy(serverDescription, server.arg("DS").c_str());
useHSBDefault = server.hasArg("MD");
useHSB = useHSBDefault;
if (server.hasArg("TH")) currentTheme = server.arg("TH").toInt();
currentTheme = server.arg("TH").toInt();
char k[3]; k[0]='C'; k[2]=0;
for(int i=0;i<6;i++)
{
k[1] = i+48;
if (server.hasArg(k)) strcpy(cssCol[i],server.arg(k).c_str());
strcpy(cssCol[i],server.arg(k).c_str());
}
if (server.hasArg("CF")) strcpy(cssFont,server.arg("CF").c_str());
strcpy(cssFont,server.arg("CF").c_str());
buildCssColorString();
}
@ -223,10 +142,8 @@ void handleSettingsSet(byte subPage)
if (subPage == 4)
{
buttonEnabled = server.hasArg("BT");
if (server.hasArg("UP"))
{
udpPort = server.arg("UP").toInt();
}
int t = server.arg("UP").toInt();
if (t > 0) udpPort = t;
receiveNotificationBrightness = server.hasArg("RB");
receiveNotificationColor = server.hasArg("RC");
receiveNotificationEffects = server.hasArg("RX");
@ -235,45 +152,36 @@ void handleSettingsSet(byte subPage)
notifyDirect = notifyDirectDefault;
notifyButton = server.hasArg("SB");
notifyTwice = server.hasArg("S2");
receiveDirect = server.hasArg("RD");
if (server.hasArg("EU"))
{
int i = server.arg("EU").toInt();
if (i > 0 && i <= 63999) realtimeTimeoutMs = i;
}
if (server.hasArg("ET"))
{
int i = server.arg("ET").toInt();
if (i > 99 && i <= 65000) realtimeTimeoutMs = i;
}
t = server.arg("EU").toInt();
if (t > 0 && t <= 63999) e131Universe = t;
t = server.arg("ET").toInt();
if (t > 99 && t <= 65000) realtimeTimeoutMs = t;
arlsForceMaxBri = server.hasArg("FB");
arlsDisableGammaCorrection = server.hasArg("RG");
if (server.hasArg("WO"))
{
int i = server.arg("WO").toInt();
if (i >= -255 && i <= 255) arlsOffset = i;
}
t = server.arg("WO").toInt();
if (t >= -255 && t <= 255) arlsOffset = t;
enableRealtimeUI = server.hasArg("RU");
alexaEnabled = server.hasArg("AL");
if (server.hasArg("AI")) strcpy(alexaInvocationName,server.arg("AI").c_str());
strcpy(alexaInvocationName, server.arg("AI").c_str());
notifyAlexa = server.hasArg("SA");
if (server.hasArg("BK") && !server.arg("BK").equals("Hidden")) {strcpy(blynkApiKey,server.arg("BK").c_str()); initBlynk(blynkApiKey);}
notifyHue = server.hasArg("SH");
for (int i=0;i<4;i++){
String a = "H"+String(i);
if (server.hasArg(a))
hueIP[i] = server.arg(a).toInt();
}
if (server.hasArg("HL"))
{
int i = server.arg("HL").toInt();
if (i > 0) huePollLightId = i;
}
if (server.hasArg("HI"))
{
int i = server.arg("HI").toInt();
if (i > 50) huePollIntervalMs = i;
}
t = server.arg("HL").toInt();
if (t > 0) huePollLightId = t;
t = server.arg("HI").toInt();
if (t > 50) huePollIntervalMs = t;
hueApplyOnOff = server.hasArg("HO");
hueApplyBri = server.hasArg("HB");
hueApplyColor = server.hasArg("HC");
@ -293,22 +201,22 @@ void handleSettingsSet(byte subPage)
{
ntpEnabled = server.hasArg("NT");
useAMPM = !server.hasArg("CF");
if (server.hasArg("TZ")) currentTimezone = server.arg("TZ").toInt();
if (server.hasArg("UO")) utcOffsetSecs = server.arg("UO").toInt();
currentTimezone = server.arg("TZ").toInt();
utcOffsetSecs = server.arg("UO").toInt();
if (ntpEnabled && WiFi.status() == WL_CONNECTED && !ntpConnected) ntpConnected = ntpUdp.begin(ntpLocalPort); //start if not already connected
if (server.hasArg("OL")){
overlayDefault = server.arg("OL").toInt();
overlayCurrent = overlayDefault;
;
}
if (server.hasArg("O1")) overlayMin = server.arg("O1").toInt();
if (server.hasArg("O2")) overlayMax = server.arg("O2").toInt();
if (server.hasArg("OM")) analogClock12pixel = server.arg("OM").toInt();
overlayMin = server.arg("O1").toInt();
overlayMax = server.arg("O2").toInt();
analogClock12pixel = server.arg("OM").toInt();
analogClock5MinuteMarks = server.hasArg("O5");
analogClockSecondsTrail = server.hasArg("OS");
if (server.hasArg("CX")) strcpy(cronixieDisplay,server.arg("CX").c_str());
strcpy(cronixieDisplay,server.arg("CX").c_str());
bool cbOld = cronixieBacklight;
cronixieBacklight = server.hasArg("CB");
if (cbOld != cronixieBacklight && overlayCurrent == 4)
@ -316,25 +224,25 @@ void handleSettingsSet(byte subPage)
strip.setCronixieBacklight(cronixieBacklight); overlayRefreshedTime = 0;
}
countdownMode = server.hasArg("CE");
if (server.hasArg("CY")) countdownYear = server.arg("CY").toInt();
if (server.hasArg("CI")) countdownMonth = server.arg("CI").toInt();
if (server.hasArg("CD")) countdownDay = server.arg("CD").toInt();
if (server.hasArg("CH")) countdownHour = server.arg("CH").toInt();
if (server.hasArg("CM")) countdownMin = server.arg("CM").toInt();
if (server.hasArg("CS")) countdownSec = server.arg("CS").toInt();
countdownYear = server.arg("CY").toInt();
countdownMonth = server.arg("CI").toInt();
countdownDay = server.arg("CD").toInt();
countdownHour = server.arg("CH").toInt();
countdownMin = server.arg("CM").toInt();
countdownSec = server.arg("CS").toInt();
for (int i=1;i<17;i++)
{
String a = "M"+String(i);
if (server.hasArg(a)) saveMacro(i,server.arg(a),false);
}
if (server.hasArg("MB")) macroBoot = server.arg("MB").toInt();
if (server.hasArg("A0")) macroAlexaOn = server.arg("A0").toInt();
if (server.hasArg("A1")) macroAlexaOff = server.arg("A1").toInt();
if (server.hasArg("MP")) macroButton = server.arg("MP").toInt();
if (server.hasArg("ML")) macroLongPress = server.arg("ML").toInt();
if (server.hasArg("MC")) macroCountdown = server.arg("MC").toInt();
if (server.hasArg("MN")) macroNl = server.arg("MN").toInt();
macroBoot = server.arg("MB").toInt();
macroAlexaOn = server.arg("A0").toInt();
macroAlexaOff = server.arg("A1").toInt();
macroButton = server.arg("MP").toInt();
macroLongPress = server.arg("ML").toInt();
macroCountdown = server.arg("MC").toInt();
macroNl = server.arg("MN").toInt();
}
//SECURITY
@ -375,9 +283,8 @@ void handleSettingsSet(byte subPage)
bool handleSet(String req)
{
bool effectUpdated = false;
if (!(req.indexOf("win") >= 0)) {
return false;
}
if (!(req.indexOf("win") >= 0)) return false;
int pos = 0;
DEBUG_PRINT("API req: ");
DEBUG_PRINTLN(req);

View File

@ -118,7 +118,7 @@ void wledInit()
server.on("/settings/wifi", HTTP_POST, [](){
if (!(wifiLock && otaLock)) handleSettingsSet(1);
serveMessage(200,"WiFi settings saved.","Rebooting now... (takes ~20 seconds, wait for auto-redirect)",139);
serveMessage(200,"WiFi settings saved.","Rebooting now...",255);
reset();
});
@ -488,6 +488,10 @@ void serveSettings(byte subPage)
//0: menu 1: wifi 2: leds 3: ui 4: sync 5: time 6: sec 255: welcomepage
if (!realtimeActive || enableRealtimeUI) //do not serve while receiving realtime
{
#ifdef WLED_FLASH_512K_MODE //disable welcome page if not enough storage
if (subPage == 255) {serveIndex(); return;}
#endif
int pl0, pl1;
switch (subPage)
{

View File

@ -16,6 +16,7 @@ void initCronixie()
}
}
void _nixieDisplay(int num[], uint16_t dur[], uint16_t pausedur[], byte cnt)
{
strip.setRange(overlayMin, overlayMax, 0);
@ -116,6 +117,7 @@ void _nixieNumber(int number, int dur)
}
}
void handleOverlays()
{
if (millis() - overlayRefreshedTime > overlayRefreshMs)
@ -181,6 +183,10 @@ void _overlayAnalogClock()
void _overlayNixieClock()
{
#ifdef WLED_FLASH_512K_MODE
if (countdownMode) checkCountdown();
#else
if (countdownMode)
{
_overlayNixieCountdown(); return;
@ -265,6 +271,7 @@ void _overlayNixieClock()
{
_nixieDisplay(overlayArr, overlayDur, overlayPauseDur, 6);
}
#endif
}
void _overlayAnalogCountdown()
@ -312,6 +319,7 @@ void _overlayAnalogCountdown()
overlayRefreshMs = 998;
}
void _overlayNixieCountdown()
{
if (now() >= countdownTime)

View File

@ -19,6 +19,7 @@ byte getSameCodeLength(char code, int index, char const cronixieDisplay[])
void setCronixie()
{
#ifndef WLED_FLASH_512K_MODE
/*
* digit purpose index
* 0-9 | 0-9 (incl. random)
@ -139,11 +140,14 @@ void setCronixie()
DEBUG_PRINTLN((int)dP[5]);
_overlayCronixie(); //refresh
#endif
}
void _overlayCronixie()
{
if (countdownMode) checkCountdown();
#ifndef WLED_FLASH_512K_MODE
byte h = hour(local);
byte h0 = h;
byte m = minute(local);
@ -208,4 +212,6 @@ void _overlayCronixie()
}
strip.setCronixieDigits(_digitOut);
//strip.trigger(); //this has a drawback, no effects slower than RefreshMs. advantage: Quick update, not dependant on effect time
#endif
}