[ion] Add RTC subsystem

This commit is contained in:
Jean-Baptiste Boric
2020-06-07 15:20:26 +02:00
parent 07da4831b1
commit 2fd15b7d7f
31 changed files with 743 additions and 9 deletions

View File

@@ -3,6 +3,7 @@
extern "C" {
#include <assert.h>
}
#include <ion/rtc.h>
AppsWindow::AppsWindow() :
Window(),
@@ -19,6 +20,11 @@ bool AppsWindow::updateBatteryLevel() {
return m_titleBarView.setChargeState(Ion::Battery::level());
}
bool AppsWindow::updateClock() {
Ion::RTC::DateTime dateTime = Ion::RTC::dateTime();
return m_titleBarView.setClock(dateTime.tm_hour, dateTime.tm_min);
}
bool AppsWindow::updateIsChargingState() {
return m_titleBarView.setIsCharging(Ion::Battery::isCharging());
}