Let's assume code like this in global scope is my intention (make sure you scroll the code, seems the forum puts a height on the code box, and it's non-obvious, which is annoying)...
byte MyImagePage000[128] PROGMEM = {
0x0c, 0x94, 0x35, 0x00, 0x0c
};
byte MyImagePage001[128] PROGMEM = {
0x02, 0xc0, 0x05, 0x90, 0x0d
};
#define MyImagePage002 NULL
#define MyImagePage003 NULL
byte *MyImagePages[] PROGMEM = {
MyImagePage000, MyImagePage001, MyImagePage002, MyImagePage003
};
struct PagedBinData
{
char *imagename;
unsigned int base_address;
byte pagesize;
unsigned int pagecount;
byte *data[];
};
PagedBinData MyImage = {
"slave",
0x0000,
5,
4,
MyImagePages
};
This does not compile, "too many initializers for ‘PagedBinData’"
You can see my intention is that
1. there are pages of bytes stored in PROGMEM (MyImagePage000 ...)
2. some of those pages are empty and are just defined to NULL
3. a table of pointers to all the pages (some of which are therefore NULL pointers) is also stored in PROGMEM
4. then I want to get that PROGMEM table of pointers into a standard sram structure MyImage
How do I initialize MyImage to get MyImagePages in there like I want?