-
-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Allow 30us matrix delay to be keyboard/user overridable #8216
Conversation
Nice feature, it will speed up scan rate significantly. It might be a better idea to set how many nops, rather than how many microseconds? I think looking up our set of devices (atmega32u4, cortex armv3 etc etc) to see if pin settling time is defined in microseconds vs nops might be desirable. Finally, since i believe this figure is inherently tied to which microprocessor we are using, it could be defined by default per microprocessor and then this override could still be used (still up for discussion on whether it be defined in nops or microseconds). |
I would rather avoid nops where possible, as some STM32 boards require the wait for yielding (so that the USB thread gets runtime). An alternative implementation is in 18c948a, where it would allow the replacement of the delay logic at the expense of a function call. |
What about an "inline" function call? I remember that it isn't exactly guaranteed because it's just a suggestion to the compiler... Especially since two nops is significantly faster than a function call. |
inline cant be weak, so thats a non starter, it would have to be a define which you redef. We are talking tiny amounts of time here. Given the current 30us wait, i doubt will make a measurable difference. |
Right, going from 30us to 1us will make the biggest difference. Qmk is always going to be battle between open apis and power users who want specific functionality at no additional cost to Rom size / speed. I think an overrideable function is better than just using pure us and is the most flexible option. Do you know how long a function call takes, and how long 2 nops is compared to 1us? If we know that (a function call + 2nop ) > 1us we might as well make the API only support us increments. Edit: at 16mhz, two nops takes 1.2~ microsceconds. So seems like we can use pure us to define all waits? |
I'll have a look at speed testing this vs my scanning code, and ideally bringing back xealous-brown to a simpler default implementation :D |
* upstream/master: (330 commits) Add Danish keymap and sendstring LUT (qmk#8218) format code according to conventions [skip ci] uart.c fix from TMK (qmk#7628) S75 Encoder Fixes (qmk#7758) Add Turkish keymap aliases and sendstring LUT (qmk#7676) Add Arm Teensys to mcu_selection.mk (qmk#8026) [New keyboard]silverbullet44 (qmk#7950) Allow 30us matrix delay to be keyboard/user overridable (qmk#8216) Merge /prime_l and /prime_l_v2 (qmk#8194) [Keymap] Keymap for XD75 with 7U spacebar EN-RU gamers (qmk#8184) Add VIA support for kbd8x mk2 (qmk#8168) Move Grave/Tilde and some lesser used keys on my ergo boards (qmk#8200) [Keyboard] KC60SE cleanup (qmk#8171) Made windows driver installation accept y as All to allow CI (qmk#8189) Change the image photo of /keyboards/reviung41/readme.md (qmk#8195) MxSS RGB Handler Touchup (qmk#8105) Centromere Configurator layout support and readme update (qmk#8190) dynamic keymap sanity check (qmk#8181) [keyboard] Austin (qmk#8176) Use pathlib everywhere we can (qmk#7872) ...
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
* 'master' of https://github.com/nesth/qmk_firmware: (331 commits) helix like crkbd Add Danish keymap and sendstring LUT (qmk#8218) format code according to conventions [skip ci] uart.c fix from TMK (qmk#7628) S75 Encoder Fixes (qmk#7758) Add Turkish keymap aliases and sendstring LUT (qmk#7676) Add Arm Teensys to mcu_selection.mk (qmk#8026) [New keyboard]silverbullet44 (qmk#7950) Allow 30us matrix delay to be keyboard/user overridable (qmk#8216) Merge /prime_l and /prime_l_v2 (qmk#8194) [Keymap] Keymap for XD75 with 7U spacebar EN-RU gamers (qmk#8184) Add VIA support for kbd8x mk2 (qmk#8168) Move Grave/Tilde and some lesser used keys on my ergo boards (qmk#8200) [Keyboard] KC60SE cleanup (qmk#8171) Made windows driver installation accept y as All to allow CI (qmk#8189) Change the image photo of /keyboards/reviung41/readme.md (qmk#8195) MxSS RGB Handler Touchup (qmk#8105) Centromere Configurator layout support and readme update (qmk#8190) dynamic keymap sanity check (qmk#8181) [keyboard] Austin (qmk#8176) ...
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
* Allow 30us matrix delay to be configurable via define * Move wait logic to matrix_common * Move wait logic to matrix_common - fix wait includes
Description
Hitting some limits when testing the arm uart serial code, this allows the delay while waiting for IO to settle to be configurable.
Ive tested as low as 5us with success.
Types of Changes
Checklist