Skip to content

Commit 37f205e

Browse files
authored
Use table for debounce algorithm description (qmk#20322)
1 parent 26e0bfd commit 37f205e

File tree

1 file changed

+24
-32
lines changed

1 file changed

+24
-32
lines changed

docs/feature_debounce_type.md

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -89,46 +89,38 @@ susceptible to noise, you must choose a debounce method that will also mitigate
8989
* Per-key and per-row algorithms consume more resources (in terms of performance,
9090
and ram usage), but fast typists might prefer them over global.
9191

92-
## Debounce algorithms supported by QMK
92+
## Supported Debounce Algorithms
9393

9494
QMK supports multiple debounce algorithms through its debounce API.
9595

9696
### Debounce selection
9797

98-
| DEBOUNCE_TYPE | Description | What else is needed |
99-
| ------------- | --------------------------------------------------- | ----------------------------- |
100-
| Not defined | Use the default algorithm, currently sym_defer_g | Nothing |
101-
| custom | Use your own debounce code | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions |
102-
| Anything Else | Use another algorithm from quantum/debounce/* | Nothing |
103-
104-
**Regarding split keyboards**:
105-
The debounce code is compatible with split keyboards.
106-
107-
### Selecting an included debouncing method
108-
Keyboards may select one of the already implemented debounce methods, by adding to ```rules.mk``` the following line:
98+
Keyboards may select one of the core debounce methods by adding the following line into ```rules.mk```:
10999
```
110100
DEBOUNCE_TYPE = <name of algorithm>
111101
```
112-
Where name of algorithm is one of:
113-
* ```sym_defer_g``` - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE``` milliseconds of no changes has occurred, all input changes are pushed.
114-
* This is the current default algorithm. This is the highest performance algorithm with lowest memory usage, and it's also noise-resistant.
115-
* ```sym_eager_pr``` - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE``` milliseconds of no further input for that row.
116-
For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be
117-
appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use.
118-
* ```sym_eager_pk``` - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key
119-
* ```sym_defer_pr``` - debouncing per row. On any state change, a per-row timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that row, the entire row is pushed. Can improve responsiveness over `sym_defer_g` while being less susceptible than per-key debouncers to noise.
120-
* ```sym_defer_pk``` - debouncing per key. On any state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key status change is pushed.
121-
* ```asym_eager_defer_pk``` - debouncing per key. On a key-down state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key. On a key-up state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key-up status change is pushed.
122-
123-
### A couple algorithms that could be implemented in the future:
124-
* ```sym_defer_pr```
125-
* ```sym_eager_g```
126-
127-
### Use your own debouncing code
128-
You have the option to implement you own debouncing algorithm. To do this:
102+
Name of algorithm is one of:
103+
104+
| Algorithm | Description |
105+
| ------------------------- | ----------- |
106+
| ```sym_defer_g``` | Debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE``` milliseconds of no changes has occurred, all input changes are pushed. This is the highest performance algorithm with lowest memory usage and is noise-resistant. |
107+
| ```sym_defer_pr``` | Debouncing per row. On any state change, a per-row timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that row, the entire row is pushed. This can improve responsiveness over `sym_defer_g` while being less susceptible to noise than per-key algorithm. |
108+
| ```sym_defer_pk``` | Debouncing per key. On any state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key status change is pushed. |
109+
| ```sym_eager_pr``` | Debouncing per row. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that row. |
110+
| ```sym_eager_pk``` | Debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key. |
111+
| ```asym_eager_defer_pk``` | Debouncing per key. On a key-down state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key. On a key-up state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key-up status change is pushed. |
112+
113+
?> ```sym_defer_g``` is the default if ```DEBOUNCE_TYPE``` is undefined
114+
115+
?> ```sym_eager_pr``` is suitable for use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive or has low scan rate while fingers usually hit one row at a time. This could be appropriate for the ErgoDox models where the matrix is rotated 90°. Hence its "rows" are really columns and each finger only hits a single "row" at a time with normal usage.
116+
117+
### Implementing your own debouncing code
118+
119+
You have the option to implement you own debouncing algorithm with the following steps:
120+
129121
* Set ```DEBOUNCE_TYPE = custom``` in ```rules.mk```.
130122
* Add ```SRC += debounce.c``` in ```rules.mk```
131-
* Add your own ```debounce.c```. Look at current implementations in ```quantum/debounce``` for examples.
123+
* Implement your own ```debounce.c```. See ```quantum/debounce``` for examples.
132124
* Debouncing occurs after every raw matrix scan.
133-
* Use num_rows rather than MATRIX_ROWS, so that split keyboards are supported correctly.
134-
* If the algorithm might be applicable to other keyboards, please consider adding it to ```quantum/debounce```
125+
* Use num_rows instead of MATRIX_ROWS to support split keyboards correctly.
126+
* If your custom algorithm is applicable to other keyboards, please consider making a pull request.

0 commit comments

Comments
 (0)