So I have a template Class in my sketch, in this case its to read from EEPROM, and this has been working fine for a long time.
template <class T> int EEPROM_readAnything(int ee, T& value)
{
byte* p = (byte*)(void*)&value;
unsigned int i;
for (i = 0; i < sizeof(value); i++)
*p++ = EEPROM.read(ee++);
return i;
}
I started putting LCD code from a larger program into a library/class:
void SSD1963::font_16(int x, int y, byte fc, uint8_t ascii, byte back, int rota) { // xposition, yposition, font colour , ascii code, background colour
uint16_t a;
int num_char;
ascii -= 32; // removed un-used ascii slots to save memory, this compensates for missing slots that are not used
for (int k = 0; k < 18; k++) // number of bytes (colons) in the letter(max)
{
num_char++;
// uint16_t a = font_16_E[ascii][k]; // read ascii from dynamic memory (only if loaded)
EEPROM_readAnything(ascii * 38 + k * 2, a); // read from ascii table saved to EEPROM
Its give me this error: EEPROM_readAnything was not declared in this scope"
That error implies that it is looking for it in the header/cpp file and can’t find it. I’m assuming that I will have to duplicate the code inside my class and have tried but I don’t know the proper way to do that as it still gives the same error.