1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

define GETFLASHP for pointers

This commit is contained in:
Harald Barth 2021-11-24 09:00:23 +01:00
parent c711be7980
commit 6e05de275d
2 changed files with 3 additions and 1 deletions

2
FSH.h
View File

@ -41,6 +41,7 @@
typedef char FSH; typedef char FSH;
#define GETFLASH(addr) (*(const unsigned char *)(addr)) #define GETFLASH(addr) (*(const unsigned char *)(addr))
#define GETFLASHW(addr) (*(const unsigned short *)(addr)) #define GETFLASHW(addr) (*(const unsigned short *)(addr))
#define GETFLASHP(addr) (*(void * const *)(addr))
#define FLASH #define FLASH
#define strlen_P strlen #define strlen_P strlen
#define strcpy_P strcpy #define strcpy_P strcpy
@ -48,6 +49,7 @@ typedef char FSH;
typedef __FlashStringHelper FSH; typedef __FlashStringHelper FSH;
#define GETFLASH(addr) pgm_read_byte_near(addr) #define GETFLASH(addr) pgm_read_byte_near(addr)
#define GETFLASHW(addr) pgm_read_word_near(addr) #define GETFLASHW(addr) pgm_read_word_near(addr)
#define GETFLASHP(addr) pgm_read_ptr_near(addr)
#define FLASH PROGMEM #define FLASH PROGMEM
#endif #endif
#endif #endif

View File

@ -137,7 +137,7 @@ void SSD1306AsciiWire::begin(const DevType* dev, uint8_t i2cAddr) {
m_i2cAddr = i2cAddr; m_i2cAddr = i2cAddr;
m_col = 0; m_col = 0;
m_row = 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); uint8_t size = GETFLASH(&dev->initSize);
m_displayWidth = GETFLASH(&dev->lcdWidth); m_displayWidth = GETFLASH(&dev->lcdWidth);
m_displayHeight = GETFLASH(&dev->lcdHeight); m_displayHeight = GETFLASH(&dev->lcdHeight);