summaryrefslogtreecommitdiff
path: root/src/SystemTask/SystemTask.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-08-22 17:59:59 +0200
committerJF <jf@codingfield.com>2020-08-22 17:59:59 +0200
commitf7e40b1b5879242b4ce59854dbbadb44fe5f75e4 (patch)
treec90d927a985d1b13f48af1d6e9aeb6d4c0e7cc0f /src/SystemTask/SystemTask.cpp
parentecbbeb6283178696ae36891225e086d3154e8a8a (diff)
Re-implement sleep/wakeup for touch panel, display, NOR Flash, SPI and TWI.
Diffstat (limited to 'src/SystemTask/SystemTask.cpp')
-rw-r--r--src/SystemTask/SystemTask.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/SystemTask/SystemTask.cpp b/src/SystemTask/SystemTask.cpp
index 1ee8e918..b515d1ab 100644
--- a/src/SystemTask/SystemTask.cpp
+++ b/src/SystemTask/SystemTask.cpp
@@ -145,6 +145,14 @@ void SystemTask::Work() {
case Messages::OnButtonEvent:
ReloadIdleTimer();
break;
+ case Messages::OnDisplayTaskSleeping:
+ spiNorFlash.Sleep();
+ lcd.Sleep();
+ touchPanel.Sleep();
+
+ spi.Sleep();
+ twiMaster.Sleep();
+ break;
default: break;
}
}
@@ -185,6 +193,13 @@ void SystemTask::OnButtonPushed() {
void SystemTask::GoToRunning() {
PushMessage(Messages::GoToRunning);
+ spi.Wakeup();
+ twiMaster.Wakeup();
+
+ spiNorFlash.Wakeup();
+ lcd.Wakeup();
+ touchPanel.Wakeup();
+
displayApp->PushMessage(Applications::DisplayApp::Messages::GoToRunning);
displayApp->PushMessage(Applications::DisplayApp::Messages::UpdateBatteryLevel);
}