diff options
author | Finlay Davidson <finlay.davidson@coderclass.nl> | 2023-01-03 14:05:30 +0000 |
---|---|---|
committer | JF <JF002@users.noreply.github.com> | 2023-01-04 17:15:33 +0100 |
commit | eda96ffadc824742bf937c58f5295c86389a6d5e (patch) | |
tree | 1780b2fff3719f721c534cee192d28da945c9ff9 /src | |
parent | 318a243df1ad844ed487b936eb7edde876fc5ef6 (diff) |
Update clang-{format,tidy} to 14
Also add configuration options only available in 13 and 14.
Fixes warning about -fstack-usage in clang-tidy check.
Diffstat (limited to 'src')
-rw-r--r-- | src/components/ble/BatteryInformationService.cpp | 1 | ||||
-rw-r--r-- | src/components/ble/MotionService.cpp | 1 | ||||
-rw-r--r-- | src/components/datetime/DateTimeController.cpp | 1 | ||||
-rw-r--r-- | src/components/fs/FS.cpp | 5 | ||||
-rw-r--r-- | src/components/motion/MotionController.cpp | 3 | ||||
-rw-r--r-- | src/displayapp/DisplayApp.cpp | 1 | ||||
-rw-r--r-- | src/displayapp/screens/WatchFaceCasioStyleG7710.cpp | 1 | ||||
-rw-r--r-- | src/displayapp/screens/settings/SettingSetTime.cpp | 1 | ||||
-rw-r--r-- | src/displayapp/widgets/Counter.cpp | 2 | ||||
-rw-r--r-- | src/drivers/Bma421.cpp | 2 | ||||
-rw-r--r-- | src/drivers/DebugPins.cpp | 2 | ||||
-rw-r--r-- | src/drivers/Hrs3300.cpp | 1 | ||||
-rw-r--r-- | src/recoveryLoader.cpp | 1 |
13 files changed, 22 insertions, 0 deletions
diff --git a/src/components/ble/BatteryInformationService.cpp b/src/components/ble/BatteryInformationService.cpp index 9a3f86f5..14589cb9 100644 --- a/src/components/ble/BatteryInformationService.cpp +++ b/src/components/ble/BatteryInformationService.cpp @@ -49,6 +49,7 @@ int BatteryInformationService::OnBatteryServiceRequested(uint16_t connectionHand } return 0; } + void BatteryInformationService::NotifyBatteryLevel(uint16_t connectionHandle, uint8_t level) { auto* om = ble_hs_mbuf_from_flat(&level, 1); ble_gattc_notify_custom(connectionHandle, batteryLevelHandle, om); diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index 121ad3b0..a7e95923 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -90,6 +90,7 @@ void MotionService::OnNewStepCountValue(uint32_t stepCount) { ble_gattc_notify_custom(connectionHandle, stepCountHandle, om); } + void MotionService::OnNewMotionValues(int16_t x, int16_t y, int16_t z) { if (!motionValuesNoficationEnabled) return; diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index e8c7cd5b..73364b2f 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -142,6 +142,7 @@ void DateTime::Register(Pinetime::System::SystemTask* systemTask) { } using ClockType = Pinetime::Controllers::Settings::ClockType; + std::string DateTime::FormattedTime() { // Return time as a string in 12- or 24-hour format char buff[9]; diff --git a/src/components/fs/FS.cpp b/src/components/fs/FS.cpp index 14b05525..a67b6b3d 100644 --- a/src/components/fs/FS.cpp +++ b/src/components/fs/FS.cpp @@ -89,18 +89,23 @@ int FS::DirClose(lfs_dir_t* lfs_dir) { int FS::DirRead(lfs_dir_t* dir, lfs_info* info) { return lfs_dir_read(&lfs, dir, info); } + int FS::DirRewind(lfs_dir_t* dir) { return lfs_dir_rewind(&lfs, dir); } + int FS::DirCreate(const char* path) { return lfs_mkdir(&lfs, path); } + int FS::Rename(const char* oldPath, const char* newPath) { return lfs_rename(&lfs, oldPath, newPath); } + int FS::Stat(const char* path, lfs_info* info) { return lfs_stat(&lfs, path, info); } + lfs_ssize_t FS::GetFSSize() { return lfs_fs_size(&lfs); } diff --git a/src/components/motion/MotionController.cpp b/src/components/motion/MotionController.cpp index d93d769b..8ba46814 100644 --- a/src/components/motion/MotionController.cpp +++ b/src/components/motion/MotionController.cpp @@ -61,6 +61,7 @@ bool MotionController::Should_ShakeWake(uint16_t thresh) { lastZForShake = z; return wake; } + int32_t MotionController::currentShakeSpeed() { return accumulatedspeed; } @@ -68,6 +69,7 @@ int32_t MotionController::currentShakeSpeed() { void MotionController::IsSensorOk(bool isOk) { isSensorOk = isOk; } + void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) { switch (types) { case Drivers::Bma421::DeviceTypes::BMA421: @@ -81,6 +83,7 @@ void MotionController::Init(Pinetime::Drivers::Bma421::DeviceTypes types) { break; } } + void MotionController::SetService(Pinetime::Controllers::MotionService* service) { this->service = service; } diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 015bc8de..9535c2f3 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -529,6 +529,7 @@ void DisplayApp::PushMessageToSystemTask(Pinetime::System::Messages message) { void DisplayApp::Register(Pinetime::System::SystemTask* systemTask) { this->systemTask = systemTask; } + void DisplayApp::ApplyBrightness() { auto brightness = settingsController.GetBrightness(); if (brightness != Controllers::BrightnessController::Levels::Low && brightness != Controllers::BrightnessController::Levels::Medium && diff --git a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp index bdae0d42..94b6a405 100644 --- a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp +++ b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp @@ -333,6 +333,7 @@ void WatchFaceCasioStyleG7710::Refresh() { lv_obj_realign(stepIcon); } } + bool WatchFaceCasioStyleG7710::IsAvailable(Pinetime::Controllers::FS& filesystem) { lfs_file file = {}; diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index e7d824fd..f85fe073 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -18,6 +18,7 @@ namespace { screen->SetTime(); } } + void ValueChangedHandler(void* userData) { auto* screen = static_cast<SettingSetTime*>(userData); screen->UpdateScreen(); diff --git a/src/displayapp/widgets/Counter.cpp b/src/displayapp/widgets/Counter.cpp index ccc28cc8..b486e372 100644 --- a/src/displayapp/widgets/Counter.cpp +++ b/src/displayapp/widgets/Counter.cpp @@ -18,6 +18,7 @@ namespace { widget->DownBtnPressed(); } } + constexpr int digitCount(int number) { int digitCount = 0; while (number > 0) { @@ -67,6 +68,7 @@ void Counter::HideControls() { lv_obj_set_hidden(lowerLine, true); lv_obj_set_style_local_bg_opa(counterContainer, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); } + void Counter::ShowControls() { lv_obj_set_hidden(upBtn, false); lv_obj_set_hidden(downBtn, false); diff --git a/src/drivers/Bma421.cpp b/src/drivers/Bma421.cpp index 539cc8d1..07a94329 100644 --- a/src/drivers/Bma421.cpp +++ b/src/drivers/Bma421.cpp @@ -118,6 +118,7 @@ Bma421::Values Bma421::Process() { // X and Y axis are swapped because of the way the sensor is mounted in the PineTime return {steps, data.y, data.x, data.z}; } + bool Bma421::IsOk() const { return isOk; } @@ -133,6 +134,7 @@ void Bma421::SoftReset() { nrf_delay_ms(1); } } + Bma421::DeviceTypes Bma421::DeviceType() const { return deviceType; } diff --git a/src/drivers/DebugPins.cpp b/src/drivers/DebugPins.cpp index 4b2f0f16..6d24ca04 100644 --- a/src/drivers/DebugPins.cpp +++ b/src/drivers/DebugPins.cpp @@ -18,6 +18,7 @@ void debugpins_init() { nrf_gpio_cfg_output(DebugPin4); nrf_gpio_pin_clear(DebugPin4); } + void debugpins_set(debugpins_pins pin) { nrf_gpio_pin_set(static_cast<uint32_t>(pin)); } @@ -33,6 +34,7 @@ void debugpins_pulse(debugpins_pins pin) { #else void debugpins_init() { } + void debugpins_set(debugpins_pins pin) { } diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index ec620af2..6c47ae28 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -13,6 +13,7 @@ #include <nrf_log.h> using namespace Pinetime::Drivers; + /** Driver for the HRS3300 heart rate sensor. * Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/drivers/hrs3300.py */ diff --git a/src/recoveryLoader.cpp b/src/recoveryLoader.cpp index 27a79d9c..ea608a8b 100644 --- a/src/recoveryLoader.cpp +++ b/src/recoveryLoader.cpp @@ -81,6 +81,7 @@ void RefreshWatchdog() { } uint8_t displayBuffer[displayWidth * bytesPerPixel]; + void Process(void* instance) { RefreshWatchdog(); APP_GPIOTE_INIT(2); |