Skip to content

Commit 88e98f1

Browse files
authored
EEPROM: Add an update function (#780)
According to the Arduino docs, update works just like put, but it first checks if the value is different from the current one. This is how our put already works, so we just alias update to put and we're done. Function added to be more compatible with the Arduino API. Also see #778
1 parent b4db1ad commit 88e98f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/EEPROM/EEPROM.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class EEPROMClass {
6262
return t;
6363
}
6464

65+
template<typename T>
66+
const T &update(int const address, const T &t) {
67+
return put(address, t);
68+
}
6569
size_t length() {
6670
return _size;
6771
}

0 commit comments

Comments
 (0)