1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-04 18:03:20 +03:00

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

This commit is contained in:
Erriez 2020-10-16 00:03:28 +02:00 committed by GitHub
parent 81a10a48af
commit e79eb1174d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -72,17 +72,22 @@ void EEPROMClass::begin(size_t size) {
_dirty = false; //make sure dirty is cleared in case begin() is called 2nd+ time _dirty = false; //make sure dirty is cleared in case begin() is called 2nd+ time
} }
void EEPROMClass::end() { bool EEPROMClass::end() {
if (!_size) bool retval;
return;
commit(); if(!_size) {
return false;
}
retval = commit();
if(_data) { if(_data) {
delete[] _data; delete[] _data;
} }
_data = 0; _data = 0;
_size = 0; _size = 0;
_dirty = false; _dirty = false;
return retval;
} }

View File

@ -35,7 +35,7 @@ public:
uint8_t read(int const address); uint8_t read(int const address);
void write(int const address, uint8_t const val); void write(int const address, uint8_t const val);
bool commit(); bool commit();
void end(); bool end();
uint8_t * getDataPtr(); uint8_t * getDataPtr();
uint8_t const * getConstDataPtr() const; uint8_t const * getConstDataPtr() const;