summaryrefslogtreecommitdiff
path: root/src/displayapp/DisplayApp.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-10-10 16:48:45 +0200
committerJean-François Milants <jf@codingfield.com>2021-10-10 16:48:45 +0200
commit6d0e68d6260044dcce09ebf879a48e314987f808 (patch)
treeef9f0325f56fb22f7ce4a79321b61ad5da415a46 /src/displayapp/DisplayApp.cpp
parent92aeae73dee5bb16f669806621a9b735f2b0ce07 (diff)
parentf61e88b8425f9edcd38e47027df62dcc56c83adc (diff)
Merge branch 'update_touch_driver' of git://github.com/Riksu9000/InfiniTime into Riksu9000-update_touch_driver
# Conflicts: # src/displayapp/Apps.h
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
-rw-r--r--src/displayapp/DisplayApp.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index e763cda6..6e5cb576 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -29,6 +29,7 @@
#include "displayapp/screens/FlashLight.h"
#include "displayapp/screens/BatteryInfo.h"
#include "displayapp/screens/Steps.h"
+#include "displayapp/screens/Error.h"
#include "drivers/Cst816s.h"
#include "drivers/St7789.h"
@@ -112,11 +113,16 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
touchHandler {touchHandler} {
}
-void DisplayApp::Start() {
+void DisplayApp::Start(System::BootErrors error) {
msgQueue = xQueueCreate(queueSize, itemSize);
- // Start clock when smartwatch boots
- LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None);
+ bootError = error;
+
+ if (error == System::BootErrors::TouchController) {
+ LoadApp(Apps::Error, DisplayApp::FullRefreshDirections::None);
+ } else {
+ LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::None);
+ }
if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
@@ -311,6 +317,11 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
motionController);
break;
+ case Apps::Error:
+ currentScreen = std::make_unique<Screens::Error>(this, bootError);
+ ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::None);
+ break;
+
case Apps::FirmwareValidation:
currentScreen = std::make_unique<Screens::FirmwareValidation>(this, validator);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
@@ -385,7 +396,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
break;
case Apps::SysInfo:
currentScreen = std::make_unique<Screens::SystemInfo>(
- this, dateTimeController, batteryController, brightnessController, bleController, watchdog, motionController);
+ this, dateTimeController, batteryController, brightnessController, bleController, watchdog, motionController, touchPanel);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::FlashLight: