diff options
| author | alex-ong <the.onga@gmail.com> | 2019-01-27 07:23:15 +1100 |
|---|---|---|
| committer | alex-ong <the.onga@gmail.com> | 2019-01-27 07:23:15 +1100 |
| commit | 7d8c62993921383a35f9cd172fe0a1d2e893b2f3 (patch) | |
| tree | 9d62d3bd3f51eec384b46478465a83e62c179b8e | |
| parent | 562c0d702a326488d79963969ef71f2a52664cdc (diff) | |
| download | qmk_firmware-7d8c62993921383a35f9cd172fe0a1d2e893b2f3.tar.gz qmk_firmware-7d8c62993921383a35f9cd172fe0a1d2e893b2f3.zip | |
Stricter, leaner DEBOUNCE_TYPE section in common_features.mk. Cleanup debounce_type.mk
| -rw-r--r-- | common_features.mk | 11 | ||||
| -rw-r--r-- | docs/feature_debounce_type.md (renamed from docs/feature_debounce_algo.md) | 22 |
2 files changed, 18 insertions, 15 deletions
diff --git a/common_features.mk b/common_features.mk index 8e2747d5a..d03dbed09 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -265,14 +265,15 @@ endif | |||
| 265 | 265 | ||
| 266 | DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce | 266 | DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce |
| 267 | # Debounce Modules. If implemented in matrix.c, don't use these. | 267 | # Debounce Modules. If implemented in matrix.c, don't use these. |
| 268 | ifeq ($(strip $(DEBOUNCE_TYPE)), custom) | 268 | DEBOUNCE_TYPE?= sym_g |
| 269 | # Do nothing. do your debouncing in matrix.c | 269 | VALID_DEBOUNCE_TYPES := sym_g eager_pk custom |
| 270 | else ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g) | 270 | ifeq ($(filter $(DEBOUNCE_TYPE),$(VALID_DEBOUNCE_TYPES)),) |
| 271 | $(error DEBOUNCE_TYPE="$(DEBOUNCE_TYPE)" is not a valid debounce algorithm) | ||
| 272 | endif | ||
| 273 | ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g) | ||
| 271 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c | 274 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c |
| 272 | else ifeq ($(strip $(DEBOUNCE_TYPE)), eager_pk) | 275 | else ifeq ($(strip $(DEBOUNCE_TYPE)), eager_pk) |
| 273 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_eager_pk.c | 276 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_eager_pk.c |
| 274 | else # default algorithm. Won't be used if we have a custom_matrix that doesn't utilize it | ||
| 275 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c | ||
| 276 | endif | 277 | endif |
| 277 | 278 | ||
| 278 | 279 | ||
diff --git a/docs/feature_debounce_algo.md b/docs/feature_debounce_type.md index c4ef86fc7..82b3d7de1 100644 --- a/docs/feature_debounce_algo.md +++ b/docs/feature_debounce_type.md | |||
| @@ -7,14 +7,15 @@ The underlying debounce algorithm is determined by which matrix.c file you are u | |||
| 7 | The logic for which debounce method called is below. It checks various defines that you have set in rules.mk | 7 | The logic for which debounce method called is below. It checks various defines that you have set in rules.mk |
| 8 | 8 | ||
| 9 | ``` | 9 | ``` |
| 10 | ifeq ($(strip $(DEBOUNCE_ALGO)), manual) | 10 | DEBOUNCE_TYPE?= sym_g |
| 11 | # Do nothing. do your debouncing in matrix.c | 11 | VALID_DEBOUNCE_TYPES := sym_g eager_pk custom |
| 12 | else ifeq ($(strip $(DEBOUNCE_ALGO)), sym_g) | 12 | ifeq ($(filter $(DEBOUNCE_TYPE),$(VALID_DEBOUNCE_TYPES)),) |
| 13 | QUANTUM_SRC += $(DEBOUNCE)/debounce_sym_g.c | 13 | $(error DEBOUNCE_TYPE="$(DEBOUNCE_TYPE)" is not a valid debounce algorithm) |
| 14 | else ifeq ($(strip $(DEBOUNCE_ALGO)), eager_pk) | 14 | endif |
| 15 | QUANTUM_SRC += $(DEBOUNCE)/debounce_eager_pk.c | 15 | ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g) |
| 16 | else # default algorithm | 16 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c |
| 17 | QUANTUM_SRC += $(DEBOUNCE)/debounce_sym_g.c | 17 | else ifeq ($(strip $(DEBOUNCE_TYPE)), eager_pk) |
| 18 | QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_eager_pk.c | ||
| 18 | endif | 19 | endif |
| 19 | ``` | 20 | ``` |
| 20 | 21 | ||
| @@ -23,17 +24,18 @@ endif | |||
| 23 | | DEBOUNCE_ALGO | Description | What to do | | 24 | | DEBOUNCE_ALGO | Description | What to do | |
| 24 | | ------------- | --------------------------------------------------- | ----------------------------- | | 25 | | ------------- | --------------------------------------------------- | ----------------------------- | |
| 25 | | Not defined | You are using the included matrix.c and debounce.c | Nothing. Debounce_sym_g will be compiled, and used if necessary | | 26 | | Not defined | You are using the included matrix.c and debounce.c | Nothing. Debounce_sym_g will be compiled, and used if necessary | |
| 26 | | manual | Use your own debounce.c | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions | | 27 | | custom | Use your own debounce.c | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions | |
| 27 | | sym_g / eager_pk | You are using the included matrix.c and debounce.c | Use an alternative debounce algorithm | | 28 | | sym_g / eager_pk | You are using the included matrix.c and debounce.c | Use an alternative debounce algorithm | |
| 28 | 29 | ||
| 29 | **Regarding split keyboards**: | 30 | **Regarding split keyboards**: |
| 30 | The debounce code is compatible with split keyboards. | 31 | The debounce code is compatible with split keyboards. |
| 31 | 32 | ||
| 32 | # Use your own debouncing code | 33 | # Use your own debouncing code |
| 33 | * Set ```DEBOUNCE_ALGO = manual```. | 34 | * Set ```DEBOUNCE_TYPE = custom ```. |
| 34 | * Add ```SRC += debounce.c``` | 35 | * Add ```SRC += debounce.c``` |
| 35 | * Add your own ```debounce.c```. Look at included ```debounce_sym_g.c```s for sample implementations. | 36 | * Add your own ```debounce.c```. Look at included ```debounce_sym_g.c```s for sample implementations. |
| 36 | * Debouncing occurs after every raw matrix scan. | 37 | * Debouncing occurs after every raw matrix scan. |
| 38 | * Use num_rows rather than MATRIX_ROWS, so that split keyboards are supported correctly. | ||
| 37 | 39 | ||
| 38 | # Changing between included debouncing methods | 40 | # Changing between included debouncing methods |
| 39 | You can either use your own code, by including your own debounce.c, or switch to another included one. | 41 | You can either use your own code, by including your own debounce.c, or switch to another included one. |
