From 02af09d9430bef72f307d49bc215149415a180ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Mon, 23 Oct 2023 21:43:05 +0200 Subject: [PATCH] Application selection at build time Fix DisplayAppRecovery so it builds with -std=c++20. --- src/components/gfx/Gfx.cpp | 4 ++-- src/displayapp/DisplayAppRecovery.cpp | 9 +++++++++ src/displayapp/DisplayAppRecovery.h | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp index 3eaaa3fe..d3ef3d08 100644 --- a/src/components/gfx/Gfx.cpp +++ b/src/components/gfx/Gfx.cpp @@ -141,7 +141,7 @@ void Gfx::SetBackgroundColor(uint16_t color) { bool Gfx::GetNextBuffer(uint8_t** data, size_t& size) { if (!state.busy) return false; - state.remainingIterations--; + state.remainingIterations = state.remainingIterations-1; if (state.remainingIterations == 0) { state.busy = false; NotifyEndOfTransfer(state.taskToNotify); @@ -170,7 +170,7 @@ bool Gfx::GetNextBuffer(uint8_t** data, size_t& size) { size = bytes_in_line * 8 * 2; } - state.currentIteration++; + state.currentIteration = state.currentIteration + 1; return true; } diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index de165c29..9fe59c40 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -121,3 +121,12 @@ void DisplayApp::PushMessage(Display::Messages msg) { void DisplayApp::Register(Pinetime::System::SystemTask* /*systemTask*/) { } + +void DisplayApp::Register(Pinetime::Controllers::WeatherService* /*weatherService*/) { +} + +void DisplayApp::Register(Pinetime::Controllers::MusicService* /*musicService*/) { +} + +void DisplayApp::Register(Pinetime::Controllers::NavigationService* /*NavigationService*/) { +} diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 3ce95187..a42d3e2f 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -34,6 +34,9 @@ namespace Pinetime { class AlarmController; class BrightnessController; class FS; + class WeatherService; + class MusicService; + class NavigationService; } namespace System { @@ -66,6 +69,10 @@ namespace Pinetime { void PushMessage(Pinetime::Applications::Display::Messages msg); void Register(Pinetime::System::SystemTask* systemTask); + void Register(Pinetime::Controllers::WeatherService* weatherService); + void Register(Pinetime::Controllers::MusicService* musicService); + void Register(Pinetime::Controllers::NavigationService* NavigationService); + private: TaskHandle_t taskHandle;