Invert pull up config value, fixes #2996

Cronixie usermod format change fix
This commit is contained in:
cschwinne 2023-01-03 17:15:55 +01:00
parent e961691645
commit d039a40d7c
2 changed files with 3 additions and 3 deletions

View File

@ -271,6 +271,7 @@ class UsermodCronixie : public Usermod {
{
if (root["nx"].is<const char*>()) {
strncpy(cronixieDisplay, root["nx"], 6);
setCronixie();
}
}

View File

@ -198,9 +198,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
// read multiple button configuration
JsonObject btn_obj = hw["btn"];
int pull = -1; // trick for inverted setting
CJSON(pull, btn_obj[F("pull")]);
if (pull>=0) disablePullUp = pull;
bool pull = btn_obj[F("pull")] | true; // if true, pullup is enabled
disablePullUp = !pull;
JsonArray hw_btn_ins = btn_obj[F("ins")];
if (!hw_btn_ins.isNull()) {
uint8_t s = 0;