1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-05 13:16:13 +03:00

Added length and operator[] methods, added some constness, missed dirty clear (#3855)

* Added length and operator[] methods, added some constness, missed _dirty clear

* Added forgotten const
This commit is contained in:
Develo
2017-11-20 16:25:52 -03:00
committed by GitHub
parent 1b76e9bf72
commit 422f35938a
2 changed files with 16 additions and 10 deletions

View File

@@ -83,10 +83,11 @@ void EEPROMClass::end() {
}
_data = 0;
_size = 0;
_dirty = false;
}
uint8_t EEPROMClass::read(int address) {
uint8_t EEPROMClass::read(int const address) {
if (address < 0 || (size_t)address >= _size)
return 0;
if(!_data)
@@ -95,7 +96,7 @@ uint8_t EEPROMClass::read(int address) {
return _data[address];
}
void EEPROMClass::write(int address, uint8_t value) {
void EEPROMClass::write(int const address, uint8_t const value) {
if (address < 0 || (size_t)address >= _size)
return;
if(!_data)
@@ -136,7 +137,7 @@ uint8_t * EEPROMClass::getDataPtr() {
return &_data[0];
}
uint8_t const * EEPROMClass::getConstDataPtr() {
uint8_t const * EEPROMClass::getConstDataPtr() const {
return &_data[0];
}