Skip to content

Commit 856d0a6

Browse files
committed
feat: Create a display hardware abstraction layer (DisplayHal) supporting SSD1306, 16x2, and ST7789 screens with setup, boot, info, and mining results display functions.
1 parent e8a0613 commit 856d0a6

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

ESP_Code/DisplayHal.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
#if defined(DISPLAY_ST7789)
8989
tft.begin();
90-
tft.setRotation(1);
90+
tft.setRotation(1);
9191
tft.init();
9292
tft.fillScreen(BLACK);
9393
#endif
@@ -305,35 +305,34 @@
305305
#endif
306306

307307
#if defined(DISPLAY_ST7789)
308-
tft.init();
309-
tft.fillScreen(BLACK);
310-
tft.setTextColor(WHITE);
308+
// Use background color to overwrite old text (no fillScreen needed = no flicker)
309+
tft.setTextColor(WHITE, BLACK);
311310

312311
tft.setTextSize(2);
313312
tft.setCursor(2, 10);
314-
tft.print("Hashrate: " + hashrate + " kH");
313+
tft.print("Hashrate: " + hashrate + " kH ");
315314

316315
tft.setCursor(2, 30);
317-
tft.print("Node: " + node);
316+
tft.print("Node: " + node + " ");
318317

319318
tft.setCursor(2, 50);
320-
tft.print("Accepted/Total: " + accepted_shares + "/" + total_shares);
319+
tft.print("Accepted/Total: " + accepted_shares + "/" + total_shares + " ");
321320
tft.setCursor(2, 70);
322-
tft.print("Accepted Rate: " + accept_rate + "%");
321+
tft.print("Accepted Rate: " + accept_rate + "% ");
323322

324323
tft.setCursor(2, 90);
325-
tft.print("Ping: " + ping + " ms");
324+
tft.print("Ping: " + ping + " ms ");
326325

327326
tft.setCursor(2, 110);
328-
tft.print("Uptime: " + uptime);
327+
tft.print("Uptime: " + uptime + " ");
329328

330329
tft.setCursor(2, 130);
331-
tft.print("Share Rate: " + sharerate);
330+
tft.print("Share Rate: " + sharerate + " ");
332331
tft.setCursor(2, 150);
333-
tft.print("Difficulty: " + difficulty);
332+
tft.print("Difficulty: " + difficulty + " ");
334333

335334
tft.setCursor(2, 200);
336-
tft.print("IP: " + WiFi.localIP().toString());
335+
tft.print("IP: " + WiFi.localIP().toString() + " ");
337336

338337
#endif
339338
}

0 commit comments

Comments
 (0)