From c0ba6eb30d1acfd9ad44920ee61b7f4cfdeb71e0 Mon Sep 17 00:00:00 2001 From: neon12345 <784389+neon12345@users.noreply.github.com> Date: Thu, 1 Aug 2024 05:29:53 +0200 Subject: Update Soldering.cpp revert last commit --- source/Core/Threads/UI/logic/Soldering.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/source/Core/Threads/UI/logic/Soldering.cpp b/source/Core/Threads/UI/logic/Soldering.cpp index 27dbc899..93be8841 100644 --- a/source/Core/Threads/UI/logic/Soldering.cpp +++ b/source/Core/Threads/UI/logic/Soldering.cpp @@ -7,7 +7,7 @@ // State 3 = buzzer timer OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) { - if (cxt->scratch_state.state1 & (2|3)) { + if (cxt->scratch_state.state1 >= 2) { // Buttons are currently locked switch (buttons) { case BUTTON_F_LONG: @@ -16,21 +16,17 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) } break; case BUTTON_BOTH_LONG: - if ((cxt->scratch_state.state1 & (2|3)) == 3) { + if (cxt->scratch_state.state1 == 3) { // Unlocking if (warnUser(translatedString(Tr->UnlockingKeysString), buttons)) { - // cxt->scratch_state.state1 &= ~3; - // cxt->scratch_state.state1 |= 1; - cxt->scratch_state.state1 &= ~2; + cxt->scratch_state.state1 = 1; } } else { warnUser(translatedString(Tr->WarningKeysLockedString), buttons); } break; case BUTTON_NONE: - //cxt->scratch_state.state1 &= ~2; - //cxt->scratch_state.state1 |= 3; - cxt->scratch_state.state1 |= 3; + cxt->scratch_state.state1 = 3; break; default: // Do nothing and display a lock warning warnUser(translatedString(Tr->WarningKeysLockedString), buttons); @@ -42,7 +38,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) switch (buttons) { case BUTTON_NONE: cxt->scratch_state.state2 = 0; - cxt->scratch_state.state1 &= ~1; + cxt->scratch_state.state1 = 0; break; case BUTTON_BOTH: /*Fall through*/ @@ -62,9 +58,9 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) case BUTTON_BOTH_LONG: if (getSettingValue(SettingsOptions::LockingMode)) { // Lock buttons - if ((cxt->scratch_state.state1 & 1) == 0) { + if (cxt->scratch_state.state1 == 0) { if (warnUser(translatedString(Tr->LockingKeysString), buttons)) { - cxt->scratch_state.state1 |= 2; + cxt->scratch_state.state1 = 2; } } else { // FIXME should be WarningKeysUnlockedString -- cgit v1.2.3