mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
17 lines
415 B
C++
17 lines
415 B
C++
#include "battery_timer.h"
|
|
#include "apps_container.h"
|
|
|
|
BatteryTimer::BatteryTimer() :
|
|
Timer(1)
|
|
{
|
|
}
|
|
|
|
bool BatteryTimer::fire() {
|
|
AppsContainer * container = AppsContainer::sharedAppsContainer();
|
|
bool needRedrawing = container->updateBatteryState();
|
|
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY && !Ion::USB::isPlugged()) {
|
|
container->shutdownDueToLowBattery();
|
|
}
|
|
return needRedrawing;
|
|
}
|