[fix] feature: font_gfx

small fixes for include files
This commit is contained in:
2023-03-26 09:46:44 +02:00
parent aed378588d
commit 408d99783a
2 changed files with 7 additions and 10 deletions

View File

@@ -79,6 +79,7 @@ C_SOURCES += ../shared_libs/drivers/st7565/st7565.c
C_SOURCES += ../shared_libs/drivers/hw_button/hw_button.c
# display
C_SOURCES += ../shared_libs/display/display_gfx.c
C_SOURCES += ../shared_libs/display/font_gfx.c
# ASM sources
ASM_SOURCES = \

View File

@@ -6,9 +6,9 @@
*/
// #include "main.h"
#include "fonts.h"
#include "font_gfx.h"
static uint8_t font_string_lenght_px(const FONT_INFO *font, uint8_t *text);
static uint8_t font_string_lenght_px(const GFX_font_t *font, uint8_t *text);
/**
* @brief Write string at at the specified (x,y) position.
@@ -20,11 +20,11 @@ static uint8_t font_string_lenght_px(const FONT_INFO *font, uint8_t *text);
* @param color Color of pixel BM_NORMAL or BM_INVERSE for bitmap.
* @return uint8_t
*/
uint8_t DISP_writeString(GFX_display_t *disp, const FONT_INFO *font, uint8_t *text, uint8_t pos_x, uint8_t pos_y, GFX_BitmapColor_t color)
uint8_t DISP_writeString(GFX_display_t *disp, const GFX_font_t *font, uint8_t *text, uint8_t pos_x, uint8_t pos_y, GFX_BitmapColor_t color)
{
uint8_t actual_char, char_nr;
GFX_bitmap_t char_bitmap;
const FONT_CHAR_INFO *charinfo;
const GFX_fontChar_t *charinfo;
uint8_t height = font->heightPixels;
uint8_t x = pos_x;
@@ -32,14 +32,10 @@ uint8_t DISP_writeString(GFX_display_t *disp, const FONT_INFO *font, uint8_t *te
switch (color)
{
case BM_INVERSE:
// SSD1306_clear_buffer(width + 2, height + 2, pos_x - 1, pos_y - 1, WHITE);
// ST7565_writeBitmap(st7565_buffor, NULL, width + 2, height + 2, pos_x - 1, pos_y - 1, WHITE);
case BM_INVERSE:;
DISP_drawFillRect(disp, pos_x - 1, pos_y - 1, width + 2, height + 2);
break;
default:
// SSD1306_clear_buffer(width + 2, height + 2, pos_x - 1, pos_y - 1, BLACK);
// ST7565_writeBitmap(st7565_buffor, NULL, width + 2, height + 2, pos_x - 1, pos_y - 1, BLACK);
DISP_clearRegion(disp, pos_x - 1, pos_y - 1, width + 2, height + 2);
break;
}
@@ -71,7 +67,7 @@ uint8_t DISP_writeString(GFX_display_t *disp, const FONT_INFO *font, uint8_t *te
return x;
}
static uint8_t font_string_lenght_px(const FONT_INFO *font, uint8_t *text)
static uint8_t font_string_lenght_px(const GFX_font_t *font, uint8_t *text)
{
uint8_t width = 0;
while (*text)