mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
17 lines
521 B
C++
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;
|
|
}
|