Skip to content

Commit

Permalink
Fix EEPROM was not closed on startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
prampec committed Nov 14, 2021
1 parent 5d8e896 commit b89ac9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/IotWebConf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ bool IotWebConf::loadConfig()
EEPROM.begin(
IOTWEBCONF_CONFIG_START + IOTWEBCONF_CONFIG_VERSION_LENGTH + size);

bool result;
if (this->testConfigVersion())
{
int start = IOTWEBCONF_CONFIG_START + IOTWEBCONF_CONFIG_VERSION_LENGTH;
Expand All @@ -157,7 +158,7 @@ bool IotWebConf::loadConfig()
#ifdef IOTWEBCONF_DEBUG_TO_SERIAL
this->_allParameters.debugTo(&Serial);
#endif
return true;
result = true;
}
else
{
Expand All @@ -167,10 +168,11 @@ bool IotWebConf::loadConfig()
this->_allParameters.debugTo(&Serial);
#endif

return false;
result = false;
}

EEPROM.end();
return result;
}

void IotWebConf::saveConfig()
Expand Down

0 comments on commit b89ac9f

Please sign in to comment.