Skip to content

Commit 717808d

Browse files
committed
feat(display): Quicker splashscreen, show 'Waiting for POST codes' initially
1 parent bafe7e4 commit 717808d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

firmware/userapp/Core/Src/display.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ static u8g2_t myDisplay;
1212

1313
static char lcd_buf[20] = {0};
1414

15+
static void drawCenteredStr(int16_t y, const char *str);
16+
1517
uint8_t u8x8_gpio_and_delay(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
1618
{
1719
switch(msg)
@@ -62,8 +64,7 @@ void Display_ScrollText(const char *text) {
6264
int text_w = u8g2_GetStrWidth(&myDisplay, text);
6365
int y = lower_y + lower_h - 2; /* baseline near bottom */
6466

65-
/* Start just off the right edge and scroll left until just off the left edge */
66-
for (int x = screen_w; x > -text_w; x--) {
67+
for (int x = 0; x > screen_w - text_w; x--) {
6768
/* Clear only the lower third by drawing a background box (draw color 0) */
6869
u8g2_SetDrawColor(&myDisplay, 0);
6970
u8g2_DrawBox(&myDisplay, 0, lower_y, screen_w, lower_h);
@@ -130,8 +131,12 @@ void Display_Init(void)
130131
u8g2_SendBuffer(&myDisplay);
131132
Display_ScrollText("xboxresearch.com");
132133

133-
// Cleanup
134134
u8g2_ClearDisplay(&myDisplay);
135+
u8g2_SetFont(&myDisplay, u8g2_font_5x7_mr);
136+
drawCenteredStr(9, "Waiting");
137+
drawCenteredStr(19, "for");
138+
drawCenteredStr(29, "POST codes");
139+
u8g2_SendBuffer(&myDisplay);
135140
}
136141

137142
static void drawCenteredStr(int16_t y, const char *str) {

0 commit comments

Comments
 (0)