Skip to content

Commit e79eb11

Browse files
authored
BREAKING: Change return EEPROM.end() to bool (esp8266#7630)
1 parent 81a10a4 commit e79eb11

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

libraries/EEPROM/EEPROM.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,22 @@ void EEPROMClass::begin(size_t size) {
7272
_dirty = false; //make sure dirty is cleared in case begin() is called 2nd+ time
7373
}
7474

75-
void EEPROMClass::end() {
76-
if (!_size)
77-
return;
75+
bool EEPROMClass::end() {
76+
bool retval;
77+
78+
if(!_size) {
79+
return false;
80+
}
7881

79-
commit();
82+
retval = commit();
8083
if(_data) {
8184
delete[] _data;
8285
}
8386
_data = 0;
8487
_size = 0;
8588
_dirty = false;
89+
90+
return retval;
8691
}
8792

8893

libraries/EEPROM/EEPROM.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class EEPROMClass {
3535
uint8_t read(int const address);
3636
void write(int const address, uint8_t const val);
3737
bool commit();
38-
void end();
38+
bool end();
3939

4040
uint8_t * getDataPtr();
4141
uint8_t const * getConstDataPtr() const;

0 commit comments

Comments
 (0)