the pointer is as easy as copying the data...
instead of doing
if(brand==1){
memcpy_P(actualLogo, logoA, aFlashBitmapSize);
memcpy_P(actualLogo2, logoB, aFlashBitmapSize);
}
you just do
if(brand==1){
actualLogo1 = logoA;
actualLogo2 = logoB;
}
with actualLogo1
and actualLogo2
defined as pointers
const uint8_t * actualLogo1;
const uint8_t * actualLogo2;
instead of being arrays
regarding the 2D array, assume you have 10 bitmaps in EEPROM
const uint8_t aFlashBitmap01[] PROGMEM = {151, 146, 242, 146, 151, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap02[] PROGMEM = {174, 170, 74, 74, 78, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap03[] PROGMEM = {151, 146, 242, 146, 151, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap04[] PROGMEM = {174, 170, 74, 74, 78, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap05[] PROGMEM = {151, 146, 242, 146, 151, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap06[] PROGMEM = {174, 170, 74, 74, 78, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap07[] PROGMEM = {151, 146, 242, 146, 151, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap08[] PROGMEM = {174, 170, 74, 74, 78, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap09[] PROGMEM = {151, 146, 242, 146, 151, 0, 170, 85}; // 8x8 bitmap
const uint8_t aFlashBitmap10[] PROGMEM = {174, 170, 74, 74, 78, 0, 170, 85}; // 8x8 bitmap
and you have 5 pages, page 1 using bitmap 1 and 2, page 2 using bitmap 3 and 4 etc
you would define a 2D array of pointers like this
const uint8_t * pageLogos[][2] = {
{aFlashBitmap01, aFlashBitmap02}, // page 1 (is at index 0)
{aFlashBitmap03, aFlashBitmap04}, // page 2 (is at index 1
{aFlashBitmap05, aFlashBitmap06}, // page 3 (is at index 2)
{aFlashBitmap07, aFlashBitmap08}, // page 4 (is at index 3)
{aFlashBitmap09, aFlashBitmap10}, // page 5 (is at index 4)
};
and if you have a pageIndex
variable that can vary between 0 and 4, you would do
byte pageIndex = 3; // for example, so this is page #4
...
tft.drawBitmap(30, 30, pageLogos[pageIndex][0], 64, 64, BLACK, WHITE);
tft.drawBitmap(30, 150, pageLogos[pageIndex][1], 64, 64, BLACK, WHITE);