diff options
author | neon12345 <[email protected]> | 2024-08-01 05:41:07 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-08-01 05:41:07 +0200 |
commit | ae55d5c3de4a7503d700f4e53f5072f42ce7547d (patch) | |
tree | 6c2d4fccd2fe7ad5485c8cbc267487171010e74f /source | |
parent | c0ba6eb30d1acfd9ad44920ee61b7f4cfdeb71e0 (diff) | |
download | IronOS-ae55d5c3de4a7503d700f4e53f5072f42ce7547d.tar.gz IronOS-ae55d5c3de4a7503d700f4e53f5072f42ce7547d.zip |
Update Soldering.cpp
show the locked warning for half a second
Diffstat (limited to 'source')
-rw-r--r-- | source/Core/Threads/UI/logic/Soldering.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/source/Core/Threads/UI/logic/Soldering.cpp b/source/Core/Threads/UI/logic/Soldering.cpp index 93be8841..35875471 100644 --- a/source/Core/Threads/UI/logic/Soldering.cpp +++ b/source/Core/Threads/UI/logic/Soldering.cpp @@ -9,12 +9,16 @@ 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; + if (cxt->scratch_state.state1 > 3) { + // show locked until timer is up + if ((cxt->scratch_state.state1 >> 2) < xTaskGetTickCount()) { + cxt->scratch_state.state1 &= 3; + } else { + warnUser(translatedString(Tr->WarningKeysLockedString), buttons); + return OperatingMode::Soldering; } - break; + } + switch (buttons) { case BUTTON_BOTH_LONG: if (cxt->scratch_state.state1 == 3) { // Unlocking @@ -28,7 +32,14 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) 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.state1 |= (xTaskGetTickCount() + TICKS_SECOND / 2) << 2; warnUser(translatedString(Tr->WarningKeysLockedString), buttons); break; } |