Fixed Macro save function

(Macros now fully working!)
This commit is contained in:
cschwinne 2017-12-30 01:16:00 +01:00
parent 745c1d7bc1
commit 4f8f5e7e3a
3 changed files with 8 additions and 13 deletions

View File

@ -25,7 +25,7 @@
#include "WS2812FX.h" #include "WS2812FX.h"
//version in format yymmddb (b = daily build) //version in format yymmddb (b = daily build)
#define VERSION 1712272 #define VERSION 1712300
//AP and OTA default passwords (change them!) //AP and OTA default passwords (change them!)
String appass = "wled1234"; String appass = "wled1234";

View File

@ -262,14 +262,16 @@ boolean handleSet(String req)
return false; return false;
} }
int pos = 0; int pos = 0;
DEBUG_PRINT("API req: ");
DEBUG_PRINTLN(req);
//save macro, requires &MS=<slot>,"<macro>" format //save macro, requires &MS=<slot>(<macro>) format
pos = req.indexOf("&MS="); pos = req.indexOf("&MS=");
if (pos > 0) { if (pos > 0) {
int i = req.substring(pos + 4).toInt(); int i = req.substring(pos + 4).toInt();
pos = req.substring(pos + 4).indexOf('"') +1; pos = req.indexOf('(') +1;
if (pos > 0) { if (pos > 0) {
int en = pos+ req.substring(pos).indexOf('"'); int en = req.indexOf(')');
String mc = req.substring(pos); String mc = req.substring(pos);
if (en > 0) mc = req.substring(pos, en); if (en > 0) mc = req.substring(pos, en);
saveMacro(i, mc); saveMacro(i, mc);

View File

@ -147,7 +147,7 @@ void handleCronixie()
local = TZ.toLocal(now(), &tcr); local = TZ.toLocal(now(), &tcr);
if (cronixieCountdown) if (cronixieCountdown)
{ {
long diff = countdownTime - now(); long diff = countdownTime - local;
local = abs(diff); local = abs(diff);
if (diff <0 && !countdownOverTriggered) if (diff <0 && !countdownOverTriggered)
{ {
@ -165,7 +165,7 @@ void handleCronixie()
//this has to be changed in time for 22nd century //this has to be changed in time for 22nd century
y -= 2000; if (y<0) y += 30; //makes countdown work y -= 2000; if (y<0) y += 30; //makes countdown work
if (cronixieUseAMPM) if (cronixieUseAMPM && !cronixieCountdown)
{ {
if (h>12) h-=12; if (h>12) h-=12;
else if (h==0) h+=12; else if (h==0) h+=12;
@ -217,13 +217,6 @@ void handleCronixie()
} }
} }
} }
DEBUG_PRINT("out ");
for (int i = 0; i < 5; i++)
{
DEBUG_PRINT((int)_digitOut[i]);
DEBUG_PRINT(" ");
}
DEBUG_PRINTLN((int)_digitOut[5]);
strip.setCronixieDigits(_digitOut); strip.setCronixieDigits(_digitOut);
//strip.trigger(); //this has a drawback, no effects slower than RefreshMs. advantage: Quick update, not dependant on effect time //strip.trigger(); //this has a drawback, no effects slower than RefreshMs. advantage: Quick update, not dependant on effect time
} }