aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--source/Core/Threads/UI/logic/OperatingModes.h1
-rw-r--r--source/Core/Threads/UI/logic/Soldering.cpp31
2 files changed, 23 insertions, 9 deletions
diff --git a/source/Core/Threads/UI/logic/OperatingModes.h b/source/Core/Threads/UI/logic/OperatingModes.h
index 5387f64a..a2c08a7d 100644
--- a/source/Core/Threads/UI/logic/OperatingModes.h
+++ b/source/Core/Threads/UI/logic/OperatingModes.h
@@ -62,6 +62,7 @@ struct guiContext {
uint32_t state4; // 32 bit state scratch
uint16_t state5; // 16 bit state scratch
uint16_t state6; // 16 bit state scratch
+ uint32_t state7; // 32 bit state scratch
} scratch_state;
};
diff --git a/source/Core/Threads/UI/logic/Soldering.cpp b/source/Core/Threads/UI/logic/Soldering.cpp
index 93be8841..50508025 100644
--- a/source/Core/Threads/UI/logic/Soldering.cpp
+++ b/source/Core/Threads/UI/logic/Soldering.cpp
@@ -9,26 +9,39 @@
OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) {
if (cxt->scratch_state.state1 >= 2) {
// Buttons are currently locked
- switch (buttons) {
- case BUTTON_F_LONG:
- if (getSettingValue(SettingsOptions::BoostTemp) && (getSettingValue(SettingsOptions::LockingMode) == lockingMode_t::BOOST)) {
- cxt->scratch_state.state2 = 1;
- }
- break;
- case BUTTON_BOTH_LONG:
+ if (buttons == BUTTON_BOTH_LONG) {
if (cxt->scratch_state.state1 == 3) {
// Unlocking
if (warnUser(translatedString(Tr->UnlockingKeysString), buttons)) {
cxt->scratch_state.state1 = 1;
+ cxt->scratch_state.state7 = 0;
}
} else {
+ warnUser(translatedString(Tr->LockingKeysString), buttons);
+ }
+ return OperatingMode::Soldering;
+ }
+ if (cxt->scratch_state.state7 != 0) {
+ // show locked until timer is up
+ if (xTaskGetTickCount() >= cxt->scratch_state.state7) {
+ cxt->scratch_state.state7 = 0;
+ } else {
warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
+ return OperatingMode::Soldering;
}
- break;
+ }
+ switch (buttons) {
case BUTTON_NONE:
cxt->scratch_state.state1 = 3;
break;
- default: // Do nothing and display a lock warning
+ case BUTTON_F_LONG:
+ if (getSettingValue(SettingsOptions::BoostTemp) && (getSettingValue(SettingsOptions::LockingMode) == lockingMode_t::BOOST)) {
+ cxt->scratch_state.state2 = 1;
+ break;
+ }
+ /*Fall through*/
+ default: // Set timer for and display a lock warning
+ cxt->scratch_state.state7 = xTaskGetTickCount() + TICKS_SECOND;
warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
break;
}