Skip to content

Commit

Permalink
HF_AVEFUL: allow to exit mode with long press
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Oct 5, 2020
1 parent 7b599c7 commit 6540b45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion armsrc/Standalone/hf_aveful.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ void RunMod(void) {
int state = STATE_SEARCH;

DbpString("Scanning...");
int button_pressed = BUTTON_NO_CLICK;
for (;;) {
// Was our button held down or pressed?
int button_pressed = BUTTON_HELD(1000);
button_pressed = BUTTON_HELD(1000);

if (button_pressed != BUTTON_NO_CLICK || data_available())
break;
Expand Down Expand Up @@ -248,6 +249,8 @@ void RunMod(void) {
state = STATE_SEARCH;
}
}
if (button_pressed == BUTTON_HOLD) //Holding down the button
break;
}

DbpString("exiting");
Expand Down

0 comments on commit 6540b45

Please sign in to comment.