MCPcopy Create free account
hub / github.com/BruceDevices/firmware / drawTime

Function drawTime

src/modules/pwnagotchi/ui.cpp:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void drawTime() {
62 tft.drawPixel(0, 0, 0);
63 tft.fillRect(80, 0, display_w, canvas_top_h - 3, bruceConfig.bgColor);
64 tft.setTextDatum(TR_DATUM);
65 unsigned long ellapsed = millis() / 1000;
66 int8_t h = ellapsed / 3600;
67 int sr = ellapsed % 3600;
68 int8_t m = sr / 60;
69 int8_t s = sr % 60;
70 char right_str[50] = "UPS 0% UP 00:00:00";
71 sprintf(right_str, "UPS %i%% UP %02d:%02d:%02d", getBattery(), h, m, s);
72 tft.drawString(right_str, display_w, 3);
73}
74
75void drawFooterData(uint8_t friends_run, uint8_t friends_tot, String last_friend_name, signed int rssi) {
76 tft.drawPixel(0, 0, 0);

Callers 1

updateUiFunction · 0.85

Calls 6

millisFunction · 0.85
getBatteryFunction · 0.50
drawPixelMethod · 0.45
fillRectMethod · 0.45
setTextDatumMethod · 0.45
drawStringMethod · 0.45

Tested by

no test coverage detected