@@ -64,8 +64,12 @@ void CommonLogic::updateDisplay() {
6464 auto Now = std::chrono::system_clock::now ();
6565 auto Seconds =
6666 std::chrono::duration_cast<std::chrono::seconds>(Now - *ResetTimeOpt);
67- int Remaining = ResetMaxSpeedDuration - Seconds.count ();
68- Disp.printRaw (Remaining);
67+ if (Seconds.count () == 0 ) {
68+ Disp.printTxt (MsgResetDetected);
69+ } else {
70+ int Remaining = ResetMaxSpeedDuration - Seconds.count ();
71+ Disp.printRaw (Remaining);
72+ }
6973 break ;
7074 }
7175 }
@@ -132,15 +136,14 @@ void CommonLogic::resetSenseTick() {
132136 ResetTimeOpt = std::nullopt ;
133137 DC.setKHz (ResetSavedKHz);
134138 DC.setPeriodRaw (ResetSavedPeriod);
135- printTxtAndSleep (MsgResetDetected);
136139 setMode (ResetSavedMode);
137140 }
138141 }
139142 // Button not pressed, skipping.
140- if (ResetSense.get () != ButtonState::Release )
143+ if (ResetSense.get () != ButtonState::Pressed )
141144 return ;
142145 // Nothing to do if already at max freq.
143- if (DC.getKHz () == Presets.getMaxKHz ())
146+ if (DC.getKHz () == Presets.getMaxKHz () && !ResetTimeOpt )
144147 return ;
145148 // If already in booting mode don't save freq/period/mode.
146149 if (getMode () != Mode::Boot) {
@@ -152,7 +155,6 @@ void CommonLogic::resetSenseTick() {
152155 << " SvPeriod=" << ResetSavedPeriod
153156 << " SvMode=" << getModeStr (ResetSavedMode) << " \n " ;)
154157 DC.setMHzToMax ();
155- printTxtAndSleep (MsgResetDetected);
156158 ResetTimeOpt = std::chrono::system_clock::now ();
157159 setMode (Mode::Boot);
158160}
0 commit comments