diff options
Diffstat (limited to 'source/widget.cpp')
-rw-r--r-- | source/widget.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/widget.cpp b/source/widget.cpp new file mode 100644 index 0000000..9109185 --- /dev/null +++ b/source/widget.cpp @@ -0,0 +1,20 @@ +#include "rtc.hpp" +#include "widget.hpp" + +void TimeWidget::render(Adafruit_GFX& display, unsigned int ypos) +{ + if (auto t = RTC::ticks(); t != prevTicks) { + prevTicks = t; + display.setTextSize(3); + display.setCursor(0, ypos + 4); + display.printf("%2d:%02d:%02d", t / 3600, (t % 3600) / + 60, t % 60); + } +} + +void NotificationWidget::render(Adafruit_GFX& display, unsigned int ypos) +{ + display.setTextSize(2); + display.setCursor(0, ypos); + display.printf("%-36s", message); +} |