I have an old project made using Arduino 1.0.6
inside some .h files I include in the beginning, I have code (not inside a function, only inside .h)
the reason for this code is to store strings in flash (it's a big project)
const char ModeCOP [22][11] PROGMEM = {
//-12345678901234567890
"Stabilize ", //0
" string ", //1
...
" another"}; //21
const char *flight_modeCOP[] = {
ModeCOP[0], ModeCOP[1], ModeCOP[2], ModeCOP[3], ModeCOP[4], ModeCOP[5],
ModeCOP[6], ModeCOP[7], ModeCOP[8], ModeCOP[9], ModeCOP[10], ModeCOP[11],
ModeCOP[12], ModeCOP[13], ModeCOP[14], ModeCOP[15], ModeCOP[16], ModeCOP[17],
ModeCOP[18], ModeCOP[19], ModeCOP[20], ModeCOP[21]
};
I then access then by strcpy_P from ModeCOP[x]
- this works fine on 1.0.6
in 1.6.6 I get errors like
thirdcase.h:86: error: 'ModeCOP' was not declared in this scope
ModeCOP[0], ModeCOP[1], ModeCOP[2], ModeCOP[3], ModeCOP[4], ModeCOP[5],
the part of the code works in a new (clean) project when inserted into setup
So the question is: is it because it's inside included .h ? - or does it need to be inside a function , and if yes, will it still end up in FLASH ? , not flash AND program memory ?