diff options
author | Finlay Davidson <finlay.davidson@coderclass.nl> | 2022-05-09 17:16:08 +0200 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2022-06-05 09:15:46 +0300 |
commit | 7f45538eb53235ab4015fcf13533796c8759c7bc (patch) | |
tree | 79d9a2f60e8fb13cb5356bcc5c6e93259449530b /src/components/settings | |
parent | 718fbdab98ae80923a548ac03b7843f5d618a4f6 (diff) |
Apply clang-format to all C++ files
Diffstat (limited to 'src/components/settings')
-rw-r--r-- | src/components/settings/Settings.cpp | 6 | ||||
-rw-r--r-- | src/components/settings/Settings.h | 27 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/components/settings/Settings.cpp b/src/components/settings/Settings.cpp index fee62daf..1ae00a2d 100644 --- a/src/components/settings/Settings.cpp +++ b/src/components/settings/Settings.cpp @@ -26,12 +26,12 @@ void Settings::LoadSettingsFromFile() { SettingsData bufferSettings; lfs_file_t settingsFile; - if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDONLY) != LFS_ERR_OK) { + if (fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_RDONLY) != LFS_ERR_OK) { return; } fs.FileRead(&settingsFile, reinterpret_cast<uint8_t*>(&bufferSettings), sizeof(settings)); fs.FileClose(&settingsFile); - if ( bufferSettings.version == settingsVersion ) { + if (bufferSettings.version == settingsVersion) { settings = bufferSettings; } } @@ -39,7 +39,7 @@ void Settings::LoadSettingsFromFile() { void Settings::SaveSettingsToFile() { lfs_file_t settingsFile; - if ( fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_WRONLY | LFS_O_CREAT) != LFS_ERR_OK) { + if (fs.FileOpen(&settingsFile, "/settings.dat", LFS_O_WRONLY | LFS_O_CREAT) != LFS_ERR_OK) { return; } fs.FileWrite(&settingsFile, reinterpret_cast<uint8_t*>(&settings), sizeof(settings)); diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 44a1a85c..3b113ead 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -140,15 +140,14 @@ namespace Pinetime { return settings.screenTimeOut; }; - void SetShakeThreshold(uint16_t thresh){ - if(settings.shakeWakeThreshold != thresh){ - settings.shakeWakeThreshold = thresh; - settingsChanged = true; + void SetShakeThreshold(uint16_t thresh) { + if (settings.shakeWakeThreshold != thresh) { + settings.shakeWakeThreshold = thresh; + settingsChanged = true; } - } - int16_t GetShakeThreshold() const{ + int16_t GetShakeThreshold() const { return settings.shakeWakeThreshold; } @@ -195,20 +194,20 @@ namespace Pinetime { if (goal != settings.stepsGoal) { settingsChanged = true; } - settings.stepsGoal = goal; + settings.stepsGoal = goal; }; - + uint32_t GetStepsGoal() const { return settings.stepsGoal; }; - void SetBleRadioEnabled(bool enabled) { - bleRadioEnabled = enabled; - }; + void SetBleRadioEnabled(bool enabled) { + bleRadioEnabled = enabled; + }; - bool GetBleRadioEnabled() const { - return bleRadioEnabled; - }; + bool GetBleRadioEnabled() const { + return bleRadioEnabled; + }; private: Pinetime::Controllers::FS& fs; |