Skip to content

[Chore] Add error name to EEPROMClass commit method's error log #7598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions libraries/EEPROM/src/EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,21 @@ void EEPROMClass::write(int address, uint8_t value) {
bool EEPROMClass::commit() {
bool ret = false;
if (!_size) {
return false;
return false;
}
if (!_data) {
return false;
return false;
}
if (!_dirty) {
return true;
return true;
}

if (ESP_OK != nvs_set_blob(_handle, _name, _data, _size)) {
log_e( "error in write");
esp_err_t err = nvs_set_blob(_handle, _name, _data, _size);
if (err != ESP_OK) {
log_e("error in write: %s", esp_err_to_name(err));
} else {
_dirty = false;
ret = true;
_dirty = false;
ret = true;
}

return ret;
Expand Down