diff --git a/FSH.h b/FSH.h index 7961b7c..30f3d79 100644 --- a/FSH.h +++ b/FSH.h @@ -41,6 +41,7 @@ typedef char FSH; #define GETFLASH(addr) (*(const unsigned char *)(addr)) #define GETFLASHW(addr) (*(const unsigned short *)(addr)) +#define GETFLASHP(addr) (*(void * const *)(addr)) #define FLASH #define strlen_P strlen #define strcpy_P strcpy @@ -48,6 +49,7 @@ typedef char FSH; typedef __FlashStringHelper FSH; #define GETFLASH(addr) pgm_read_byte_near(addr) #define GETFLASHW(addr) pgm_read_word_near(addr) +#define GETFLASHP(addr) pgm_read_ptr_near(addr) #define FLASH PROGMEM #endif #endif diff --git a/SSD1306Ascii.cpp b/SSD1306Ascii.cpp index 17fd5a2..348d64f 100644 --- a/SSD1306Ascii.cpp +++ b/SSD1306Ascii.cpp @@ -137,7 +137,7 @@ void SSD1306AsciiWire::begin(const DevType* dev, uint8_t i2cAddr) { m_i2cAddr = i2cAddr; m_col = 0; m_row = 0; - const uint8_t* table = (const uint8_t*)GETFLASHW(&dev->initcmds); + const uint8_t* table = (const uint8_t*)GETFLASHP(&dev->initcmds); uint8_t size = GETFLASH(&dev->initSize); m_displayWidth = GETFLASH(&dev->lcdWidth); m_displayHeight = GETFLASH(&dev->lcdHeight);