Skip to content

Commit eccea5a

Browse files
committed
SystemTask: Move lcd to DisplayApp
SystemTask should never write to the lcd
1 parent 6f942e2 commit eccea5a

4 files changed

Lines changed: 3 additions & 8 deletions

File tree

src/displayapp/DisplayApp.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ void DisplayApp::InitHw() {
129129
brightnessController.Init();
130130
ApplyBrightness();
131131
motorController.Init();
132+
lcd.Init();
132133
}
133134

134135
void DisplayApp::Refresh() {
@@ -184,10 +185,12 @@ void DisplayApp::Refresh() {
184185
brightnessController.Lower();
185186
vTaskDelay(100);
186187
}
188+
lcd.Sleep();
187189
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
188190
state = States::Idle;
189191
break;
190192
case Messages::GoToRunning:
193+
lcd.Wakeup();
191194
ApplyBrightness();
192195
state = States::Running;
193196
break;

src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ Pinetime::Applications::DisplayApp displayApp(lcd,
128128
fs);
129129

130130
Pinetime::System::SystemTask systemTask(spi,
131-
lcd,
132131
spiNorFlash,
133132
twiMaster,
134133
touchPanel,

src/systemtask/SystemTask.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ void MeasureBatteryTimerCallback(TimerHandle_t xTimer) {
4949
}
5050

5151
SystemTask::SystemTask(Drivers::SpiMaster& spi,
52-
Drivers::St7789& lcd,
5352
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
5453
Drivers::TwiMaster& twiMaster,
5554
Drivers::Cst816S& touchPanel,
@@ -71,7 +70,6 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi,
7170
Pinetime::Controllers::TouchHandler& touchHandler,
7271
Pinetime::Controllers::ButtonHandler& buttonHandler)
7372
: spi {spi},
74-
lcd {lcd},
7573
spiNorFlash {spiNorFlash},
7674
twiMaster {twiMaster},
7775
touchPanel {touchPanel},
@@ -131,7 +129,6 @@ void SystemTask::Work() {
131129
fs.Init();
132130

133131
nimbleController.Init();
134-
lcd.Init();
135132

136133
twiMaster.Init();
137134
/*
@@ -232,7 +229,6 @@ void SystemTask::Work() {
232229

233230
xTimerStart(dimTimer, 0);
234231
spiNorFlash.Wakeup();
235-
lcd.Wakeup();
236232

237233
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToRunning);
238234
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::WakeUp);
@@ -362,7 +358,6 @@ void SystemTask::Work() {
362358
// if it's in sleep mode. Avoid bricked device by disabling sleep mode on these versions.
363359
spiNorFlash.Sleep();
364360
}
365-
lcd.Sleep();
366361
spi.Sleep();
367362

368363
// Double Tap needs the touch screen to be in normal mode

src/systemtask/SystemTask.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ namespace Pinetime {
5555
public:
5656
enum class SystemTaskState { Sleeping, Running, GoingToSleep, WakingUp };
5757
SystemTask(Drivers::SpiMaster& spi,
58-
Drivers::St7789& lcd,
5958
Pinetime::Drivers::SpiNorFlash& spiNorFlash,
6059
Drivers::TwiMaster& twiMaster,
6160
Drivers::Cst816S& touchPanel,
@@ -97,7 +96,6 @@ namespace Pinetime {
9796
TaskHandle_t taskHandle;
9897

9998
Pinetime::Drivers::SpiMaster& spi;
100-
Pinetime::Drivers::St7789& lcd;
10199
Pinetime::Drivers::SpiNorFlash& spiNorFlash;
102100
Pinetime::Drivers::TwiMaster& twiMaster;
103101
Pinetime::Drivers::Cst816S& touchPanel;

0 commit comments

Comments
 (0)