Hi all,
I've got a bunch of data in PROGMEM, like this:
static const uint16_t btn_0[] PROGMEM = {
// header
0x8160, 0x00B0,
// 16 bits of data
0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
// repeat code burst
0x8016, 0x069A, 0x8160, 0x00B0,
// end of command
0x8016, 0x0000,
};
static const uint16_t btn_1[] PROGMEM = {
// header
0x8160, 0x00B0,
// 16 bits of data
0x8016, 0x00B0, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058, 0x8016, 0x0058,
0x8016, 0x00B0, 0x8016, 0x00B0, 0x8016, 0x00B0, 0x8016, 0x00B0,
// repeat code burst
0x8016, 0x04E2, 0x8160, 0x00B0,
// end of command
0x8016, 0x0000,
};
///// LOTS MORE
This works fine in that I can do this: [b]sendCmd (btn_0);[/b]
and "sendCmd" reads the data out of PROGMEM and uses it properly.
Now, what I want to do is make an array that points to all of the data I have ... something like this:
const uint16_t arrayPtr[] PROGMEM = {
btn_0,
btn_1,
btn_2,
// etc...
last_entry,
};
and then be able to do this:
uint8_t idx = 0;
sendCmd (arrayPtr[idx]);
The point is that I want this array of pointers to PROGMEM to also be in PROGMEM.
Everything I've tried doesn't work. Any ideas will be appreciated!