aboutsummaryrefslogtreecommitdiffhomepage
path: root/source/Core/Threads
diff options
context:
space:
mode:
authorneon12345 <[email protected]>2024-08-01 05:00:26 +0200
committerGitHub <[email protected]>2024-08-01 05:00:26 +0200
commit34db06ab9ce67dd77867f6fd9a3b04ce48e0a35b (patch)
tree5e80b439e72ab21b12974c4fd630e24c8e989ed7 /source/Core/Threads
parent2bce5b710e181a46bdcb49a7fa5d9023f9e0a81f (diff)
downloadIronOS-34db06ab9ce67dd77867f6fd9a3b04ce48e0a35b.tar.gz
IronOS-34db06ab9ce67dd77867f6fd9a3b04ce48e0a35b.zip
Update Soldering.cpp
allow to use remaining state1 for timer
Diffstat (limited to 'source/Core/Threads')
-rw-r--r--source/Core/Threads/UI/logic/Soldering.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/Core/Threads/UI/logic/Soldering.cpp b/source/Core/Threads/UI/logic/Soldering.cpp
index 93be8841..27dbc899 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) {
+ if (cxt->scratch_state.state1 & (2|3)) {
// Buttons are currently locked
switch (buttons) {
case BUTTON_F_LONG:
@@ -16,17 +16,21 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
}
break;
case BUTTON_BOTH_LONG:
- if (cxt->scratch_state.state1 == 3) {
+ if ((cxt->scratch_state.state1 & (2|3)) == 3) {
// Unlocking
if (warnUser(translatedString(Tr->UnlockingKeysString), buttons)) {
- cxt->scratch_state.state1 = 1;
+ // cxt->scratch_state.state1 &= ~3;
+ // cxt->scratch_state.state1 |= 1;
+ cxt->scratch_state.state1 &= ~2;
}
} else {
warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
}
break;
case BUTTON_NONE:
- cxt->scratch_state.state1 = 3;
+ //cxt->scratch_state.state1 &= ~2;
+ //cxt->scratch_state.state1 |= 3;
+ cxt->scratch_state.state1 |= 3;
break;
default: // Do nothing and display a lock warning
warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
@@ -38,7 +42,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
switch (buttons) {
case BUTTON_NONE:
cxt->scratch_state.state2 = 0;
- cxt->scratch_state.state1 = 0;
+ cxt->scratch_state.state1 &= ~1;
break;
case BUTTON_BOTH:
/*Fall through*/
@@ -58,9 +62,9 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
case BUTTON_BOTH_LONG:
if (getSettingValue(SettingsOptions::LockingMode)) {
// Lock buttons
- if (cxt->scratch_state.state1 == 0) {
+ if ((cxt->scratch_state.state1 & 1) == 0) {
if (warnUser(translatedString(Tr->LockingKeysString), buttons)) {
- cxt->scratch_state.state1 = 2;
+ cxt->scratch_state.state1 |= 2;
}
} else {
// FIXME should be WarningKeysUnlockedString