From 473d9c4fa4d887275eafa9a2f4ef98b3e18695a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Wed, 1 Nov 2023 21:06:26 +0100 Subject: [PATCH] Fix code formatting --- src/components/gfx/Gfx.cpp | 2 +- src/displayapp/Apps.h | 3 ++- src/displayapp/Controllers.h | 5 +++++ src/displayapp/DisplayApp.cpp | 26 ++++++++++++++++------ src/displayapp/DisplayAppRecovery.h | 1 - src/displayapp/UserApps.h | 2 +- src/displayapp/screens/Alarm.h | 10 ++++++--- src/displayapp/screens/ApplicationList.cpp | 10 ++++----- src/displayapp/screens/ApplicationList.h | 2 +- src/displayapp/screens/HeartRate.h | 2 ++ src/displayapp/screens/InfiniPaint.h | 2 ++ src/displayapp/screens/Metronome.h | 2 ++ src/displayapp/screens/Motion.h | 2 ++ src/displayapp/screens/Music.h | 2 ++ src/displayapp/screens/Navigation.h | 2 ++ src/displayapp/screens/Paddle.h | 2 ++ src/displayapp/screens/Steps.h | 2 ++ src/displayapp/screens/StopWatch.h | 2 ++ src/displayapp/screens/Timer.h | 9 +++++--- src/displayapp/screens/Twos.h | 8 +++++-- src/displayapp/screens/Weather.h | 2 ++ 21 files changed, 73 insertions(+), 25 deletions(-) diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp index d3ef3d08..baa6486a 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-1; + state.remainingIterations = state.remainingIterations - 1; if (state.remainingIterations == 0) { state.busy = false; NotifyEndOfTransfer(state.taskToNotify); diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index d96e6ea7..0dd8157e 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -40,10 +40,11 @@ namespace Pinetime { Error, Weather }; + template struct AppTraits {}; - template + template struct TypeList { static constexpr size_t Count = sizeof...(As); }; diff --git a/src/displayapp/Controllers.h b/src/displayapp/Controllers.h index a2f82388..df6b2284 100644 --- a/src/displayapp/Controllers.h +++ b/src/displayapp/Controllers.h @@ -1,11 +1,14 @@ #pragma once + namespace Pinetime { namespace Applications { class DisplayApp; } + namespace Components { class LittleVgl; } + namespace Controllers { class Battery; class Ble; @@ -23,9 +26,11 @@ namespace Pinetime { class MusicService; class NavigationService; } + namespace System { class SystemTask; } + namespace Applications { struct AppControllers { const Pinetime::Controllers::Battery& batteryController; diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index a195361d..98be6324 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -98,11 +98,24 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, filesystem {filesystem}, lvgl {lcd, filesystem}, timer(this, TimerCallback), - controllers{ - batteryController, bleController, dateTimeController, notificationManager, heartRateController, - settingsController, motorController, motionController, alarmController, brightnessController, - nullptr, filesystem, timer, nullptr, this, lvgl, nullptr, nullptr} - { + controllers {batteryController, + bleController, + dateTimeController, + notificationManager, + heartRateController, + settingsController, + motorController, + motionController, + alarmController, + brightnessController, + nullptr, + filesystem, + timer, + nullptr, + this, + lvgl, + nullptr, + nullptr} { } void DisplayApp::Start(System::BootErrors error) { @@ -421,8 +434,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio dateTimeController, filesystem, std::move(apps)); - } - break; + } break; case Apps::Clock: currentScreen = std::make_unique(dateTimeController, batteryController, diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index a42d3e2f..41aedb17 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -73,7 +73,6 @@ namespace Pinetime { void Register(Pinetime::Controllers::MusicService* musicService); void Register(Pinetime::Controllers::NavigationService* NavigationService); - private: TaskHandle_t taskHandle; static void Process(void* instance); diff --git a/src/displayapp/UserApps.h b/src/displayapp/UserApps.h index d0165cf9..0ed9d602 100644 --- a/src/displayapp/UserApps.h +++ b/src/displayapp/UserApps.h @@ -26,7 +26,7 @@ namespace Pinetime { return {AppTraits::app, AppTraits::icon, &AppTraits::Create}; } - template typename T, Apps ...ts> + template