perf(matrix): idle-scan when no key is pressed or debouncing - #1048
Conversation
The polling matrix drivers scan at full rate even with nothing held, which keeps the CPU busy (and awake) between keystrokes. Track whether a pass saw any held or debouncing key, and sleep for `matrix_idle_scan_ms` when it did not. A held or bouncing key keeps the scan at its active rate, so releases and chord changes still land immediately.
|
I don't think this is needed? For wireless keyboards, |
Size Report
|
|
My ⌨️ isn't wireless, and I think there is a benefit to not having a small ARM CPU spin cycles continuously (even if it's just for power or wear-and-tear). ZMK also ships with this option+setting: https://github.com/zmkfirmware/zmk/blob/main/docs/docs/config/kscan.md whilst, interestingly, there is a request for QMK to add this: qmk/qmk_firmware#23209 . Beyond that, I don't think there's a perceptible difference between always-on and 10ms. |
|
For power or wear-and-tear, you can also enable |
|
Just tried re-enabling async matrix on my ZSA Voyager and I remembered why I abandoned this months ago: it only has an MCU on the left hand side so, whilst that half can be made async - the right still has to run in sync mode/full power. This branch probably makes more sense for keyboards in a hardware configuration like this. |
This branch adds
matrix_idle_scan_mswhich matrix scans will sleep for between key presses, instead of busy-polling continuously.A held or bouncing key keeps the scan at its active rate, so releases and chord changes still land immediately.