achimdoebler / UGUI

µGUI - Open Source GUI module for embedded systems
Other
1.2k stars 415 forks source link

Wrap UG_FONT struct byte array access with macro in case an accessor function is needed #11

Open mattdf opened 8 years ago

mattdf commented 8 years ago

Just a simple macro to allow for an alternative font data storage location that doesn't kill SRAM/RAM space. In AVR if you don't use the PROGMEM attribute in __UG_FONT_DATA, the font data takes up more than the available SRAM on the chip, but using the PROGMEM attribute requires accessing the font bytes with pgm_read_byte(&(font->p[index++])). The macro allows configuring this accessor from ugui_config.h

stevenjeffries commented 5 years ago

Thank you!