SystemTask: Move lcd to DisplayApp
SystemTask should never write to the lcd
This commit is contained in:
parent
6f942e20ed
commit
eccea5ab9f
|
@ -129,6 +129,7 @@ void DisplayApp::InitHw() {
|
|||
brightnessController.Init();
|
||||
ApplyBrightness();
|
||||
motorController.Init();
|
||||
lcd.Init();
|
||||
}
|
||||
|
||||
void DisplayApp::Refresh() {
|
||||
|
@ -184,10 +185,12 @@ void DisplayApp::Refresh() {
|
|||
brightnessController.Lower();
|
||||
vTaskDelay(100);
|
||||
}
|
||||
lcd.Sleep();
|
||||
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
|
||||
state = States::Idle;
|
||||
break;
|
||||
case Messages::GoToRunning:
|
||||
lcd.Wakeup();
|
||||
ApplyBrightness();
|
||||
state = States::Running;
|
||||
break;
|
||||
|
|
|
@ -128,7 +128,6 @@ Pinetime::Applications::DisplayApp displayApp(lcd,
|
|||
fs);
|
||||
|
||||
Pinetime::System::SystemTask systemTask(spi,
|
||||
lcd,
|
||||
spiNorFlash,
|
||||
twiMaster,
|
||||
touchPanel,
|
||||
|
|
|
@ -49,7 +49,6 @@ void MeasureBatteryTimerCallback(TimerHandle_t xTimer) {
|
|||
}
|
||||
|
||||
SystemTask::SystemTask(Drivers::SpiMaster& spi,
|
||||
Drivers::St7789& lcd,
|
||||
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
|
||||
Drivers::TwiMaster& twiMaster,
|
||||
Drivers::Cst816S& touchPanel,
|
||||
|
@ -71,7 +70,6 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi,
|
|||
Pinetime::Controllers::TouchHandler& touchHandler,
|
||||
Pinetime::Controllers::ButtonHandler& buttonHandler)
|
||||
: spi {spi},
|
||||
lcd {lcd},
|
||||
spiNorFlash {spiNorFlash},
|
||||
twiMaster {twiMaster},
|
||||
touchPanel {touchPanel},
|
||||
|
@ -131,7 +129,6 @@ void SystemTask::Work() {
|
|||
fs.Init();
|
||||
|
||||
nimbleController.Init();
|
||||
lcd.Init();
|
||||
|
||||
twiMaster.Init();
|
||||
/*
|
||||
|
@ -232,7 +229,6 @@ void SystemTask::Work() {
|
|||
|
||||
xTimerStart(dimTimer, 0);
|
||||
spiNorFlash.Wakeup();
|
||||
lcd.Wakeup();
|
||||
|
||||
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning);
|
||||
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp);
|
||||
|
@ -362,7 +358,6 @@ void SystemTask::Work() {
|
|||
// if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions.
|
||||
spiNorFlash.Sleep();
|
||||
}
|
||||
lcd.Sleep();
|
||||
spi.Sleep();
|
||||
|
||||
// Double Tap needs the touch screen to be in normal mode
|
||||
|
|
|
@ -55,7 +55,6 @@ namespace Pinetime {
|
|||
public:
|
||||
enum class SystemTaskState { Sleeping, Running, GoingToSleep, WakingUp };
|
||||
SystemTask(Drivers::SpiMaster& spi,
|
||||
Drivers::St7789& lcd,
|
||||
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
|
||||
Drivers::TwiMaster& twiMaster,
|
||||
Drivers::Cst816S& touchPanel,
|
||||
|
@ -97,7 +96,6 @@ namespace Pinetime {
|
|||
TaskHandle_t taskHandle;
|
||||
|
||||
Pinetime::Drivers::SpiMaster& spi;
|
||||
Pinetime::Drivers::St7789& lcd;
|
||||
Pinetime::Drivers::SpiNorFlash& spiNorFlash;
|
||||
Pinetime::Drivers::TwiMaster& twiMaster;
|
||||
Pinetime::Drivers::Cst816S& touchPanel;
|
||||
|
|
Loading…
Reference in New Issue
Block a user