lib: simplefb: name the text top-padding constant

The value 5 appeared bare in two places: simplefb.c (when text wraps
past the bottom of the screen) and debug.c (initial y position for
the printk overlay). Replace both with FB_TEXT_TOP_PADDING defined
once in simplefb.h.
This commit is contained in:
Ivaylo Ivanov committed 2026-05-28 00:01:44 +03:00
1 parent 4b386dc15c
commit 3c90e2b35f
3 files changed
+4 -2

No files matched your search

+2
View File
@@ -17,6 +17,8 @@ typedef struct _color {
unsigned char a;
} color;
#define FB_TEXT_TOP_PADDING 5
typedef enum {
FB_FORMAT_RGB888,
FB_FORMAT_ARGB8888,
+1 -1
View File
@@ -67,7 +67,7 @@ static inline void uart_output(const char *prefix, const char *message)
static inline void fb_output(const char *prefix, const char *message, color text_color)
{
#ifdef CONFIG_SIMPLE_FB
const int y_pos = 5;
const int y_pos = FB_TEXT_TOP_PADDING;
const int prefix_width = strlen(prefix) * FONTW * get_font_scale_factor();
__simplefb_raw_print(prefix, 0, y_pos, text_color);
+1 -1
View File
@@ -128,7 +128,7 @@ void __simplefb_raw_print(const char *text, int text_x, int text_y,
if (current_y >= fb_info->height - SCALED_FONTH) {
clean_fbmem((char*)fb_info->address, fb_info->width, fb_info->height, fb_info->stride);
current_x = text_x;
current_y = 5;
current_y = FB_TEXT_TOP_PADDING;
}
int ix = font_index(text[i]);