sprawdzone na sprzecie. wszystko ok
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "fonts.h"
|
||||
#include "SSD1306_oled.h"
|
||||
|
||||
uint8_t font_print_str(const FONT_INFO * font, uint8_t * text, uint8_t pos_x, uint8_t pos_y)
|
||||
uint8_t font_print_str(const FONT_INFO * font, uint8_t * text, uint8_t pos_x, uint8_t pos_y, uint8_t mode)
|
||||
{
|
||||
uint8_t height = font->heightPixels;
|
||||
|
||||
@@ -17,7 +17,14 @@ uint8_t font_print_str(const FONT_INFO * font, uint8_t * text, uint8_t pos_x, ui
|
||||
|
||||
uint8_t width = font_string_lenght_px(font, text);
|
||||
|
||||
SSD1306_clear_buffer(width+2, height+2, pos_x-1, pos_y-1, BLACK);
|
||||
switch (mode) {
|
||||
case INVERSE:
|
||||
SSD1306_clear_buffer(width+2, height+2, pos_x-1, pos_y-1, WHITE);
|
||||
break;
|
||||
default:
|
||||
SSD1306_clear_buffer(width+2, height+2, pos_x-1, pos_y-1, BLACK);
|
||||
break;
|
||||
}
|
||||
|
||||
while(*text)
|
||||
{
|
||||
@@ -30,7 +37,7 @@ uint8_t font_print_str(const FONT_INFO * font, uint8_t * text, uint8_t pos_x, ui
|
||||
uint8_t char_nr = actual_char - font->startChar;
|
||||
const FONT_CHAR_INFO *charinfo = &font->charInfo[char_nr];
|
||||
|
||||
SSD1306_write_to_buffer(font->data + charinfo->offset, charinfo->widthBits, height, x, pos_y, WHITE);
|
||||
SSD1306_write_to_buffer(font->data + charinfo->offset, charinfo->widthBits, height, x, pos_y, mode);
|
||||
|
||||
x += charinfo->widthBits + font->interspacePixels;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user