I know I can use __flash, but everything else int his code uses PROGMEM so I'm trying to do be consistent:
declared:
void (*configurefunctions[9])() = { init, version, version, version, version, version, version, version, version, };
called:
configurefunctions[0]();
DOES not compile:
const void (*configurefunctions[9])() PROGMEM = { init, version, version, version, version, version, version, version, version, };
call:
((void (*)())pgm_read_word(&configurefunctions[0]))();
I get:
</p> <p>Severity Code Description Project File Line<br /> Error variable 'configurefunctions' must be const in order to be put into read-only section by means of '__attribute__((progmem))'</p> <p> </p> <p>Severity Code Description Project File Line<br /> Warning initialization from incompatible pointer type [-Wincompatible-pointer-types] binaryEnigma
How can I specify that the const isn't part of the function, but is part of the function pointer?