Skip to content

Commit

Permalink
Fix stand mode overriding any low power mode
Browse files Browse the repository at this point in the history
Don't take action if current power mode is lower than idle stand mode.
(Avoid SLEEP->STANDBY transition)
  • Loading branch information
David authored and David committed Mar 18, 2024
1 parent d7518ee commit 7d76287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core/Src/iron.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void handleIron(void) {
Iron.updateStandMode=no_update;
}
else{
if ( (Iron.changeMode < mode_run && (CurrentTime-Iron.LastModeChangeTime) > (!getProfileSettings()->standDelay ? 100 : (uint32_t)1000*getProfileSettings()->standDelay )) || // Low power mode mode, apply delay from settings, or debouncing if set to 0.
(Iron.changeMode >= mode_run && (CurrentTime-Iron.LastModeChangeTime) > 100) ){ // Run/boost mode, just do some debouncing.
if ( ((Iron.changeMode < mode_run) && (Iron.changeMode<Iron.CurrentMode) && (CurrentTime-Iron.LastModeChangeTime) > (!getProfileSettings()->standDelay ? 100 : (uint32_t)1000*getProfileSettings()->standDelay )) || // Low power mode mode, apply delay from settings, or debouncing if set to 0. Avoid setting higher low power mode than current.
((Iron.changeMode >= mode_run) && (CurrentTime-Iron.LastModeChangeTime) > 100) ){ // Run/boost mode, just do some debouncing.

Iron.updateStandMode=no_update;
setCurrentMode(Iron.changeMode);
Expand Down

0 comments on commit 7d76287

Please sign in to comment.