New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize keyscanner for 'avr' native keyboards #473
Conversation
Signed-off-by: Jesse Vincent <jesse@keyboard.io>
Signed-off-by: Jesse Vincent <jesse@keyboard.io>
This reverts commit 91b7c0c. Signed-off-by: Jesse Vincent <jesse@keyboard.io>
what we 'really' want per switch manufacturers Signed-off-by: Jesse Vincent <jesse@keyboard.io>
not just when the timer triggers Signed-off-by: Jesse Vincent <jesse@keyboard.io>
reading. (This eliminates a "chatter" causing bug Signed-off-by: Jesse Vincent <jesse@keyboard.io>
e955af2
to
d193d7b
Compare
Otherwise, for example, Pin F0 may not be read on the Planck Signed-off-by: Jesse Vincent <jesse@keyboard.io>
Based on the change made to `ATMegaKeyboard`, apply the same treatment to the `ErgoDoxScanner` too, and run debouncing only 3 times per 5ms, which is closer to what switch manufacturers recommend. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Set the previous key state when reporting the state to Kaleidoscope, instead of on every read. This eliminates a possible chatter bug. Idea taken from a similar change made to `ATMegaKeyboard`. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Instead of only reporting the state when the timer triggers, report it every loop, even if it is unchanged. This is based on a similar change to `ATMegaKeyboard`. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Based on a similar change to `ATMegaKeyboard`. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Loving it. Code size is bigger (by about 800 bytes), but cycle times went from 0.64ms to 0.16ms. That alone is worth the extra size in my book, especially when paired with a serious bug fixed. I pushed a few ErgoDox changes that apply similar fixes & optimizations there. The speedup in that case isn't that big (yet): from 2.2ms to 1.6ms using my own sketch, at the cost of ~800 bytes of PROGMEM. There's room to improve in the ErgoDox case, I think, but this is already nice enough. |
@algernon - Please have a look at this branch. I believe it's significantly faster than your handrolled atreus keyscanner. (And fixes a serious bug that was masked by having a really slow scanner ;)