Skip to content

Commit d83e15f

Browse files
committed
feat: allow unlocking controls via button press when locked
1 parent 8762784 commit d83e15f

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/Button.cpp‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ void Button_Cyclic() {
231231
Port_Cyclic();
232232
#endif
233233

234-
if (System_AreControlsLocked()) {
235-
return;
236-
}
237-
238234
Button_ReadAllStates();
239235

240236
for (uint8_t i = 0; i < sizeof(gButtons) / sizeof(gButtons[0]); i++) {

‎src/Cmd.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ static void Cmd_HandleSleepAction(bool enable, const char *enLogMsg, const char
3232
}
3333

3434
void Cmd_Action(const uint16_t mod) {
35+
if (System_AreControlsLocked() && (mod != CMD_LOCK_BUTTONS_MOD)) {
36+
return;
37+
}
3538
switch (mod) {
3639
case CMD_LOCK_BUTTONS_MOD: { // Locks/unlocks all buttons
3740
System_ToggleLockControls();

0 commit comments

Comments
 (0)