Skip to content

Commit 664ae3b

Browse files
committed
Issue esp8266#7423: Change return EEPROM.end() to bool
1 parent 85ba53a commit 664ae3b

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
@@ -78,17 +78,22 @@ void EEPROMClass::begin(size_t size) {
7878
_dirty = false; //make sure dirty is cleared in case begin() is called 2nd+ time
7979
}
8080

81-
void EEPROMClass::end() {
82-
if (!_size)
83-
return;
81+
bool EEPROMClass::end() {
82+
bool retval;
83+
84+
if(!_size) {
85+
return false;
86+
}
8487

85-
commit();
88+
retval = commit();
8689
if(_data) {
8790
delete[] _data;
8891
}
8992
_data = 0;
9093
_size = 0;
9194
_dirty = false;
95+
96+
return retval;
9297
}
9398

9499

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)