Skip to content

Commit 473d9c4

Browse files
committed
Fix code formatting
1 parent 97ba1a4 commit 473d9c4

21 files changed

+73
-25
lines changed

src/components/gfx/Gfx.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void Gfx::SetBackgroundColor(uint16_t color) {
141141
bool Gfx::GetNextBuffer(uint8_t** data, size_t& size) {
142142
if (!state.busy)
143143
return false;
144-
state.remainingIterations = state.remainingIterations-1;
144+
state.remainingIterations = state.remainingIterations - 1;
145145
if (state.remainingIterations == 0) {
146146
state.busy = false;
147147
NotifyEndOfTransfer(state.taskToNotify);

src/displayapp/Apps.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ namespace Pinetime {
4040
Error,
4141
Weather
4242
};
43+
4344
template <Apps>
4445
struct AppTraits {};
4546

46-
template<Apps ...As>
47+
template <Apps... As>
4748
struct TypeList {
4849
static constexpr size_t Count = sizeof...(As);
4950
};

src/displayapp/Controllers.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#pragma once
2+
23
namespace Pinetime {
34
namespace Applications {
45
class DisplayApp;
56
}
7+
68
namespace Components {
79
class LittleVgl;
810
}
11+
912
namespace Controllers {
1013
class Battery;
1114
class Ble;
@@ -23,9 +26,11 @@ namespace Pinetime {
2326
class MusicService;
2427
class NavigationService;
2528
}
29+
2630
namespace System {
2731
class SystemTask;
2832
}
33+
2934
namespace Applications {
3035
struct AppControllers {
3136
const Pinetime::Controllers::Battery& batteryController;

src/displayapp/DisplayApp.cpp

+19-7
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,24 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
9898
filesystem {filesystem},
9999
lvgl {lcd, filesystem},
100100
timer(this, TimerCallback),
101-
controllers{
102-
batteryController, bleController, dateTimeController, notificationManager, heartRateController,
103-
settingsController, motorController, motionController, alarmController, brightnessController,
104-
nullptr, filesystem, timer, nullptr, this, lvgl, nullptr, nullptr}
105-
{
101+
controllers {batteryController,
102+
bleController,
103+
dateTimeController,
104+
notificationManager,
105+
heartRateController,
106+
settingsController,
107+
motorController,
108+
motionController,
109+
alarmController,
110+
brightnessController,
111+
nullptr,
112+
filesystem,
113+
timer,
114+
nullptr,
115+
this,
116+
lvgl,
117+
nullptr,
118+
nullptr} {
106119
}
107120

108121
void DisplayApp::Start(System::BootErrors error) {
@@ -421,8 +434,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
421434
dateTimeController,
422435
filesystem,
423436
std::move(apps));
424-
}
425-
break;
437+
} break;
426438
case Apps::Clock:
427439
currentScreen = std::make_unique<Screens::Clock>(dateTimeController,
428440
batteryController,

src/displayapp/DisplayAppRecovery.h

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ namespace Pinetime {
7373
void Register(Pinetime::Controllers::MusicService* musicService);
7474
void Register(Pinetime::Controllers::NavigationService* NavigationService);
7575

76-
7776
private:
7877
TaskHandle_t taskHandle;
7978
static void Process(void* instance);

src/displayapp/UserApps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Pinetime {
2626
return {AppTraits<t>::app, AppTraits<t>::icon, &AppTraits<t>::Create};
2727
}
2828

29-
template <template<Apps...> typename T, Apps ...ts>
29+
template <template <Apps...> typename T, Apps... ts>
3030
consteval std::array<AppDescription, sizeof...(ts)> CreateAppDescriptions(T<ts...>) {
3131
return {CreateAppDescription<ts>()...};
3232
}

src/displayapp/screens/Alarm.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,18 @@ namespace Pinetime {
6565
Widgets::Counter minuteCounter = Widgets::Counter(0, 59, jetbrains_mono_76);
6666
};
6767
}
68-
template<>
68+
69+
template <>
6970
struct AppTraits<Apps::Alarm> {
7071
static constexpr Apps app = Apps::Alarm;
7172
static constexpr const char* icon = Screens::Symbols::clock;
72-
static Screens::Screen *Create(AppControllers& controllers) { return new Screens::Alarm(controllers.alarmController,
73+
74+
static Screens::Screen* Create(AppControllers& controllers) {
75+
return new Screens::Alarm(controllers.alarmController,
7376
controllers.settingsController.GetClockType(),
7477
*controllers.systemTask,
75-
controllers.motorController); };
78+
controllers.motorController);
79+
};
7680
};
7781
}
7882
}

src/displayapp/screens/ApplicationList.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "displayapp/screens/Tile.h"
33
#include <lvgl/lvgl.h>
44
#include <functional>
5-
#include <algorithm>
5+
#include <algorithm>
66
#include "components/settings/Settings.h"
77

88
using namespace Pinetime::Applications::Screens;
@@ -29,8 +29,8 @@ ApplicationList::ApplicationList(DisplayApp* app,
2929
batteryController {batteryController},
3030
bleController {bleController},
3131
dateTimeController {dateTimeController},
32-
filesystem{filesystem},
33-
apps{std::move(apps)},
32+
filesystem {filesystem},
33+
apps {std::move(apps)},
3434
screens {app, settingsController.GetAppMenu(), CreateScreenList(), Screens::ScreenListModes::UpDown} {
3535
}
3636

@@ -45,8 +45,8 @@ bool ApplicationList::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
4545
std::unique_ptr<Screen> ApplicationList::CreateScreen(unsigned int screenNum) const {
4646
std::array<Tile::Applications, appsPerScreen> pageApps;
4747

48-
for(int i = 0; i < appsPerScreen; i++) {
49-
if(i+(screenNum * appsPerScreen) >= apps.size()) {
48+
for (int i = 0; i < appsPerScreen; i++) {
49+
if (i + (screenNum * appsPerScreen) >= apps.size()) {
5050
pageApps[i] = {"", Pinetime::Applications::Apps::None, false};
5151
} else {
5252
pageApps[i] = apps[i + (screenNum * appsPerScreen)];

src/displayapp/screens/ApplicationList.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace Pinetime {
3939
static constexpr int appsPerScreen = 6;
4040

4141
// Increment this when more space is needed
42-
static constexpr int nScreens = (UserAppTypes::Count/appsPerScreen)+1;
42+
static constexpr int nScreens = (UserAppTypes::Count / appsPerScreen) + 1;
4343

4444
ScreenList<nScreens> screens;
4545
};

src/displayapp/screens/HeartRate.h

+2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ namespace Pinetime {
3838
lv_task_t* taskRefresh;
3939
};
4040
}
41+
4142
template <>
4243
struct AppTraits<Apps::HeartRate> {
4344
static constexpr Apps app = Apps::HeartRate;
4445
static constexpr const char* icon = Screens::Symbols::heartBeat;
46+
4547
static Screens::Screen* Create(AppControllers& controllers) {
4648
return new Screens::HeartRate(controllers.heartRateController, *controllers.systemTask);
4749
};

src/displayapp/screens/InfiniPaint.h

+2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ namespace Pinetime {
3838
uint8_t color = 2;
3939
};
4040
}
41+
4142
template <>
4243
struct AppTraits<Apps::Paint> {
4344
static constexpr Apps app = Apps::Paint;
4445
static constexpr const char* icon = Screens::Symbols::paintbrush;
46+
4547
static Screens::Screen* Create(AppControllers& controllers) {
4648
return new Screens::InfiniPaint(controllers.lvgl, controllers.motorController);
4749
};

src/displayapp/screens/Metronome.h

+2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ namespace Pinetime {
3737
lv_task_t* taskRefresh;
3838
};
3939
}
40+
4041
template <>
4142
struct AppTraits<Apps::Metronome> {
4243
static constexpr Apps app = Apps::Metronome;
4344
static constexpr const char* icon = Screens::Symbols::drum;
45+
4446
static Screens::Screen* Create(AppControllers& controllers) {
4547
return new Screens::Metronome(controllers.motorController, *controllers.systemTask);
4648
};

src/displayapp/screens/Motion.h

+2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ namespace Pinetime {
3232
lv_task_t* taskRefresh;
3333
};
3434
}
35+
3536
template <>
3637
struct AppTraits<Apps::Motion> {
3738
static constexpr Apps app = Apps::Motion;
3839
static constexpr const char* icon = "M";
40+
3941
static Screens::Screen* Create(AppControllers& controllers) {
4042
return new Screens::Motion(controllers.motionController);
4143
};

src/displayapp/screens/Music.h

+2
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ namespace Pinetime {
8585
/** Watchapp */
8686
};
8787
}
88+
8889
template <>
8990
struct AppTraits<Apps::Music> {
9091
static constexpr Apps app = Apps::Music;
9192
static constexpr const char* icon = Screens::Symbols::music;
93+
9294
static Screens::Screen* Create(AppControllers& controllers) {
9395
return new Screens::Music(*controllers.musicService);
9496
};

src/displayapp/screens/Navigation.h

+2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ namespace Pinetime {
5858
lv_task_t* taskRefresh;
5959
};
6060
}
61+
6162
template <>
6263
struct AppTraits<Apps::Navigation> {
6364
static constexpr Apps app = Apps::Navigation;
6465
static constexpr const char* icon = Screens::Symbols::map;
66+
6567
static Screens::Screen* Create(AppControllers& controllers) {
6668
return new Screens::Navigation(*controllers.navigationService);
6769
};

src/displayapp/screens/Paddle.h

+2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ namespace Pinetime {
4848
lv_task_t* taskRefresh;
4949
};
5050
}
51+
5152
template <>
5253
struct AppTraits<Apps::Paddle> {
5354
static constexpr Apps app = Apps::Paddle;
5455
static constexpr const char* icon = Screens::Symbols::paddle;
56+
5557
static Screens::Screen* Create(AppControllers& controllers) {
5658
return new Screens::Paddle(controllers.lvgl);
5759
};

src/displayapp/screens/Steps.h

+2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ namespace Pinetime {
4242
lv_task_t* taskRefresh;
4343
};
4444
}
45+
4546
template <>
4647
struct AppTraits<Apps::Steps> {
4748
static constexpr Apps app = Apps::Steps;
4849
static constexpr const char* icon = Screens::Symbols::shoe;
50+
4951
static Screens::Screen* Create(AppControllers& controllers) {
5052
return new Screens::Steps(controllers.motionController, controllers.settingsController);
5153
};

src/displayapp/screens/StopWatch.h

+2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ namespace Pinetime {
5959
lv_task_t* taskRefresh;
6060
};
6161
}
62+
6263
template <>
6364
struct AppTraits<Apps::StopWatch> {
6465
static constexpr Apps app = Apps::StopWatch;
6566
static constexpr const char* icon = Screens::Symbols::stopWatch;
67+
6668
static Screens::Screen* Create(AppControllers& controllers) {
6769
return new Screens::StopWatch(*controllers.systemTask);
6870
};

src/displayapp/screens/Timer.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "components/timer/Timer.h"
1111
#include "Symbols.h"
1212

13-
namespace Pinetime::Applications{
13+
namespace Pinetime::Applications {
1414
namespace Screens {
1515
class Timer : public Screen {
1616
public:
@@ -46,10 +46,13 @@ namespace Pinetime::Applications{
4646
};
4747
}
4848

49-
template<>
49+
template <>
5050
struct AppTraits<Apps::Timer> {
5151
static constexpr Apps app = Apps::Timer;
5252
static constexpr const char* icon = Screens::Symbols::hourGlass;
53-
static Screens::Screen *Create(AppControllers& controllers) { return new Screens::Timer(controllers.timer); };
53+
54+
static Screens::Screen* Create(AppControllers& controllers) {
55+
return new Screens::Timer(controllers.timer);
56+
};
5457
};
5558
}

src/displayapp/screens/Twos.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ namespace Pinetime {
3636
bool placeNewTile();
3737
};
3838
}
39-
template<>
39+
40+
template <>
4041
struct AppTraits<Apps::Twos> {
4142
static constexpr Apps app = Apps::Twos;
4243
static constexpr const char* icon = "2";
43-
static Screens::Screen *Create(AppControllers& /*controllers*/) { return new Screens::Twos(); };
44+
45+
static Screens::Screen* Create(AppControllers& /*controllers*/) {
46+
return new Screens::Twos();
47+
};
4448
};
4549
}
4650
}

src/displayapp/screens/Weather.h

+2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ namespace Pinetime {
4444
std::unique_ptr<Screen> CreateScreenHumidity();
4545
};
4646
}
47+
4748
template <>
4849
struct AppTraits<Apps::Weather> {
4950
static constexpr Apps app = Apps::Weather;
5051
static constexpr const char* icon = Screens::Symbols::sun;
52+
5153
static Screens::Screen* Create(AppControllers& controllers) {
5254
return new Screens::Weather(controllers.displayApp, *controllers.weatherController);
5355
};

0 commit comments

Comments
 (0)