Skip to content

Commit

Permalink
Update Soldering.cpp
Browse files Browse the repository at this point in the history
show the locked warning for half a second
  • Loading branch information
neon12345 authored Aug 1, 2024
1 parent c0ba6eb commit ae55d5c
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions source/Core/Threads/UI/logic/Soldering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit ae55d5c

Please sign in to comment.