From cbabc8dbe6a8476d3082e8bc649d330f87e7b904 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Mon, 12 Dec 2022 23:52:22 +0800 Subject: [Core] Replace Tapping Force Hold feature with Quick Tap Term (#17007) * Replace Tapping Force Hold feature with Quick Tap Term * Replace keyboard level TAPPING_FORCE_HOLD with QUICK_TAP_TERM 0 * Deprecate force hold in info_config.json * Before and after quick tap term unit tests * Quick tap unit tests iteration * Keymap config.h correction * Remove TAPPING_FORCE_HOLD_PER_KEY macros that were missed * Add two more test cases for quick tap * Replace TAPPING_FORCE_HOLD with QUICK_TAP_TERM in configs #2 * Replace TAPPING_FORCE_HOLD_PER_KEY with QUICK_TAP_TERM_PER_KEY in configs #2 * Add function declaration for get_quick_tap_term Co-authored-by: Stefan Kerkmann --- keyboards/adm42/rev4/keymaps/default/config.h | 2 +- keyboards/adm42/rev4/keymaps/default/keymap.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/rev4/keymaps/default/config.h b/keyboards/adm42/rev4/keymaps/default/config.h index 38c012e938..4082d84a3a 100644 --- a/keyboards/adm42/rev4/keymaps/default/config.h +++ b/keyboards/adm42/rev4/keymaps/default/config.h @@ -1,3 +1,3 @@ #define HOLD_ON_OTHER_KEY_PRESS_PER_KEY -#define TAPPING_FORCE_HOLD_PER_KEY +#define QUICK_TAP_TERM_PER_KEY #define IGNORE_MOD_TAP_INTERRUPT_PER_KEY diff --git a/keyboards/adm42/rev4/keymaps/default/keymap.c b/keyboards/adm42/rev4/keymaps/default/keymap.c index 109796f7ae..245a3bd4de 100644 --- a/keyboards/adm42/rev4/keymaps/default/keymap.c +++ b/keyboards/adm42/rev4/keymaps/default/keymap.c @@ -114,13 +114,13 @@ bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { } } -bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { +uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case LLS_ESC: case LLS_RALT: - return true; + return 0; default: - return false; + return QUICK_TAP_TERM; } } -- cgit v1.2.3 From 515dd18c2801663bbac0e59f683c2a93e4bd9b1a Mon Sep 17 00:00:00 2001 From: precondition <57645186+precondition@users.noreply.github.com> Date: Tue, 13 Dec 2022 12:20:07 +0100 Subject: Remove IGNORE_MOD_TAP_INTERRUPT_PER_KEY in favour of HOLD_ON_OTHER_KEY_PRESS_PER_KEY (#15741) --- keyboards/adm42/rev4/keymaps/default/config.h | 1 - keyboards/adm42/rev4/keymaps/default/keymap.c | 18 ++++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/rev4/keymaps/default/config.h b/keyboards/adm42/rev4/keymaps/default/config.h index 4082d84a3a..abfaf9af78 100644 --- a/keyboards/adm42/rev4/keymaps/default/config.h +++ b/keyboards/adm42/rev4/keymaps/default/config.h @@ -1,3 +1,2 @@ #define HOLD_ON_OTHER_KEY_PRESS_PER_KEY #define QUICK_TAP_TERM_PER_KEY -#define IGNORE_MOD_TAP_INTERRUPT_PER_KEY diff --git a/keyboards/adm42/rev4/keymaps/default/keymap.c b/keyboards/adm42/rev4/keymaps/default/keymap.c index 245a3bd4de..154073beb7 100644 --- a/keyboards/adm42/rev4/keymaps/default/keymap.c +++ b/keyboards/adm42/rev4/keymaps/default/keymap.c @@ -93,21 +93,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RC_QUT: - return true; - default: +bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { + // Special if-condition outside the switch because `RC_QUT` overlaps with + // the `QK_MOD_TAP ... QK_MOD_TAP_MAX` range. + if (keycode == RC_QUT) { return false; } -} - -bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case LLS_ESC: - case LLS_RALT: - case LLE_ENT: - case LLA_DEL: + case QK_MOD_TAP ... QK_MOD_TAP_MAX: + case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: return true; default: return false; -- cgit v1.2.3 From f6dd8dea2e493dc549a60fee99de871c4088d09a Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 31 Jan 2023 06:03:30 +1100 Subject: Remove usages of config_common.h from config.h files. (#19714) --- keyboards/adm42/config.h | 1 - 1 file changed, 1 deletion(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/config.h b/keyboards/adm42/config.h index 50e697a645..766bf3f444 100644 --- a/keyboards/adm42/config.h +++ b/keyboards/adm42/config.h @@ -16,7 +16,6 @@ #pragma once -#include "config_common.h" #define MATRIX_ROWS 4 #define MATRIX_COLS 12 -- cgit v1.2.3 From ebb512db827e84619e7151fcf76e3daf9328fe59 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 4 Feb 2023 06:19:58 +1100 Subject: Debounce defines cleanup (#19742) * Clean up `DEBOUNCE` in config.h, 0-9 * Clean up `DEBOUNCE` in config.h, A * Clean up `DEBOUNCE` in config.h, B * Clean up `DEBOUNCE` in config.h, C * Clean up `DEBOUNCE` in config.h, D * Clean up `DEBOUNCE` in config.h, E * Clean up `DEBOUNCE` in config.h, F * Clean up `DEBOUNCE` in config.h, G * Clean up `DEBOUNCE` in config.h, H * Clean up `DEBOUNCE` in config.h, handwired * Clean up `DEBOUNCE` in config.h, I * Clean up `DEBOUNCE` in config.h, J * Clean up `DEBOUNCE` in config.h, K * Clean up `DEBOUNCE` in config.h, L * Clean up `DEBOUNCE` in config.h, M * Clean up `DEBOUNCE` in config.h, N * Clean up `DEBOUNCE` in config.h, O * Clean up `DEBOUNCE` in config.h, P * Clean up `DEBOUNCE` in config.h, Q * Clean up `DEBOUNCE` in config.h, R * Clean up `DEBOUNCE` in config.h, S * Clean up `DEBOUNCE` in config.h, T * Clean up `DEBOUNCE` in config.h, U * Clean up `DEBOUNCE` in config.h, V * Clean up `DEBOUNCE` in config.h, W * Clean up `DEBOUNCE` in config.h, X * Clean up `DEBOUNCE` in config.h, Y * Clean up `DEBOUNCE` in config.h, Z * Remove default debounce from info.json * Migrate non-default debounce to info.json --- keyboards/adm42/config.h | 1 - keyboards/adm42/info.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/config.h b/keyboards/adm42/config.h index 766bf3f444..5c1a5b2c7c 100644 --- a/keyboards/adm42/config.h +++ b/keyboards/adm42/config.h @@ -23,7 +23,6 @@ #define DIODE_DIRECTION ROW2COL #define TAP_CODE_DELAY 1 -#define DEBOUNCE 10 #if defined(CONSOLE_ENABLE) #define DEBUG_MATRIX_SCAN_RATE diff --git a/keyboards/adm42/info.json b/keyboards/adm42/info.json index 5834be2233..7b9aa82661 100644 --- a/keyboards/adm42/info.json +++ b/keyboards/adm42/info.json @@ -3,6 +3,7 @@ "manufacturer": "Lorenzo Leonini", "url": "https://adm42.dev/", "maintainer": "lleonini", + "debounce": 10, "usb": { "vid": "0x04D8", "pid": "0xE873", -- cgit v1.2.3 From f9aeea64c1f85d388485503e52035b5f7533ed26 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 8 Feb 2023 18:41:46 +1100 Subject: Migrate `MCU` and `BOOTLOADER` to data-driven (#19529) --- keyboards/adm42/info.json | 2 ++ keyboards/adm42/rules.mk | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/info.json b/keyboards/adm42/info.json index 7b9aa82661..3596cdb446 100644 --- a/keyboards/adm42/info.json +++ b/keyboards/adm42/info.json @@ -9,6 +9,8 @@ "pid": "0xE873", "device_version": "0.0.1" }, + "processor": "atmega32u4", + "bootloader": "atmel-dfu", "layout_aliases": { "LAYOUT_adm42_3x12_6": "LAYOUT" }, diff --git a/keyboards/adm42/rules.mk b/keyboards/adm42/rules.mk index c075aa134d..73e4d46c59 100644 --- a/keyboards/adm42/rules.mk +++ b/keyboards/adm42/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = atmel-dfu - # Build Options # change yes to no to disable # -- cgit v1.2.3 From 2da0827d4ffbcba161126d6001f370e97d0172a8 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 17 Feb 2023 16:08:25 +1100 Subject: Remove matrix size defines (#19581) --- keyboards/adm42/config.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/config.h b/keyboards/adm42/config.h index 5c1a5b2c7c..03749906e8 100644 --- a/keyboards/adm42/config.h +++ b/keyboards/adm42/config.h @@ -17,9 +17,6 @@ #pragma once -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - #define DIODE_DIRECTION ROW2COL #define TAP_CODE_DELAY 1 -- cgit v1.2.3 From 499fc3b85e99de725535eb73f653d77a71339e3f Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 22 Feb 2023 02:55:23 +1100 Subject: Add some missing `#pragma once`s (#19902) --- keyboards/adm42/rev4/config.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/rev4/config.h b/keyboards/adm42/rev4/config.h index 9ad330d8f7..c03603b011 100644 --- a/keyboards/adm42/rev4/config.h +++ b/keyboards/adm42/rev4/config.h @@ -14,6 +14,8 @@ * along with this program. If not, see . */ +#pragma once + #define MATRIX_COL_PINS { C6, B6, B5, B4, D7, D6, F0, F1, F4, F5, F6, F7 } #define MATRIX_ROW_PINS { C7, D5, D3, D2 } -- cgit v1.2.3 From 3bf01bb9ed202b14f78105db2aa2a75d01fc4323 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 23 Feb 2023 09:20:23 +1100 Subject: Move QMK LUFA bootloader config to data driven (#19879) --- keyboards/adm42/rev4/config.h | 2 +- keyboards/adm42/rev4/keymaps/default/keymap.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'keyboards/adm42') diff --git a/keyboards/adm42/rev4/config.h b/keyboards/adm42/rev4/config.h index c03603b011..fa2bcb3e43 100644 --- a/keyboards/adm42/rev4/config.h +++ b/keyboards/adm42/rev4/config.h @@ -19,7 +19,7 @@ #define MATRIX_COL_PINS { C6, B6, B5, B4, D7, D6, F0, F1, F4, F5, F6, F7 } #define MATRIX_ROW_PINS { C7, D5, D3, D2 } -#define QMK_LED E6 +#define ADM42_LED E6 #define RGB_DI_PIN B7 diff --git a/keyboards/adm42/rev4/keymaps/default/keymap.c b/keyboards/adm42/rev4/keymaps/default/keymap.c index d066445025..12e4e85a4a 100644 --- a/keyboards/adm42/rev4/keymaps/default/keymap.c +++ b/keyboards/adm42/rev4/keymaps/default/keymap.c @@ -174,7 +174,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case REFLASH: eeconfig_init(); eeconfig_update_rgb_matrix_default(); - writePinLow(QMK_LED); + writePinLow(ADM42_LED); reset_keyboard(); return false; @@ -184,21 +184,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void keyboard_pre_init_kb(void) { - setPinOutput(QMK_LED); - writePinHigh(QMK_LED); + setPinOutput(ADM42_LED); + writePinHigh(ADM42_LED); } void keyboard_post_init_kb(void) { debug_enable = true; debug_matrix = false; debug_keyboard = false; - writePinHigh(QMK_LED); + writePinHigh(ADM42_LED); } void suspend_power_down_kb(void) { - writePinLow(QMK_LED); + writePinLow(ADM42_LED); } void suspend_wakeup_init_kb(void) { - writePinHigh(QMK_LED); + writePinHigh(ADM42_LED); } -- cgit v1.2.3