diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86b18f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.cproject +.project diff --git a/EEPROMex.cpp b/EEPROMex.cpp index ab97c0c..240669b 100644 --- a/EEPROMex.cpp +++ b/EEPROMex.cpp @@ -27,7 +27,7 @@ ******************************************************************************/ #define _EEPROMEX_VERSION 1_0_0 // software version of this library - //#define _EEPROMEX_DEBUG // Enables logging of maximum of writes and out-of-memory + #define _EEPROMEX_DEBUG // Enables logging of maximum of writes and out-of-memory /****************************************************************************** * Constructors ******************************************************************************/ @@ -99,7 +99,14 @@ int EEPROMClassEx::getAddress(int noOfBytes){ * Check if EEPROM memory is ready to be accessed */ bool EEPROMClassEx::isReady() { - return eeprom_is_ready(); + bool isReady = eeprom_is_ready(); +#ifdef _EEPROMEX_DEBUG + Serial.print("isReady() returns: "); Serial.println(isReady); + Serial.print("allowedWrites: "); Serial.println(_allowedWrites); +#else + Serial.print("isReady() returns: "); Serial.println(isReady); +#endif + return isReady; } /** diff --git a/EEPROMex.h b/EEPROMex.h index 1cfd371..6c4c69e 100644 --- a/EEPROMex.h +++ b/EEPROMex.h @@ -144,7 +144,6 @@ class EEPROMClassEx template int updateBlock(int address, const T value[], int items) { int writeCount=0; - if (!isWriteOk(address+items*sizeof(T))) return 0; unsigned int i; for (i = 0; i < (unsigned int)items; i++) writeCount+= updateBlock(address+(i*sizeof(T)),value[i]); @@ -158,7 +157,6 @@ class EEPROMClassEx template int updateBlock(int address, const T& value) { int writeCount=0; - if (!isWriteOk(address+sizeof(value))) return 0; const byte* bytePointer = (const byte*)(const void*)&value; for (unsigned int i = 0; i < (unsigned int)sizeof(value); i++) { if (read(address)!=*bytePointer) {