We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87c59b1 commit b3a503aCopy full SHA for b3a503a
1 file changed
libraries/EEPROM/EEPROM.cpp
@@ -86,8 +86,13 @@ void EEPROMClass::write(int address, uint8_t value) {
86
if(!_data)
87
return;
88
89
- _data[address] = value;
90
- _dirty = true;
+ // Optimise _dirty. Only flagged if data written is different.
+ uint8_t* pData = &_data[address];
91
+ if (*pData != value)
92
+ {
93
+ *pData = value;
94
+ _dirty = true;
95
+ }
96
}
97
98
bool EEPROMClass::commit() {
0 commit comments