diff --git a/CHANGELOG.md b/CHANGELOG.md index e8adcd89..88ced99c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Builds after release 0.12.0 +#### Build 2106301 + +- Fixed a problem with disabled buttons reverting to pin 0 causing conflict + #### Build 2106300 - Version bump to 0.13.0-b0 "Toki" diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index e594f2b7..ed64b1c3 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -23,7 +23,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { getStringFromJson(serverDescription, id[F("name")], 33); getStringFromJson(alexaInvocationName, id[F("inv")], 33); - JsonObject nw_ins_0 = doc["nw"][F("ins")][0]; + JsonObject nw_ins_0 = doc["nw"]["ins"][0]; getStringFromJson(clientSSID, nw_ins_0[F("ssid")], 33); //int nw_ins_0_pskl = nw_ins_0[F("pskl")]; //The WiFi PSK is normally not contained in the regular file for security reasons. @@ -129,14 +129,12 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { uint8_t s = 0; for (JsonObject btn : hw_btn_ins) { CJSON(buttonType[s], btn["type"]); - int8_t pin = btn[F("pin")][0] | -1; - if (pin > -1) { - if (pinManager.allocatePin(pin,false)) { - btnPin[s] = pin; - pinMode(btnPin[s], INPUT_PULLUP); - } else { - btnPin[s] = -1; - } + int8_t pin = btn["pin"][0] | -1; + if (pin > -1 && pinManager.allocatePin(pin,false)) { + btnPin[s] = pin; + pinMode(btnPin[s], INPUT_PULLUP); + } else { + btnPin[s] = -1; } JsonArray hw_btn_ins_0_macros = btn[F("macros")]; CJSON(macroButton[s], hw_btn_ins_0_macros[0]); @@ -736,7 +734,7 @@ bool deserializeConfigSec() { bool success = readObjectFromFile("/wsec.json", nullptr, &doc); if (!success) return false; - JsonObject nw_ins_0 = doc["nw"][F("ins")][0]; + JsonObject nw_ins_0 = doc["nw"]["ins"][0]; getStringFromJson(clientPass, nw_ins_0["psk"], 65); JsonObject ap = doc["ap"]; diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 2ac5dd00..02eb0ce7 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -390,10 +390,6 @@ void WLED::beginStrip() // init relay pin if (rlyPin>=0) digitalWrite(rlyPin, (rlyMde ? bri : !bri)); - - // disable button if it is "pressed" unintentionally - //if (btnPin>=0 && buttonType == BTN_TYPE_PUSH && isButtonPressed()) - // buttonType = BTN_TYPE_NONE; } void WLED::initAP(bool resetAP) diff --git a/wled00/wled.h b/wled00/wled.h index c04a3b6b..2bcfa6b6 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2106300 +#define VERSION 2106301 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG