Skip to content

Commit ff78b24

Browse files
committed
Added EEPROM.get() addition for EEMEM variables.
1 parent c6d7839 commit ff78b24

File tree

1 file changed

+6
-0
lines changed
  • hardware/arduino/avr/libraries/EEPROM/src

1 file changed

+6
-0
lines changed

hardware/arduino/avr/libraries/EEPROM/src/EEPROM.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ class EEPROMClass{
256256
return t;
257257
}
258258

259+
//EEMEM helper: This function retrieves an object which uses the same type as the provided pointer.
260+
template< typename T > T get( T *t ){
261+
T result;
262+
return get( t, result );
263+
}
264+
259265
template< typename T > const T &put( EEPtr ptr, const T &t ){
260266
const uint8_t *src = (const uint8_t*) &t;
261267
for( int count = sizeof(T) ; count ; --count, ++ptr ) (*ptr).update( *src++ );

0 commit comments

Comments
 (0)