button.py: shorter long press duration for bootloader mode

This commit is contained in:
Thomas Farstrike
2025-05-13 14:14:01 +02:00
parent e53b501c9f
commit 7c650a3710
+2 -1
View File
@@ -8,7 +8,7 @@ import _thread
button = Pin(0, Pin.IN, Pin.PULL_UP)
# Variables for long press detection
long_press_duration = 4000
long_press_duration = 3000
press_start_time = 0
is_pressed = False
@@ -30,6 +30,7 @@ def handle_long_press():
machine.bootloader()
def on_long_press(t): # Callback for when long press duration is reached.
print("button.py: long press detected")
global timer
timer.deinit() # Stop the timer
global is_pressed