Skip to content

Commit 96165a8

Browse files
FintasticManJF002
authored andcommitted
Format header files
In my PR updating clang-format, I forgot to also format the headers.
1 parent 09db67e commit 96165a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+144
-0
lines changed

src/components/alarm/AlarmController.h

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace Pinetime {
2626
namespace System {
2727
class SystemTask;
2828
}
29+
2930
namespace Controllers {
3031
class AlarmController {
3132
public:
@@ -40,18 +41,23 @@ namespace Pinetime {
4041
void StopAlerting();
4142
enum class AlarmState { Not_Set, Set, Alerting };
4243
enum class RecurType { None, Daily, Weekdays };
44+
4345
uint8_t Hours() const {
4446
return hours;
4547
}
48+
4649
uint8_t Minutes() const {
4750
return minutes;
4851
}
52+
4953
AlarmState State() const {
5054
return state;
5155
}
56+
5257
RecurType Recurrence() const {
5358
return recurrence;
5459
}
60+
5561
void SetRecurrence(RecurType recurType) {
5662
recurrence = recurType;
5763
}

src/components/battery/BatteryController.h

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace Pinetime {
1717
uint8_t PercentRemaining() const {
1818
return percentRemaining;
1919
}
20+
2021
bool BatteryIsLow() const {
2122
return percentRemaining <= lowBatteryThreshold;
2223
}

src/components/ble/AlertNotificationService.h

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Pinetime {
1616
namespace System {
1717
class SystemTask;
1818
}
19+
1920
namespace Controllers {
2021
class NotificationManager;
2122

src/components/ble/BatteryInformationService.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ namespace Pinetime {
99
namespace System {
1010
class SystemTask;
1111
}
12+
1213
namespace Controllers {
1314
class Battery;
15+
1416
class BatteryInformationService {
1517
public:
1618
BatteryInformationService(Controllers::Battery& batteryController);

src/components/ble/BleController.h

+8
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,43 @@ namespace Pinetime {
2424
void StopFirmwareUpdate();
2525
void FirmwareUpdateTotalBytes(uint32_t totalBytes);
2626
void FirmwareUpdateCurrentBytes(uint32_t currentBytes);
27+
2728
void State(FirmwareUpdateStates state) {
2829
firmwareUpdateState = state;
2930
}
3031

3132
bool IsFirmwareUpdating() const {
3233
return isFirmwareUpdating;
3334
}
35+
3436
uint32_t FirmwareUpdateTotalBytes() const {
3537
return firmwareUpdateTotalBytes;
3638
}
39+
3740
uint32_t FirmwareUpdateCurrentBytes() const {
3841
return firmwareUpdateCurrentBytes;
3942
}
43+
4044
FirmwareUpdateStates State() const {
4145
return firmwareUpdateState;
4246
}
4347

4448
void Address(BleAddress&& addr) {
4549
address = addr;
4650
}
51+
4752
const BleAddress& Address() const {
4853
return address;
4954
}
55+
5056
void AddressType(AddressTypes t) {
5157
addressType = t;
5258
}
59+
5360
void SetPairingKey(uint32_t k) {
5461
pairingKey = k;
5562
}
63+
5664
uint32_t GetPairingKey() const {
5765
return pairingKey;
5866
}

src/components/ble/CurrentTimeClient.h

+3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ namespace Pinetime {
1919
bool OnDiscoveryEvent(uint16_t connectionHandle, const ble_gatt_error* error, const ble_gatt_svc* service);
2020
int OnCharacteristicDiscoveryEvent(uint16_t conn_handle, const ble_gatt_error* error, const ble_gatt_chr* characteristic);
2121
int OnCurrentTimeReadResult(uint16_t conn_handle, const ble_gatt_error* error, const ble_gatt_attr* attribute);
22+
2223
static constexpr const ble_uuid16_t* Uuid() {
2324
return &CurrentTimeClient::ctsServiceUuid;
2425
}
26+
2527
static constexpr const ble_uuid16_t* CurrentTimeCharacteristicUuid() {
2628
return &CurrentTimeClient::currentTimeCharacteristicUuid;
2729
}
30+
2831
void Discover(uint16_t connectionHandle, std::function<void(uint16_t)> lambda) override;
2932

3033
private:

src/components/ble/DfuService.h

+4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ namespace Pinetime {
1313
namespace System {
1414
class SystemTask;
1515
}
16+
1617
namespace Drivers {
1718
class SpiNorFlash;
1819
}
20+
1921
namespace Controllers {
2022
class Ble;
2123

@@ -46,10 +48,12 @@ namespace Pinetime {
4648
void OnNotificationTimer();
4749
void Reset();
4850
};
51+
4952
class DfuImage {
5053
public:
5154
DfuImage(Pinetime::Drivers::SpiNorFlash& spiNorFlash) : spiNorFlash {spiNorFlash} {
5255
}
56+
5357
void Init(size_t chunkSize, size_t totalSize, uint16_t expectedCrc);
5458
void Erase();
5559
void Append(uint8_t* data, size_t size);

src/components/ble/FSService.h

+6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ namespace Pinetime {
1111
namespace System {
1212
class SystemTask;
1313
}
14+
1415
namespace Controllers {
1516
class Ble;
17+
1618
class FSService {
1719
public:
1820
FSService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::FS& fs);
@@ -71,6 +73,7 @@ namespace Pinetime {
7173
FSState state;
7274
char filepath[maxpathlen]; // TODO ..ugh fixed filepath len
7375
int fileSize;
76+
7477
using ReadHeader = struct __attribute__((packed)) {
7578
commands command;
7679
uint8_t padding;
@@ -89,6 +92,7 @@ namespace Pinetime {
8992
uint32_t chunklen;
9093
uint8_t chunk[];
9194
};
95+
9296
using ReadPacing = struct __attribute__((packed)) {
9397
commands command;
9498
uint8_t status;
@@ -124,6 +128,7 @@ namespace Pinetime {
124128
uint32_t dataSize;
125129
uint8_t data[];
126130
};
131+
127132
using ListDirHeader = struct __attribute__((packed)) {
128133
commands command;
129134
uint8_t padding;
@@ -171,6 +176,7 @@ namespace Pinetime {
171176
commands command;
172177
uint8_t status;
173178
};
179+
174180
using MoveHeader = struct __attribute__((packed)) {
175181
commands command;
176182
uint8_t padding;

src/components/ble/HeartRateService.h

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ namespace Pinetime {
1010
namespace System {
1111
class SystemTask;
1212
}
13+
1314
namespace Controllers {
1415
class HeartRateController;
16+
1517
class HeartRateService {
1618
public:
1719
HeartRateService(Pinetime::System::SystemTask& system, Controllers::HeartRateController& heartRateController);

src/components/ble/ImmediateAlertService.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ namespace Pinetime {
99
namespace System {
1010
class SystemTask;
1111
}
12+
1213
namespace Controllers {
1314
class NotificationManager;
15+
1416
class ImmediateAlertService {
1517
public:
1618
enum class Levels : uint8_t { NoAlert = 0, MildAlert = 1, HighAlert = 2 };

src/components/ble/MotionService.h

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ namespace Pinetime {
1010
namespace System {
1111
class SystemTask;
1212
}
13+
1314
namespace Controllers {
1415
class MotionController;
16+
1517
class MotionService {
1618
public:
1719
MotionService(Pinetime::System::SystemTask& system, Controllers::MotionController& motionController);

src/components/ble/MusicService.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace Pinetime {
3030
namespace System {
3131
class SystemTask;
3232
}
33+
3334
namespace Controllers {
3435
class MusicService {
3536
public:

src/components/ble/NavigationService.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace Pinetime {
3030
namespace System {
3131
class SystemTask;
3232
}
33+
3334
namespace Controllers {
3435

3536
class NavigationService {

src/components/ble/NimbleController.h

+3
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ namespace Pinetime {
5858
Pinetime::Controllers::MusicService& music() {
5959
return musicService;
6060
};
61+
6162
Pinetime::Controllers::NavigationService& navigation() {
6263
return navService;
6364
};
65+
6466
Pinetime::Controllers::AlertNotificationService& alertService() {
6567
return anService;
6668
};
69+
6770
Pinetime::Controllers::WeatherService& weather() {
6871
return weatherService;
6972
};

src/components/ble/NotificationManager.h

+2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ namespace Pinetime {
5151
static constexpr size_t MaximumMessageSize() {
5252
return MessageSize;
5353
};
54+
5455
bool IsEmpty() const {
5556
return size == 0;
5657
}
58+
5759
size_t NbNotifications() const;
5860

5961
private:

src/components/ble/weather/WeatherService.h

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace Pinetime {
3939
namespace System {
4040
class SystemTask;
4141
}
42+
4243
namespace Controllers {
4344

4445
class WeatherService {

src/components/datetime/DateTimeController.h

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Pinetime {
99
namespace System {
1010
class SystemTask;
1111
}
12+
1213
namespace Controllers {
1314
class DateTime {
1415
public:
@@ -51,24 +52,31 @@ namespace Pinetime {
5152
void SetTimeZone(int8_t timezone, int8_t dst);
5253

5354
void UpdateTime(uint32_t systickCounter);
55+
5456
uint16_t Year() const {
5557
return year;
5658
}
59+
5760
Months Month() const {
5861
return month;
5962
}
63+
6064
uint8_t Day() const {
6165
return day;
6266
}
67+
6368
Days DayOfWeek() const {
6469
return dayOfWeek;
6570
}
71+
6672
uint8_t Hours() const {
6773
return hour;
6874
}
75+
6976
uint8_t Minutes() const {
7077
return minute;
7178
}
79+
7280
uint8_t Seconds() const {
7381
return second;
7482
}
@@ -117,9 +125,11 @@ namespace Pinetime {
117125
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const {
118126
return currentDateTime;
119127
}
128+
120129
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> UTCDateTime() const {
121130
return currentDateTime - std::chrono::seconds((tzOffset + dstOffset) * 15 * 60);
122131
}
132+
123133
std::chrono::seconds Uptime() const {
124134
return uptime;
125135
}

src/components/fs/FS.h

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace Pinetime {
3535
static size_t getSize() {
3636
return size;
3737
}
38+
3839
static size_t getBlockSize() {
3940
return blockSize;
4041
}

src/components/gfx/Gfx.h

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Pinetime {
1010
namespace Drivers {
1111
class St7789;
1212
}
13+
1314
namespace Components {
1415
class Gfx : public Pinetime::Drivers::BufferProvider {
1516
public:
@@ -33,9 +34,11 @@ namespace Pinetime {
3334
static constexpr uint8_t height = 240;
3435

3536
enum class Action { None, FillRectangle, DrawChar };
37+
3638
struct State {
3739
State() : busy {false}, action {Action::None}, remainingIterations {0}, currentIteration {0} {
3840
}
41+
3942
volatile bool busy;
4043
volatile Action action;
4144
volatile uint16_t remainingIterations;

src/components/heartrate/HeartRateController.h

+4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ namespace Pinetime {
77
namespace Applications {
88
class HeartRateTask;
99
}
10+
1011
namespace System {
1112
class SystemTask;
1213
}
14+
1315
namespace Controllers {
1416
class HeartRateController {
1517
public:
@@ -21,9 +23,11 @@ namespace Pinetime {
2123
void Update(States newState, uint8_t heartRate);
2224

2325
void SetHeartRateTask(Applications::HeartRateTask* task);
26+
2427
States State() const {
2528
return state;
2629
}
30+
2731
uint8_t HeartRate() const {
2832
return heartRate;
2933
}

0 commit comments

Comments
 (0)