Hi again. I've just tried your advises and, of course, I've solve my compilation errors. Thanks for your help !!
But I can't write and rewrite the EEPROM correctly yet. It seems like I'm writing on a new address an y time, so in 2 or 3 times of savind data, arduino freezes.
Now I've defined
#define EEPROM_LOCAL_ADDRESS 2
and after just 2 or 3 times of using
saveState(EEPROM_LOCAL_ADDRESS, (uint8_t)newPosition);
arduino freezes.
I've a test code, very similar, but without saving or reading from the EEPROM and works fine, so I suppose it's my fault using correctly those functions.
Thanks again