Trouble is, it will compile just fine on an AVR but fails on the Teensy 3… error code follows:
Code:
In file included from EEPROMEx.ino:9:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:23:20: fatal error: EEPROM.h: No such file or directory
compilation terminated.
The weird thing is that EEPROM.h is present in my list of libraries (Teensy 1.17 + Arduino 1.05). Any idea what might be going on?
So, now the Example file included with the library no longer complains about the lack of EEPROM.h. However, it still fails to compile and unfortunately, this is way over my head. The most I got into CS was intro to program and data types was the next class. I presume the below makes a lot more sense to the likes of you, who will forget more about C in a given day than I'll ever know.
Code:
In file included from EEPROMEx.ino:9:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:51:26: warning: ISO C99 requires whitespace after the macro name [enabled by default]
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:51:0: warning: "EEPROMSizeTeensy1" redefined [enabled by default]
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:50:0: note: this is the location of the previous definition
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:53:26: warning: ISO C99 requires whitespace after the macro name [enabled by default]
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:53:0: warning: "EEPROMSizeTeensy2" redefined [enabled by default]
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:52:0: note: this is the location of the previous definition
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:54:0: warning: "EEPROMSizeTeensy3" redefined [enabled by default]
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:39:0: note: this is the location of the previous definition
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:166:22: error: conflicting declaration 'EEPROMClassEx EEPROM'
In file included from EEPROMEx.ino:8:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROM/EEPROM.h:39:20: error: 'EEPROM' has a previous declaration as 'EEPROMClass EEPROM'
EEPROMEx.ino: In function 'void readAndWriteInt()':
EEPROMEx:80: error: 'class EEPROMClass' has no member named 'writeInt'
EEPROMEx:81: error: 'class EEPROMClass' has no member named 'readInt'
EEPROMEx.ino: In function 'void readAndWriteLong()':
EEPROMEx:100: error: 'class EEPROMClass' has no member named 'writeLong'
EEPROMEx:101: error: 'class EEPROMClass' has no member named 'readLong'
EEPROMEx.ino: In function 'void readAndWriteFloat()':
EEPROMEx:120: error: 'class EEPROMClass' has no member named 'writeFloat'
EEPROMEx:121: error: 'class EEPROMClass' has no member named 'readFloat'
EEPROMEx.ino: In function 'void updateAndReadDouble()':
EEPROMEx:140: error: 'class EEPROMClass' has no member named 'updateDouble'
EEPROMEx:141: error: 'class EEPROMClass' has no member named 'readDouble'
EEPROMEx.ino: In function 'void writeAndReadCharArray()':
EEPROMEx:161: error: 'class EEPROMClass' has no member named 'writeBlock'
EEPROMEx:161: error: expected primary-expression before 'char'
EEPROMEx:161: error: expected ';' before 'char'
EEPROMEx:162: error: 'class EEPROMClass' has no member named 'readBlock'
EEPROMEx:162: error: expected primary-expression before 'char'
EEPROMEx:162: error: expected ';' before 'char'
EEPROMEx.ino: In function 'void writeAndReadByteArray()':
EEPROMEx:184: error: 'class EEPROMClass' has no member named 'writeBlock'
EEPROMEx:184: error: expected primary-expression before '>' token
EEPROMEx.ino:184:47: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:184:56: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx:185: error: 'class EEPROMClass' has no member named 'updateBlock'
EEPROMEx:185: error: expected primary-expression before '>' token
EEPROMEx.ino:185:67: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:185:74: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx:186: error: 'class EEPROMClass' has no member named 'readBlock'
EEPROMEx:186: error: expected primary-expression before '>' token
EEPROMEx.ino:186:46: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:186:54: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino: In function 'void waitUntilReady()':
EEPROMEx:212: error: 'class EEPROMClass' has no member named 'writeByte'
EEPROMEx:216: error: 'class EEPROMClass' has no member named 'isReady'
EEPROMEx:225: error: 'class EEPROMClass' has no member named 'writeLong'
EEPROMEx:229: error: 'class EEPROMClass' has no member named 'isReady'
EEPROMEx:237: error: 'class EEPROMClass' has no member named 'readLong'
EEPROMEx:241: error: 'class EEPROMClass' has no member named 'isReady'
EEPROMEx:256: error: 'class EEPROMClass' has no member named 'writeBlock'
EEPROMEx:256: error: expected primary-expression before '>' token
EEPROMEx.ino:256:47: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:256:55: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx:263: error: 'class EEPROMClass' has no member named 'updateBlock'
EEPROMEx:263: error: expected primary-expression before '>' token
EEPROMEx.ino:263:48: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:263:59: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx:270: error: 'class EEPROMClass' has no member named 'updateBlock'
EEPROMEx:270: error: expected primary-expression before '>' token
EEPROMEx.ino:270:48: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:270:59: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx:277: error: 'class EEPROMClass' has no member named 'readBlock'
EEPROMEx:277: error: expected primary-expression before '>' token
EEPROMEx.ino:277:46: warning: left operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino:277:54: warning: right operand of comma operator has no effect [-Wunused-value]
EEPROMEx.ino: In function 'void errorChecking(int)':
EEPROMEx:291: error: 'class EEPROMClass' has no member named 'writeLong'
EEPROMEx:297: error: 'class EEPROMClass' has no member named 'writeLong'
EEPROMEx.ino: In function 'void setup()':
EEPROMEx:309: error: 'class EEPROMClass' has no member named 'setMemPool'
EEPROMEx:313: error: 'class EEPROMClass' has no member named 'setMaxAllowedWrites'
EEPROMEx:318: error: 'class EEPROMClass' has no member named 'getAddress'
EEPROMEx:319: error: 'class EEPROMClass' has no member named 'getAddress'
EEPROMEx:320: error: 'class EEPROMClass' has no member named 'getAddress'
EEPROMEx:321: error: 'class EEPROMClass' has no member named 'getAddress'
EEPROMEx:322: error: 'class EEPROMClass' has no member named 'getAddress'
EEPROMEx:323: error: 'class EEPROMClass' has no member named 'getAddress'
EEPROMEx:324: error: 'class EEPROMClass' has no member named 'getAddress'
Teensy3 was missing one of the seldom-used AVR libc EEPROM library functions. I've added it. You'll need these 2 files, which go into hardware/teensy/cores/teensy3.
I tried to compile the library you posted and it still gives error with the example programs under teensduino-1.17rc2 and arduino1.0.5. I made no changes to anything, just installed the library.
Here are the error's:
EEPROMEx.pde
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMex.cpp: In member function 'bool EEPROMClassEx::isReady()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMex.cpp:91:25: error: 'eeprom_is_ready' was not declared in this scope
EEPROMBackup.pde
In file included from EEPROMBackup.pde:18:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In constructor 'EEPROMBackupVar<T>::EEPROMBackupVar(T, int, compareFunction, long unsigned int)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:41:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In member function 'void EEPROMBackupVar<T>::initialize(T)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:48:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
EEPROMVar.pde
In file included from EEPROMVar.pde:10:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h: In constructor 'EEPROMVar<T>::EEPROMVar(T)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h:29:20: error: 'class EEPROMClassEx' has no member named 'getAdress'
nevermind I didn't install the updated core files that you clearly stated needed to be installed, too much turkey!
ok i spoke too soon, EEPROMEx.pde compiles fine but the other two examples do not. I updated the eeprom.c and avr_functions.h core files.
EEPROMBackup.pde errors
In file included from EEPROMBackup.pde:18:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In constructor 'EEPROMBackupVar<T>::EEPROMBackupVar(T, int, compareFunction, long unsigned int)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:41:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In member function 'void EEPROMBackupVar<T>::initialize(T)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:48:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
EEPROMVar.pde errors
In file included from EEPROMVar.pde:10:0:
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h: In constructor 'EEPROMVar<T>::EEPROMVar(T)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h:29:20: error: 'class EEPROMClassEx' has no member named 'getAdress'
Opps, looks like I only tested 1 of the 3 examples!
The other 2 have another problem, unrelated to Teensy. Looks like "getAdress" was at some point corrected for spelling to "getAddress", but it wasn't fully updated in all locations.
Hi, Great to hear the library is being used! Paul submitted a bunch of fixes, so now the version on Github should not give any issues anymore. I will try to update the zip file later in the day.
I would be very interested to hear what people use the library for. If you want please post a reaction on my blog.
A side-note: I have removed the EEPROMBackupvar class for now. It is meant as a naive wear leveling mechanism, but this version only works in a limited set of cases. I'll change it into a more general version and re-add it when I have some time.