Fixed a problem with disabled buttons reverting to pin 0 causing conflict

This commit is contained in:
cschwinne 2021-06-30 12:33:51 +02:00
parent 200960899e
commit 8b6cc708e7
4 changed files with 13 additions and 15 deletions

View File

@ -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"

View File

@ -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"];

View File

@ -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)

View File

@ -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