diff options
Diffstat (limited to 'halext/include')
-rw-r--r-- | halext/include/gdisp.h | 4 | ||||
-rw-r--r-- | halext/include/gdisp_fonts.h | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/halext/include/gdisp.h b/halext/include/gdisp.h index a5703d8b..258cc8b5 100644 --- a/halext/include/gdisp.h +++ b/halext/include/gdisp.h @@ -22,6 +22,10 @@ #if HAL_USE_GDISP || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Driver constants. */
+/*===========================================================================*/
+
/**
* @brief Some basic colors
*/
diff --git a/halext/include/gdisp_fonts.h b/halext/include/gdisp_fonts.h index f22e75df..2f573344 100644 --- a/halext/include/gdisp_fonts.h +++ b/halext/include/gdisp_fonts.h @@ -54,8 +54,6 @@ #error "GDISP: GDISP_MAX_FONT_HEIGHT must be either 16 or 32"
#endif
-typedef const fontcolumn_t * const pfontcolumn_t;
-
/**
* @brief Internal font structure.
* @note This structure is followed by:
@@ -74,15 +72,17 @@ struct font { uint8_t maxWidth;
char minChar;
char maxChar;
- const uint8_t * const widthTable;
- const fontcolumn_t * const (* const offsetTable);
+ const uint8_t *widthTable;
+ const uint16_t *offsetTable;
+ const fontcolumn_t *dataTable;
};
/**
* @brief Macro's to get to the complex parts of the font structure.
*/
-#define _getCharWidth(f,c) (((c) < (f)->minChar || (c) > (f)->maxChar) ? 0 : (f)->widthTable[c - (f)->minChar])
-#define _getCharData(f,c) (f)->offsetTable[c - (f)->minChar]
+#define _getCharWidth(f,c) (((c) < (f)->minChar || (c) > (f)->maxChar) ? 0 : (f)->widthTable[(c) - (f)->minChar])
+#define _getCharOffset(f,c) ((f)->offsetTable[(c) - (f)->minChar])
+#define _getCharData(f,c) (&(f)->dataTable[_getCharOffset(f, c)])
#endif /* _GDISP_FONTS_H */
/** @} */
|