diff --git a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.h b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.h index 0c0614c474..c289cc32ad 100644 --- a/usermods/usermod_v2_auto_save/usermod_v2_auto_save.h +++ b/usermods/usermod_v2_auto_save/usermod_v2_auto_save.h @@ -64,7 +64,7 @@ class AutoSaveUsermod : public Usermod { PSTR("~ %02d-%02d %02d:%02d:%02d ~"), month(localTime), day(localTime), hour(localTime), minute(localTime), second(localTime)); - savePreset(autoSavePreset, true, presetNameBuffer); + savePreset(autoSavePreset, presetNameBuffer); } void inline displayOverlay() { diff --git a/usermods/word-clock-matrix/word-clock-matrix.cpp b/usermods/word-clock-matrix/word-clock-matrix.cpp index 5c8985f174..628b52625a 100644 --- a/usermods/word-clock-matrix/word-clock-matrix.cpp +++ b/usermods/word-clock-matrix/word-clock-matrix.cpp @@ -65,7 +65,7 @@ void hourChime() //strip.resetSegments(); selectWordSegments(true); colorUpdated(CALL_MODE_FX_CHANGED); - savePreset(13, false); + //savePreset(255); selectWordSegments(false); //strip.getSegment(0).setOption(0, true); strip.getSegment(0).setOption(2, true); @@ -299,7 +299,7 @@ void userLoop() if (minute(localTime) == 1){ //turn off background segment; strip.getSegment(0).setOption(2, false); - //applyPreset(13); + //applyPreset(255); } } } diff --git a/wled00/bus_wrapper.h b/wled00/bus_wrapper.h index 4b939a0c92..436239395c 100644 --- a/wled00/bus_wrapper.h +++ b/wled00/bus_wrapper.h @@ -133,7 +133,7 @@ #endif //APA102 -#define B_HS_DOT_3 NeoPixelBrightnessBus //hardware SPI +#define B_HS_DOT_3 NeoPixelBrightnessBus //hardware SPI #define B_SS_DOT_3 NeoPixelBrightnessBus //soft SPI //LPD8806 diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index c0deaefa8f..5762708975 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -190,8 +190,8 @@ void handlePlaylist(); //presets.cpp bool applyPreset(byte index, byte callMode = CALL_MODE_DIRECT_CHANGE); inline bool applyTemporaryPreset() {return applyPreset(255);}; -void savePreset(byte index, bool persist = true, const char* pname = nullptr, JsonObject saveobj = JsonObject()); -inline void saveTemporaryPreset() {savePreset(255, false);}; +void savePreset(byte index, const char* pname = nullptr, JsonObject saveobj = JsonObject()); +inline void saveTemporaryPreset() {savePreset(255);}; void deletePreset(byte index); //set.cpp diff --git a/wled00/ir.cpp b/wled00/ir.cpp index 5e1577445d..57b43c1651 100644 --- a/wled00/ir.cpp +++ b/wled00/ir.cpp @@ -699,7 +699,7 @@ void decodeIRJson(uint32_t code) char pname[33]; sprintf_P(pname, PSTR("IR Preset %d"), psave); fdo.clear(); - if (psave > 0 && psave < 251) savePreset(psave, true, pname, fdo); + if (psave > 0 && psave < 251) savePreset(psave, pname, fdo); } } releaseJSONBufferLock(); diff --git a/wled00/json.cpp b/wled00/json.cpp index e6077a05f1..3637bbbf53 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -347,7 +347,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId) byte ps = root[F("psave")]; if (ps > 0) { - savePreset(ps, true, nullptr, root); + savePreset(ps, nullptr, root); } else { ps = root[F("pdel")]; //deletion if (ps > 0) { diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 690a709f7f..859701cdef 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -50,12 +50,13 @@ bool applyPreset(byte index, byte callMode) return false; } -void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj) +void savePreset(byte index, const char* pname, JsonObject saveobj) { - if (index == 0 || (index > 250 && persist) || (index<255 && !persist)) return; + if (index == 0 || (index > 250 && index < 255)) return; char tmp[12]; JsonObject sObj = saveobj; + bool persist = (index == 255); const char *filename = persist ? "/presets.json" : "/tmp.json"; if (!fileDoc) { diff --git a/wled00/wled.h b/wled00/wled.h index 31a484bf2d..364168c72a 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2203140 +#define VERSION 2203141 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG