aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorneon12345 <[email protected]>2024-08-06 13:54:33 +0200
committerGitHub <[email protected]>2024-08-06 13:54:33 +0200
commitdfbf45a1c480abe30847be3fb0915d360707943d (patch)
tree5e06a8252bf7bcfcd1fe7b888792b9bc41e2e187
parentcae14dee6ae309b9a3e971aa6497f68874780732 (diff)
downloadIronOS-dfbf45a1c480abe30847be3fb0915d360707943d.tar.gz
IronOS-dfbf45a1c480abe30847be3fb0915d360707943d.zip
Update Soldering.cpp
fix timed locked warning based on review comments with additional state7 field.
-rw-r--r--source/Core/Threads/UI/logic/Soldering.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/Core/Threads/UI/logic/Soldering.cpp b/source/Core/Threads/UI/logic/Soldering.cpp
index 53d44d1c..35a7398a 100644
--- a/source/Core/Threads/UI/logic/Soldering.cpp
+++ b/source/Core/Threads/UI/logic/Soldering.cpp
@@ -9,10 +9,10 @@
OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt) {
if (cxt->scratch_state.state1 >= 2) {
// Buttons are currently locked
- if (cxt->scratch_state.state1 > 3) {
+ if (cxt->scratch_state.state7 != 0) {
// show locked until timer is up
- if ((uint16_t)(xTaskGetTickCount() << 2) - (cxt->scratch_state.state1 & ~3) > TICKS_SECOND << 2) {
- cxt->scratch_state.state1 &= 3;
+ if (xTaskGetTickCount() >= cxt->scratch_state.state7) {
+ cxt->scratch_state.state7 = 0;
} else {
warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
return OperatingMode::Soldering;
@@ -26,7 +26,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
cxt->scratch_state.state1 = 1;
}
} else {
- vTaskDelay(TICKS_SECOND);
+ warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
}
break;
case BUTTON_NONE:
@@ -39,7 +39,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
}
/*Fall through*/
default: // Set timer for and display a lock warning
- cxt->scratch_state.state1 |= (xTaskGetTickCount() + TICKS_SECOND) << 2;
+ cxt->scratch_state.state7 = xTaskGetTickCount() + TICKS_SECOND;
warnUser(translatedString(Tr->WarningKeysLockedString), buttons);
break;
}
@@ -76,7 +76,6 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
} else {
// FIXME should be WarningKeysUnlockedString
warnUser(translatedString(Tr->UnlockingKeysString), buttons);
- vTaskDelay(TICKS_SECOND);
}
}
break;