From 504fb08fdc70502b2ad0a081f7a485d0aeb8829a Mon Sep 17 00:00:00 2001 From: GlassOnTin Date: Fri, 27 Mar 2026 16:56:30 +0000 Subject: [PATCH] Enable CO5300 AMOLED display with live watch face Display now shows time (00:00 from reset RTC) and status line with radio state, battery percentage, GPS satellites, and uptime counter. Display blanking disabled until button input is implemented. QSPI display driver confirmed working after I2C pin fix. --- Boards.h | 2 +- Display.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Boards.h b/Boards.h index 377ee71..3378517 100644 --- a/Boards.h +++ b/Boards.h @@ -742,7 +742,7 @@ #define HAS_BUSY true #define HAS_TCXO true - #define HAS_DISPLAY false // CO5300 QSPI driver written but not yet functional + #define HAS_DISPLAY true #define HAS_CONSOLE true #define HAS_WIFI true #define HAS_BLUETOOTH false diff --git a/Display.h b/Display.h index e5e510b..7caee7b 100644 --- a/Display.h +++ b/Display.h @@ -31,7 +31,7 @@ bool display_blanked = false; uint32_t last_unblank_event = 0; - uint32_t display_blanking_timeout = 15000; + uint32_t display_blanking_timeout = 0; // Disabled until button wake is implemented // Partial framebuffer for clock region (410 x 60 = ~49KB, fits in DMA memory) #define CLOCK_FB_W CO5300_WIDTH @@ -52,6 +52,9 @@ if (!co5300_init()) return false; co5300_set_brightness(128); + // Disable blanking until button wake is implemented + display_blanking_enabled = false; + // Allocate partial framebuffer for clock region (PSRAM preferred for large buffers) clock_fb = (uint16_t *)heap_caps_malloc(CLOCK_FB_W * CLOCK_FB_H * 2, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); if (!clock_fb) clock_fb = (uint16_t *)malloc(CLOCK_FB_W * CLOCK_FB_H * 2); @@ -101,10 +104,11 @@ memset(clock_fb, 0, CLOCK_FB_W * CLOCK_FB_H * 2); char status[64]; - snprintf(status, sizeof(status), "%s %d%% %d sats", + snprintf(status, sizeof(status), "%s %d%% %dsats %lus", radio_online ? "RADIO" : "idle", (int)battery_percent, - gps_sats); + gps_sats, + millis() / 1000); co5300_draw_string(clock_fb, CLOCK_FB_W, CLOCK_FB_H, 10, 15, status, CO5300_GREY, &Org_01);