Skip to content

Commit

Permalink
refactor: fix formatting (tabs to spaces)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaffeinatedKat committed Oct 12, 2023
1 parent 34c096d commit 311da95
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions src/components/settings/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ namespace Pinetime {
if (status != settings.notificationStatus) {
settingsChanged = true;
}
// Disable always on screen while sleep mode is enabled
if (settings.alwaysOnDisplay.enabled) {
if (status == Notification::Sleep) {
settings.alwaysOnDisplay.state = false;
} else {
// Disable always on screen while sleep mode is enabled
if (settings.alwaysOnDisplay.enabled) {
if (status == Notification::Sleep) {
settings.alwaysOnDisplay.state = false;
} else {
settings.alwaysOnDisplay.state = true;
}
}
}
}
settings.notificationStatus = status;
};

Expand Down Expand Up @@ -225,10 +225,10 @@ namespace Pinetime {
if (state != settings.alwaysOnDisplay.enabled) {
settingsChanged = true;
}
settings.alwaysOnDisplay.enabled = state;
// the always on state and enabled flags should always match
// if the setting is being modified by the user
SetAlwaysOnDisplay(state);
settings.alwaysOnDisplay.enabled = state;
// the always on state and enabled flags should always match
// if the setting is being modified by the user
SetAlwaysOnDisplay(state);
}

bool GetAlwaysOnDisplaySetting() const {
Expand Down Expand Up @@ -312,16 +312,16 @@ namespace Pinetime {
// To enable disabling it durring notificationsleep, differenciate between
// the setting being on, and the setting being set by the user
struct alwaysOnDisplayData {
bool enabled = false;
bool state = false;
bool enabled = false;
bool state = false;
};

struct SettingsData {
uint32_t version = settingsVersion;
uint32_t stepsGoal = 10000;
uint32_t screenTimeOut = 15000;

alwaysOnDisplayData alwaysOnDisplay;
alwaysOnDisplayData alwaysOnDisplay;

ClockType clockType = ClockType::H24;
Notification notificationStatus = Notification::On;
Expand Down
16 changes: 8 additions & 8 deletions src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ void DisplayApp::Refresh() {
if (!currentScreen->IsRunning()) {
LoadPreviousScreen();
}
int lvglWaitTime = lv_task_handler();
// while in always on mode, throttle LVGL events to 4Hz
int lvglWaitTime = lv_task_handler();
// while in always on mode, throttle LVGL events to 4Hz
queueTimeout = std::max(lvglWaitTime, 250);
} else {
queueTimeout = portMAX_DELAY;
Expand Down Expand Up @@ -234,13 +234,13 @@ void DisplayApp::Refresh() {
brightnessController.Lower();
vTaskDelay(100);
}
// Don't actually turn off the display for AlwaysOn mode
if (!settingsController.GetAlwaysOnDisplay()) {
brightnessController.Set(Controllers::BrightnessController::Levels::Off);
// Don't actually turn off the display for AlwaysOn mode
if (settingsController.GetAlwaysOnDisplay()) {
brightnessController.Set(Controllers::BrightnessController::Levels::Lowest);
} else {
brightnessController.Set(Controllers::BrightnessController::Levels::Off);
lcd.Sleep();
} else {
brightnessController.Set(Controllers::BrightnessController::Levels::Lowest);
}
}
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
state = States::Idle;
break;
Expand Down
14 changes: 7 additions & 7 deletions src/systemtask/SystemTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ void SystemTask::Work() {
doNotGoToSleep = true;
break;
case Messages::GoToRunning:
// spi doesn't go to sleep for always on mode
if (!settingsController.GetAlwaysOnDisplay()) {
// spi doesn't go to sleep for always on mode
if (!settingsController.GetAlwaysOnDisplay()) {
spi.Wakeup();
}
}

// Double Tap needs the touch screen to be in normal mode
if (!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) {
Expand Down Expand Up @@ -324,11 +324,11 @@ void SystemTask::Work() {
spiNorFlash.Sleep();
}

// If the spi goes to sleep, AlwaysOn will not update the screen while dim, and the screen colors invert
// upon wakeup
if (!settingsController.GetAlwaysOnDisplay()) {
// If the spi goes to sleep, AlwaysOn will not update the screen while dim, and the screen colors invert
// upon wakeup
if (!settingsController.GetAlwaysOnDisplay()) {
spi.Sleep();
}
}

// Double Tap needs the touch screen to be in normal mode
if (!settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::DoubleTap)) {
Expand Down

0 comments on commit 311da95

Please sign in to comment.