From 4f8f5e7e3af1d6db7516c87d3a2c0dcb00d675c0 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sat, 30 Dec 2017 01:16:00 +0100 Subject: [PATCH] Fixed Macro save function (Macros now fully working!) --- wled00/wled00.ino | 2 +- wled00/wled03_set.ino | 8 +++++--- wled00/wled13_cronixie.ino | 11 ++--------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 64b30f09e..be3e35cb4 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -25,7 +25,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1712272 +#define VERSION 1712300 //AP and OTA default passwords (change them!) String appass = "wled1234"; diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index 7ee57cb84..bda94f300 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -262,14 +262,16 @@ boolean handleSet(String req) return false; } int pos = 0; + DEBUG_PRINT("API req: "); + DEBUG_PRINTLN(req); - //save macro, requires &MS=,"" format + //save macro, requires &MS=() format pos = req.indexOf("&MS="); if (pos > 0) { int i = req.substring(pos + 4).toInt(); - pos = req.substring(pos + 4).indexOf('"') +1; + pos = req.indexOf('(') +1; if (pos > 0) { - int en = pos+ req.substring(pos).indexOf('"'); + int en = req.indexOf(')'); String mc = req.substring(pos); if (en > 0) mc = req.substring(pos, en); saveMacro(i, mc); diff --git a/wled00/wled13_cronixie.ino b/wled00/wled13_cronixie.ino index b5d539c45..ea7950fdb 100644 --- a/wled00/wled13_cronixie.ino +++ b/wled00/wled13_cronixie.ino @@ -147,7 +147,7 @@ void handleCronixie() local = TZ.toLocal(now(), &tcr); if (cronixieCountdown) { - long diff = countdownTime - now(); + long diff = countdownTime - local; local = abs(diff); if (diff <0 && !countdownOverTriggered) { @@ -165,7 +165,7 @@ void handleCronixie() //this has to be changed in time for 22nd century y -= 2000; if (y<0) y += 30; //makes countdown work - if (cronixieUseAMPM) + if (cronixieUseAMPM && !cronixieCountdown) { if (h>12) 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.trigger(); //this has a drawback, no effects slower than RefreshMs. advantage: Quick update, not dependant on effect time }