aboutsummaryrefslogtreecommitdiffstats
path: root/source/widget.cpp
blob: 91091852b6dadd60bd71862ad22921220ab0a9bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
}