[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 C_SOURCES += ../shared_libs/drivers/hw_button/hw_button.c
# display # display
C_SOURCES += ../shared_libs/display/display_gfx.c C_SOURCES += ../shared_libs/display/display_gfx.c
C_SOURCES += ../shared_libs/display/font_gfx.c
# ASM sources # ASM sources
ASM_SOURCES = \ ASM_SOURCES = \

View File

@@ -6,9 +6,9 @@
*/ */
// #include "main.h" // #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. * @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. * @param color Color of pixel BM_NORMAL or BM_INVERSE for bitmap.
* @return uint8_t * @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; uint8_t actual_char, char_nr;
GFX_bitmap_t char_bitmap; GFX_bitmap_t char_bitmap;
const FONT_CHAR_INFO *charinfo; const GFX_fontChar_t *charinfo;
uint8_t height = font->heightPixels; uint8_t height = font->heightPixels;
uint8_t x = pos_x; 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) switch (color)
{ {
case BM_INVERSE: 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);
DISP_drawFillRect(disp, pos_x - 1, pos_y - 1, width + 2, height + 2); DISP_drawFillRect(disp, pos_x - 1, pos_y - 1, width + 2, height + 2);
break; break;
default: 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); DISP_clearRegion(disp, pos_x - 1, pos_y - 1, width + 2, height + 2);
break; break;
} }
@@ -71,7 +67,7 @@ uint8_t DISP_writeString(GFX_display_t *disp, const FONT_INFO *font, uint8_t *te
return x; 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; uint8_t width = 0;
while (*text) while (*text)