From 4a32c31a7b1a92ebf2dfa91f96a3ffda98a6a1c1 Mon Sep 17 00:00:00 2001 From: C <0xicl33n@gmail.com> Date: Thu, 2 Jul 2026 18:56:24 -0700 Subject: [PATCH] feat: Remove refresh icon and adjust timestamp display --- m5paper-stockticker.ino | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/m5paper-stockticker.ino b/m5paper-stockticker.ino index 027c245..00d4ee4 100644 --- a/m5paper-stockticker.ino +++ b/m5paper-stockticker.ino @@ -111,39 +111,6 @@ bool fetchStockAV(const char* sym, StockData& out) { // Drawing helpers // ------------------------------------------------------- -// Circular refresh icon drawn with primitives (two arcs + two arrowheads) -void drawRefreshIcon(int x, int y, int sz) { - const float DEG2RAD = 3.14159265f / 180.0f; - int cx = x + sz / 2; - int cy = y + sz / 2; - int ro = sz * 9 / 20; // outer radius - int ri = sz * 5 / 20; // inner radius - float rm = (ro + ri) / 2.0f; // midline - float as = sz / 5.0f; // arrowhead size - - // Two ~160° arcs with a small gap at top-right and bottom-left for arrowheads - M5.Display.fillArc(cx, cy, ro, ri, 200, 358, TFT_BLACK); // upper/left arc - M5.Display.fillArc(cx, cy, ro, ri, 22, 180, TFT_BLACK); // lower/right arc - - // Arrowheads at 0° (top, pointing right) and 180° (bottom, pointing left) - for (int pass = 0; pass < 2; pass++) { - float a = (pass == 0 ? 0.0f : 180.0f) * DEG2RAD; - float sa = sinf(a), ca = cosf(a); - float px = cx + rm * sa, py = cy - rm * ca; - float tx = ca, ty = sa; // clockwise tangent - float rx = sa, ry = -ca; // outward radial - M5.Display.fillTriangle( - (int)(px + tx*as*0.7f), - (int)(py + ty*as*0.7f), - (int)(px - tx*as*0.5f + rx*as*0.6f), - (int)(py - ty*as*0.5f + ry*as*0.6f), - (int)(px - tx*as*0.5f - rx*as*0.6f), - (int)(py - ty*as*0.5f - ry*as*0.6f), - TFT_BLACK - ); - } -} - void drawUpArrow(int x, int y, int sz) { M5.Display.fillTriangle(x + sz / 2, y, x, y + sz, x + sz, y + sz, TFT_BLACK); } @@ -227,12 +194,11 @@ void setup() { M5.Display.setTextColor(TFT_BLACK, TFT_WHITE); M5.Display.setTextSize(2); - // -- Row 1: refresh icon + timestamp (left) | "zZz [battery] xx%" (right) -- - drawRefreshIcon(20, 8, 46); + // -- Row 1: timestamp (left) | "zZz [battery] xx%" (right) -- char timeStr[32]; strftime(timeStr, sizeof(timeStr), "%d/%m %I:%M %p", &now); - M5.Display.setCursor(74, 22); - M5.Display.print(timeStr); + M5.Display.setCursor(20, 22); + M5.Display.print("U: "); M5.Display.print(timeStr); M5.Display.setCursor(740, 15);