Debounce keys after stable release - #940
Open
rschmitt wants to merge 1 commit into
Open
Conversation
Author
|
I think @dansanderson has done the most recent work on the keyboard, including debounce/repeat issues in particular. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contact bounce can occur when depressing or releasing a key, but the current debounce implementation only handles the former case. The debounce timer begins when a key is pressed, and if a key is held longer than that brief interval, a bounce while releasing the switch would be interpreted as a new key press. This could result in both consecutive (
A->AA) and non-consecutive (AB->ABA) duplicate keystrokes, depending on vagaries of timing.This change:
iomapperandkeyboard_complex, instead of assuming 50 MHz. (This ensures thatkey_debounce_millisecondscorrectly translates to the intended 20ms and not ~25.)asciisimulatetest withdebouncesimulate.The tests cover consecutive and non-consecutive re-strikes, stale automatic-repeat state, and normal key repeat.
Testing
Tested successfully with both consecutive and intervening-key debounce scenarios. Also tested on real MEGA65 hardware with additional debug logging in order to empirically verify the occurrence and specific timings of contact bounce.