Skip to content

Commit

Permalink
Merge branch 'master' into master-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed Mar 15, 2022
1 parent ac20d7f commit 0234017
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ body:
attributes:
label: What version of WLED?
description: You can find this in by going to Config -> Security & Updates -> Scroll to Bottom. Copy and paste the entire line after "Server message"
placeholder: "e.g. WLED 0.13.0-b7 (build 2202222)"
placeholder: "e.g. WLED 0.13.1 (build 2203150)"
validations:
required: true
- type: dropdown
Expand Down
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
## WLED changelog

### Builds after release 0.12.0
### WLED release 0.13.1

#### Build 2203150

- Version bump to v0.13.1 "Toki"
- Fix persistent preset bug, preventing save of new presets

### WLED release 0.13.0

#### Build 2203142

- Release of WLED v0.13.0 "Toki"
- Reduce APA102 hardware SPI frequency to 5Mhz
- Remove `persistent` parameter in `savePreset()`

### Builds between releases 0.12.0 and 0.13.0

#### Build 2203140

- Added factory reset by pressing button 0 for >10 seconds
- Added ability to set presets from DMX Effect mode
- Simplified label hiding JS in user interface
- Fixed JSON `{"live":true}` indefinite realtime mode

#### Build 2203080

Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=ESP32_Ethernet -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_BLYNK
lib_deps = ${esp32.lib_deps}
board_build.partitions = ${esp32.default_partitions}

Expand Down
17 changes: 17 additions & 0 deletions platformio_override.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ build_flags = ${common.build_flags_esp8266}
; *** Use custom settings from file my_config.h
-DWLED_USE_MY_CONFIG
; *********************************************************************
;
;
; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above.
;
; disable specific features
; -D WLED_DISABLE_OTA
; -D WLED_DISABLE_ALEXA
; -D WLED_DISABLE_BLYNK
Expand All @@ -44,3 +49,15 @@ build_flags = ${common.build_flags_esp8266}
; for the Magic Home LED Controller use PWM pins 5,12,13,15
; for the H801 controller use PINs 15,13,12,14 (W2 = 04)
; for the BW-LT11 controller use PINs 12,4,14,5
;
; set the name of the module - make sure there is a quote-backslash-quote before the name and a backslash-quote-quote after the name
; -D SERVERNAME="\"WLED\""
;
; set the number of LEDs
; -D DEFAULT_LED_COUNT=30
;
; set milliampere limit when using ESP pin to power leds
; -D ABL_MILLIAMPS_DEFAULT =850
;
; enable IR by setting remote type
; -D IRTYPE=0 //0 Remote disabled | 1 24-key RGB | 2 24-key with CT | 3 40-key blue | 4 40-key RGB | 5 21-key RGB | 6 6-key black | 7 9-key red | 8 JSON remote
2 changes: 1 addition & 1 deletion usermods/usermod_v2_auto_save/usermod_v2_auto_save.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class AutoSaveUsermod : public Usermod {
PSTR("~ %02d-%02d %02d:%02d:%02d ~"),
month(localTime), day(localTime),
hour(localTime), minute(localTime), second(localTime));
savePreset(autoSavePreset, true, presetNameBuffer);
cacheInvalidate++; // force reload of presets
savePreset(autoSavePreset, presetNameBuffer);
}

void inline displayOverlay() {
Expand Down
4 changes: 2 additions & 2 deletions usermods/word-clock-matrix/word-clock-matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -299,7 +299,7 @@ void userLoop()
if (minute(localTime) == 1){
//turn off background segment;
strip.getSegment(0).setOption(2, false);
//applyPreset(13);
//applyPreset(255);
}
}
}
2 changes: 1 addition & 1 deletion wled00/bus_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
#endif

//APA102
#define B_HS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarSpiMethod> //hardware SPI
#define B_HS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarSpi5MhzMethod> //hardware SPI
#define B_SS_DOT_3 NeoPixelBrightnessBus<DotStarBgrFeature, DotStarMethod> //soft SPI

//LPD8806
Expand Down
25 changes: 14 additions & 11 deletions wled00/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
* Physical IO
*/

#define WLED_DEBOUNCE_THRESHOLD 50 //only consider button input of at least 50ms as valid (debouncing)
#define WLED_LONG_PRESS 600 //long press if button is released after held for at least 600ms
#define WLED_DOUBLE_PRESS 350 //double press if another press within 350ms after a short press
#define WLED_LONG_REPEATED_ACTION 333 //how often a repeated action (e.g. dimming) is fired on long press on button IDs >0
#define WLED_LONG_AP 6000 //how long the button needs to be held to activate WLED-AP
#define WLED_DEBOUNCE_THRESHOLD 50 // only consider button input of at least 50ms as valid (debouncing)
#define WLED_LONG_PRESS 600 // long press if button is released after held for at least 600ms
#define WLED_DOUBLE_PRESS 350 // double press if another press within 350ms after a short press
#define WLED_LONG_REPEATED_ACTION 300 // how often a repeated action (e.g. dimming) is fired on long press on button IDs >0
#define WLED_LONG_AP 5000 // how long button 0 needs to be held to activate WLED-AP
#define WLED_LONG_FACTORY_RESET 10000 // how long button 0 needs to be held to trigger a factory reset

static const char _mqtt_topic_button[] PROGMEM = "%s/button/%d"; // optimize flash usage

Expand Down Expand Up @@ -237,12 +238,14 @@ void handleButton()
bool doublePress = buttonWaitTime[b]; //did we have a short press before?
buttonWaitTime[b] = 0;

if (b == 0 && dur > 2*WLED_LONG_AP) { //very long press on button 0 (when released)
WLED_FS.format();
clearEEPROM();
doReboot = true;
} else if (b == 0 && dur > WLED_LONG_AP) { //long press on button 0 (when released)
WLED::instance().initAP(true);
if (b == 0 && dur > WLED_LONG_AP) { // long press on button 0 (when released)
if (dur > WLED_LONG_FACTORY_RESET) { // factory reset if pressed > 10 seconds
WLED_FS.format();
clearEEPROM();
doReboot = true;
} else {
WLED::instance().initAP(true);
}
} else if (!buttonLongPressed[b]) { //short press
//NOTE: this interferes with double click handling in usermods so usermod needs to implement full button handling
if (b != 1 && !macroDoublePress[b]) { //don't wait for double press on buttons without a default action if no double press macro set
Expand Down
4 changes: 2 additions & 2 deletions wled00/fcn_declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ void handlePlaylist();
void handlePresets();
bool applyPreset(byte index, byte callMode = CALL_MODE_DIRECT_CHANGE, bool fromJson = false);
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
Expand Down
2 changes: 1 addition & 1 deletion wled00/ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,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();
Expand Down
2 changes: 1 addition & 1 deletion wled00/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
byte ps = root[F("psave")];
if (ps > 0) {
DEBUG_PRINTLN(F("Saving preset"));
savePreset(ps, true, nullptr, root);
savePreset(ps, nullptr, root);
} else {
ps = root[F("pdel")]; //deletion
if (ps > 0) {
Expand Down
6 changes: 3 additions & 3 deletions wled00/presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ void handlePresets()
}

//called from handleSet(PS=) [network callback (fileDoc==nullptr), IR (irrational), deserializeState, UDP] and deserializeState() [network callback (filedoc!=nullptr)]
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 bufferAllocated = false;

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

if (!fileDoc) {
Expand Down
8 changes: 6 additions & 2 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// version code in format yymmddb (b = daily build)
#define VERSION 2203141
#define VERSION 2203151

//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG
Expand Down Expand Up @@ -296,7 +296,11 @@ WLED_GLOBAL uint16_t transitionDelay _INIT(750); // default crossfade duratio
WLED_GLOBAL byte briMultiplier _INIT(100); // % of brightness to set (to limit power, if you set it to 50 and set bri to 255, actual brightness will be 127)

// User Interface CONFIG
WLED_GLOBAL char serverDescription[33] _INIT("WLED"); // Name of module
#ifndef SERVERNAME
WLED_GLOBAL char serverDescription[33] _INIT("WLED"); // Name of module - use default
#else
WLED_GLOBAL char serverDescription[33] _INIT(SERVERNAME); // use predefined name
#endif
WLED_GLOBAL bool syncToggleReceive _INIT(false); // UIs which only have a single button for sync should toggle send+receive if this is true, only send otherwise
WLED_GLOBAL bool simplifiedUI _INIT(false); // enable simplified UI
WLED_GLOBAL byte cacheInvalidate _INIT(0); // used to invalidate browser cache when switching from regular to simplified UI
Expand Down

0 comments on commit 0234017

Please sign in to comment.