Skip to content

Commit 9552784

Browse files
committed
Remove persistent argument from savePreset()
(fixes temp preset not applicable by APIs) Default to 5Mhz hardware SPI driving (wled#2558)
1 parent f068327 commit 9552784

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

usermods/usermod_v2_auto_save/usermod_v2_auto_save.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class AutoSaveUsermod : public Usermod {
6464
PSTR("~ %02d-%02d %02d:%02d:%02d ~"),
6565
month(localTime), day(localTime),
6666
hour(localTime), minute(localTime), second(localTime));
67-
savePreset(autoSavePreset, true, presetNameBuffer);
67+
savePreset(autoSavePreset, presetNameBuffer);
6868
}
6969

7070
void inline displayOverlay() {

usermods/word-clock-matrix/word-clock-matrix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void hourChime()
6565
//strip.resetSegments();
6666
selectWordSegments(true);
6767
colorUpdated(CALL_MODE_FX_CHANGED);
68-
savePreset(13, false);
68+
//savePreset(255);
6969
selectWordSegments(false);
7070
//strip.getSegment(0).setOption(0, true);
7171
strip.getSegment(0).setOption(2, true);
@@ -299,7 +299,7 @@ void userLoop()
299299
if (minute(localTime) == 1){
300300
//turn off background segment;
301301
strip.getSegment(0).setOption(2, false);
302-
//applyPreset(13);
302+
//applyPreset(255);
303303
}
304304
}
305305
}

wled00/bus_wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
#endif
134134

135135
//APA102
136-
#define B_HS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarSpiMethod> //hardware SPI
136+
#define B_HS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarSpi5MhzMethod> //hardware SPI
137137
#define B_SS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarMethod> //soft SPI
138138

139139
//LPD8806

wled00/fcn_declare.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ void handlePlaylist();
190190
//presets.cpp
191191
bool applyPreset(byte index, byte callMode = CALL_MODE_DIRECT_CHANGE);
192192
inline bool applyTemporaryPreset() {return applyPreset(255);};
193-
void savePreset(byte index, bool persist = true, const char* pname = nullptr, JsonObject saveobj = JsonObject());
194-
inline void saveTemporaryPreset() {savePreset(255, false);};
193+
void savePreset(byte index, const char* pname = nullptr, JsonObject saveobj = JsonObject());
194+
inline void saveTemporaryPreset() {savePreset(255);};
195195
void deletePreset(byte index);
196196

197197
//set.cpp

wled00/ir.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ void decodeIRJson(uint32_t code)
699699
char pname[33];
700700
sprintf_P(pname, PSTR("IR Preset %d"), psave);
701701
fdo.clear();
702-
if (psave > 0 && psave < 251) savePreset(psave, true, pname, fdo);
702+
if (psave > 0 && psave < 251) savePreset(psave, pname, fdo);
703703
}
704704
}
705705
releaseJSONBufferLock();

wled00/json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
347347

348348
byte ps = root[F("psave")];
349349
if (ps > 0) {
350-
savePreset(ps, true, nullptr, root);
350+
savePreset(ps, nullptr, root);
351351
} else {
352352
ps = root[F("pdel")]; //deletion
353353
if (ps > 0) {

wled00/presets.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ bool applyPreset(byte index, byte callMode)
5050
return false;
5151
}
5252

53-
void savePreset(byte index, bool persist, const char* pname, JsonObject saveobj)
53+
void savePreset(byte index, const char* pname, JsonObject saveobj)
5454
{
55-
if (index == 0 || (index > 250 && persist) || (index<255 && !persist)) return;
55+
if (index == 0 || (index > 250 && index < 255)) return;
5656
char tmp[12];
5757
JsonObject sObj = saveobj;
5858

59+
bool persist = (index == 255);
5960
const char *filename = persist ? "/presets.json" : "/tmp.json";
6061

6162
if (!fileDoc) {

wled00/wled.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
// version code in format yymmddb (b = daily build)
11-
#define VERSION 2203140
11+
#define VERSION 2203141
1212

1313
//uncomment this if you have a "my_config.h" file you'd like to use
1414
//#define WLED_USE_MY_CONFIG

0 commit comments

Comments
 (0)