Skip to content

Fix for hold-to-save#3252

Merged
BlitzCityDIY merged 2 commits into
adafruit:mainfrom
videopixil:Minecraft_Compass
Jun 24, 2026
Merged

Fix for hold-to-save#3252
BlitzCityDIY merged 2 commits into
adafruit:mainfrom
videopixil:Minecraft_Compass

Conversation

@videopixil

Copy link
Copy Markdown
Contributor

Fix hold-to-save: time the hold from the debounced level, not edge flags

The Button.pressed/released one-shot edge flags intermittently dropped a press, so hold-to-save would fall through and register as a short tap (switching mode instead of saving). poll_button now reads the debounced level (button.value) and detects the press/release edges itself, timing the hold with time.monotonic(). This also survives the ~300-500 ms loop stall from the blocking 1 Hz GPS read, which the library's internal hold timer could not. The debouncer is still used for noise filtering.

Fix hold-to-save: time the hold from the debounced level, not edge flags

The Button.pressed/released one-shot edge flags intermittently dropped a
press, so hold-to-save would fall through and register as a short tap
(switching mode instead of saving). poll_button now reads the debounced
level (button.value) and detects the press/release edges itself, timing
the hold with time.monotonic(). This also survives the ~300-500 ms loop
stall from the blocking 1 Hz GPS read, which the library's internal hold
timer could not. The debouncer is still used for noise filtering.
@videopixil

Copy link
Copy Markdown
Contributor Author

@BlitzCityDIY @TheKitty Pushed a fix for hold-to-save. While demoing I found the button hold had stopped saving waypoints; a quick tap would switch mode, but a long hold also just switched mode instead of opening the name picker.

Comment thread Minecraft_Compass/code.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you revert code.py and mc_config.py? it looks like no code changed, just file mode

@BlitzCityDIY BlitzCityDIY merged commit f7ac1cb into adafruit:main Jun 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants