more & more memory optimizations

This commit is contained in:
sinseman
2015-02-21 14:12:27 +01:00
parent 80f2c0936a
commit 65ae2048c5
4 changed files with 79 additions and 48 deletions

View File

@@ -1,5 +1,11 @@
#include <EEPROM.h>
#include <Arduino.h> // for type definitions
#ifndef __EEPROMAnything__
#define __EEPROMAnything__
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
template <class T> int EEPROM_writeAnything(int ee, const T& value)
{
@@ -17,4 +23,6 @@ template <class T> int EEPROM_readAnything(int ee, T& value)
for (i = 0; i < sizeof(value); i++)
*p++ = EEPROM.read(ee++);
return i;
}
}
#endif