mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Ignore button jitters in bootloader mode
This commit is contained in:
parent
6f49cc0224
commit
00686a91d0
2 changed files with 10 additions and 2 deletions
|
@ -252,10 +252,17 @@ static void flash_mode(void) {
|
|||
}
|
||||
}
|
||||
|
||||
if (g_common_area.flags.button_pressed && BUTTON_PRESS() == false) {
|
||||
bool button_state = BUTTON_PRESS();
|
||||
// ~10ms, prevent jitter
|
||||
delay_loop(3333);
|
||||
if (button_state != BUTTON_PRESS()) {
|
||||
// in jitter state, ignore
|
||||
continue;
|
||||
}
|
||||
if (g_common_area.flags.button_pressed && button_state == false) {
|
||||
g_common_area.flags.button_pressed = 0;
|
||||
}
|
||||
if (!g_common_area.flags.button_pressed && BUTTON_PRESS()) {
|
||||
if (!g_common_area.flags.button_pressed && button_state) {
|
||||
/* Perform a reset to leave flash mode */
|
||||
g_common_area.flags.button_pressed = 1;
|
||||
usb_disable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue