Files
Upsilon/apps/suspend_timer.cpp
2019-07-19 15:06:25 +02:00

17 lines
521 B
C++

#include "suspend_timer.h"
#include "apps_container.h"
SuspendTimer::SuspendTimer() :
Timer(k_idleBeforeSuspendDuration/Timer::TickDuration)
{
}
bool SuspendTimer::fire() {
/* We could just call container->suspend(), but we want to notify all
* responders in the responder chain that the calculator will be switched off,
* so we use an event to switch off the calculator. */
AppsContainer * container = AppsContainer::sharedAppsContainer();
container->dispatchEvent(Ion::Events::OnOff);
return false;
}