summaryrefslogtreecommitdiff
path: root/src/components/settings
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2022-02-20 15:41:06 +0100
committerJean-François Milants <jf@codingfield.com>2022-02-20 15:41:06 +0100
commit0e2b27d7926035f63790851db5c00af431b2eb07 (patch)
treea10a4068c592f13057edf3d1f2a94137becd95b8 /src/components/settings
parent69e4ab6be101e7993035b56db75f5c32eda713ac (diff)
parentef44b763d94cc6ff1be6f75ff3e638d7d356e99e (diff)
Merge branch 'evergreen22-airplane-mode' into develop
Diffstat (limited to 'src/components/settings')
-rw-r--r--src/components/settings/Settings.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h
index 8d20f067..24a82607 100644
--- a/src/components/settings/Settings.h
+++ b/src/components/settings/Settings.h
@@ -18,7 +18,23 @@ namespace Pinetime {
Shake = 3,
};
enum class Colors : uint8_t {
- White, Silver, Gray, Black, Red, Maroon, Yellow, Olive, Lime, Green, Cyan, Teal, Blue, Navy, Magenta, Purple, Orange
+ White,
+ Silver,
+ Gray,
+ Black,
+ Red,
+ Maroon,
+ Yellow,
+ Olive,
+ Lime,
+ Green,
+ Cyan,
+ Teal,
+ Blue,
+ Navy,
+ Magenta,
+ Purple,
+ Orange
};
struct PineTimeStyle {
Colors ColorTime = Colors::Teal;
@@ -170,18 +186,29 @@ namespace Pinetime {
}
settings.brightLevel = level;
};
+
Controllers::BrightnessController::Levels GetBrightness() const {
return settings.brightLevel;
};
- void SetStepsGoal( uint32_t goal ) {
- if ( goal != settings.stepsGoal ) {
+ void SetStepsGoal(uint32_t goal) {
+ if (goal != settings.stepsGoal) {
settingsChanged = true;
}
settings.stepsGoal = goal;
};
- uint32_t GetStepsGoal() const { return settings.stepsGoal; };
+ uint32_t GetStepsGoal() const {
+ return settings.stepsGoal;
+ };
+
+ void SetBleRadioEnabled(bool enabled) {
+ bleRadioEnabled = enabled;
+ };
+
+ bool GetBleRadioEnabled() const {
+ return bleRadioEnabled;
+ };
private:
Pinetime::Controllers::FS& fs;
@@ -210,6 +237,10 @@ namespace Pinetime {
uint8_t appMenu = 0;
uint8_t settingsMenu = 0;
+ /* airplaneMode is intentionally not saved with the other watch settings and initialized
+ * to off (false) on every boot because we always want ble to be enabled on startup
+ */
+ bool bleRadioEnabled = true;
void LoadSettingsFromFile();
void SaveSettingsToFile();