Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ void DisplayApp::Start(System::BootErrors error) {

bootError = error;

lvgl.Init();
motorController.Init();

if (error == System::BootErrors::TouchController) {
LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None);
} else {
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
}

if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) {
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
Expand All @@ -146,17 +137,25 @@ void DisplayApp::Start(System::BootErrors error) {
void DisplayApp::Process(void* instance) {
auto* app = static_cast<DisplayApp*>(instance);
NRF_LOG_INFO("displayapp task started!");
app->InitHw();
app->Init();

if (app->bootError == System::BootErrors::TouchController) {
app->LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None);
} else {
app->LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
}

while (true) {
app->Refresh();
}
}

void DisplayApp::InitHw() {
void DisplayApp::Init() {
lcd.Init();
motorController.Init();
brightnessController.Init();
ApplyBrightness();
lcd.Init();
lvgl.Init();
}

TickType_t DisplayApp::CalculateSleepTime() {
Expand Down
2 changes: 1 addition & 1 deletion src/displayapp/DisplayApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace Pinetime {

TouchEvents GetGesture();
static void Process(void* instance);
void InitHw();
void Init();
void Refresh();
void LoadNewScreen(Apps app, DisplayApp::FullRefreshDirections direction);
void LoadScreen(Apps app, DisplayApp::FullRefreshDirections direction);
Expand Down