Hi all, I'm coding graphic LCD routines and I want to include several text fonts. So, I've defined a structure as :
typedef struct DEF_FONT { U8 u8width; /* Character width*/ U8 u8height; /* Character height*/ U8 *au8fontTable; /* Font table start address in memory */ } DEF_FONT;
struct DEF_FONT code Font_System5x8 = {5, 8, au8font5x8}; struct DEF_FONT code Font_System8x8 = {8, 8, au8font8x8};
void LcdPutchar (U8 u8Char, DEF_FONT stFont)
LcdDataWrite (stFont->au8fontTable[(u8Char - 32) * 5 + u8CharColumn]);
***ÿERROR 199 IN LINE 345 OF C:\TRX8051\GLCD.C: left side of '->' requires struct/union pointer
struct DEF_FONT *ptr
You need to correct the second parameter's type:
void LcdPutchar (U8 u8Char, DEF_FONT *stFont)
LcdPutchar('5', &Font_System5x8); LcdPutchar('8', &Font_System8x8);