Merge branch 'update_touch_driver' of git://github.com/Riksu9000/InfiniTime into Riksu9000-update_touch_driver

# Conflicts:
#	src/displayapp/Apps.h
This commit is contained in:
Jean-François Milants
2021-10-10 16:48:45 +02:00
12 changed files with 161 additions and 24 deletions

View File

@@ -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: