Skip to content
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

BREAKING: Change return EEPROM.end() to bool #7630

Merged
Merged
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions libraries/EEPROM/EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,22 @@ void EEPROMClass::begin(size_t size) {
_dirty = false; //make sure dirty is cleared in case begin() is called 2nd+ time
}

void EEPROMClass::end() {
if (!_size)
return;
bool EEPROMClass::end() {
bool retval;

if(!_size) {
return false;
}

commit();
retval = commit();
if(_data) {
delete[] _data;
}
_data = 0;
_size = 0;
_dirty = false;

return retval;
}


Expand Down
2 changes: 1 addition & 1 deletion libraries/EEPROM/EEPROM.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class EEPROMClass {
uint8_t read(int const address);
void write(int const address, uint8_t const val);
bool commit();
void end();
bool end();

uint8_t * getDataPtr();
uint8_t const * getConstDataPtr() const;
Expand Down