You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Board: ESP32 Dev Module
Core Installation version: 1.0.6, 2.0.0
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: No
Upload Speed: 921600
Computer OS: Windows 10
Description:
EEPROM.length() always returns zero if using the default global EEPROM instance. Using my own instance, like the eeprom_class example, I can get the length defined in the constructor (_user_defined_size) not the size defined in begin(size) (_size). Related to #2280.
Summary
Related to the issue #5773 and #2280.
_user_defined_size is removed from EEPROMClass because it is redundant in the current code
EEPROMClass::length() returns _size that is the true available size of EEPROM
Impact
_user_defined_size is removed from EEPROMClass
EEPROMClass::length() returns _size that is the true available size of EEPROM
Hardware:
Board: ESP32 Dev Module
Core Installation version: 1.0.6, 2.0.0
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: No
Upload Speed: 921600
Computer OS: Windows 10
Description:
EEPROM.length()
always returns zero if using the default global EEPROM instance. Using my own instance, like theeeprom_class
example, I can get the length defined in the constructor (_user_defined_size
) not the size defined inbegin(size)
(_size
). Related to #2280.Sketch: (leave the backquotes for code formatting)
Expected behavior
EEPROM.length()
should return the available size of EEPROM even if using the global instance.Possible improvements
I have created two pull requests. If it looks good for you, please consider merging one of them.
#5774 Add
EEPROM::capacity()
method to get_user_defined_data
andEEPROM::length()
returns _sizecapacity()
method returns_user_defined_size
that is set by the constructorlength()
returns_size
that is the true available size of EEPROM#5775 Remove
_user_defined_size
and just use_size
I think this is better because
_user_defined_size
seems to be redundant for me. Just using_size
is much clear._user_defined_size
is removed because it is redundant in the current codelength()
returns_size
that is the true available size of EEPROMThe text was updated successfully, but these errors were encountered: