Unverified Commit d08e9005 authored by Jovan Frandika's avatar Jovan Frandika Committed by GitHub

chore: add err name to EEPROMClass commit method's error log (#7598)

parent 1ad54069
...@@ -183,20 +183,21 @@ void EEPROMClass::write(int address, uint8_t value) { ...@@ -183,20 +183,21 @@ void EEPROMClass::write(int address, uint8_t value) {
bool EEPROMClass::commit() { bool EEPROMClass::commit() {
bool ret = false; bool ret = false;
if (!_size) { if (!_size) {
return false; return false;
} }
if (!_data) { if (!_data) {
return false; return false;
} }
if (!_dirty) { if (!_dirty) {
return true; return true;
} }
if (ESP_OK != nvs_set_blob(_handle, _name, _data, _size)) { esp_err_t err = nvs_set_blob(_handle, _name, _data, _size);
log_e( "error in write"); if (err != ESP_OK) {
log_e("error in write: %s", esp_err_to_name(err));
} else { } else {
_dirty = false; _dirty = false;
ret = true; ret = true;
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment