Public Access
- Clock firmware: 'Connecting to WiFi...' and 'Getting the time...' at boot, 'Crashed!' in the OTA-only modes, and 'No WiFi' with the time when WiFi is down for over a minute (new DisplayController screen) - Recovery app: shows its reason, the setup WiFi name, or its IP address, then powers the display off (flipdots keep the image) - StatusScreen and drawTextLines shared by both apps - Driver: ESP begin() no longer draws 'ESP Connected' - Tests: No WiFi screen, short reason texts (70 total) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
782 B
C++
34 lines
782 B
C++
#include "display/text.h"
|
|
|
|
#include <string.h>
|
|
|
|
static const int CHAR_WIDTH = 6;
|
|
|
|
static void drawCentered(BROSE9323 &display, const char *text, int y)
|
|
{
|
|
int len = strlen(text);
|
|
if (len > TEXT_LINE_CHARS)
|
|
len = TEXT_LINE_CHARS;
|
|
char line[TEXT_LINE_CHARS + 1];
|
|
memcpy(line, text, len);
|
|
line[len] = '\0';
|
|
|
|
display.setCursor((display.width() - len * CHAR_WIDTH) / 2, y);
|
|
display.print(line);
|
|
}
|
|
|
|
void drawTextLines(BROSE9323 &display, const char *line1, const char *line2)
|
|
{
|
|
display.fillScreen(0);
|
|
display.setTextSize(1);
|
|
display.setTextWrap(false);
|
|
display.setTextColor(1);
|
|
if (line2 == nullptr || line2[0] == '\0')
|
|
{
|
|
drawCentered(display, line1, 6); // one line: vertically centered
|
|
return;
|
|
}
|
|
drawCentered(display, line1, 1);
|
|
drawCentered(display, line2, 10);
|
|
}
|