From cfb4bb9b98dccd12132b784a6656ddefdb524728 Mon Sep 17 00:00:00 2001 From: Moritz Plattner Date: Fri, 29 Sep 2023 13:19:03 +0200 Subject: [PATCH] teleport/native: switch from wrongly used user to kb function, boost matrix scan rate (#21172) * enable LTO * change from _user to _kb function * switch matrix io delay to nops, add opt=3 for higher scan rates * disable console which was enabled for testing but collides with endpoint used by VIA * switched from opt=3 to opt=2 * Update keyboards/teleport/native/native.c Co-authored-by: Joel Challis * slightly upped debounce, as some testers had chatter with async + default debounce --------- Co-authored-by: Joel Challis --- keyboards/teleport/native/ansi/keymaps/perfmode/config.h | 5 ++++- keyboards/teleport/native/ansi/keymaps/perfmode/keymap.c | 3 +++ keyboards/teleport/native/ansi/keymaps/perfmode/rules.mk | 1 + keyboards/teleport/native/info.json | 3 ++- keyboards/teleport/native/iso/keymaps/perfmode/config.h | 5 ++++- keyboards/teleport/native/iso/keymaps/perfmode/keymap.c | 3 +++ keyboards/teleport/native/iso/keymaps/perfmode/rules.mk | 1 + keyboards/teleport/native/native.c | 4 +++- 8 files changed, 21 insertions(+), 4 deletions(-) diff --git a/keyboards/teleport/native/ansi/keymaps/perfmode/config.h b/keyboards/teleport/native/ansi/keymaps/perfmode/config.h index a99590cd1c59..896166db12b2 100644 --- a/keyboards/teleport/native/ansi/keymaps/perfmode/config.h +++ b/keyboards/teleport/native/ansi/keymaps/perfmode/config.h @@ -20,4 +20,7 @@ along with this program. If not, see . /* Increase eeprom size to allow for 5 layers */ #define WEAR_LEVELING_BACKING_SIZE 16384 -#define WEAR_LEVELING_LOGICAL_SIZE 4096 \ No newline at end of file +#define WEAR_LEVELING_LOGICAL_SIZE 4096 + +/* Increase debounce, as asym eager seems to lead to chatter with the fast polling rate in some cases */ +#define DEBOUNCE 7 \ No newline at end of file diff --git a/keyboards/teleport/native/ansi/keymaps/perfmode/keymap.c b/keyboards/teleport/native/ansi/keymaps/perfmode/keymap.c index 1a7852a062e7..abe6188ccfd0 100644 --- a/keyboards/teleport/native/ansi/keymaps/perfmode/keymap.c +++ b/keyboards/teleport/native/ansi/keymaps/perfmode/keymap.c @@ -15,6 +15,9 @@ */ #include QMK_KEYBOARD_H +// tested and working +void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); } + enum layers{ BASE, GAME, diff --git a/keyboards/teleport/native/ansi/keymaps/perfmode/rules.mk b/keyboards/teleport/native/ansi/keymaps/perfmode/rules.mk index b735c48f20fc..d6c9b615e02b 100644 --- a/keyboards/teleport/native/ansi/keymaps/perfmode/rules.mk +++ b/keyboards/teleport/native/ansi/keymaps/perfmode/rules.mk @@ -1,4 +1,5 @@ DEBOUNCE_TYPE = asym_eager_defer_pk +OPT = 2 VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/teleport/native/info.json b/keyboards/teleport/native/info.json index 7aec5f77ed6e..87b97e5b2d1c 100644 --- a/keyboards/teleport/native/info.json +++ b/keyboards/teleport/native/info.json @@ -19,7 +19,8 @@ "console": false, "extrakey": true, "mousekey": true, - "nkro": true + "nkro": true, + "lto": true }, "diode_direction": "ROW2COL", "matrix_pins": { diff --git a/keyboards/teleport/native/iso/keymaps/perfmode/config.h b/keyboards/teleport/native/iso/keymaps/perfmode/config.h index a99590cd1c59..896166db12b2 100644 --- a/keyboards/teleport/native/iso/keymaps/perfmode/config.h +++ b/keyboards/teleport/native/iso/keymaps/perfmode/config.h @@ -20,4 +20,7 @@ along with this program. If not, see . /* Increase eeprom size to allow for 5 layers */ #define WEAR_LEVELING_BACKING_SIZE 16384 -#define WEAR_LEVELING_LOGICAL_SIZE 4096 \ No newline at end of file +#define WEAR_LEVELING_LOGICAL_SIZE 4096 + +/* Increase debounce, as asym eager seems to lead to chatter with the fast polling rate in some cases */ +#define DEBOUNCE 7 \ No newline at end of file diff --git a/keyboards/teleport/native/iso/keymaps/perfmode/keymap.c b/keyboards/teleport/native/iso/keymaps/perfmode/keymap.c index 3be8eec3ddf9..96e9925fd5ae 100644 --- a/keyboards/teleport/native/iso/keymaps/perfmode/keymap.c +++ b/keyboards/teleport/native/iso/keymaps/perfmode/keymap.c @@ -15,6 +15,9 @@ */ #include QMK_KEYBOARD_H +// tested and working +void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); } + enum layers{ BASE, GAME, diff --git a/keyboards/teleport/native/iso/keymaps/perfmode/rules.mk b/keyboards/teleport/native/iso/keymaps/perfmode/rules.mk index b735c48f20fc..d6c9b615e02b 100644 --- a/keyboards/teleport/native/iso/keymaps/perfmode/rules.mk +++ b/keyboards/teleport/native/iso/keymaps/perfmode/rules.mk @@ -1,4 +1,5 @@ DEBOUNCE_TYPE = asym_eager_defer_pk +OPT = 2 VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/teleport/native/native.c b/keyboards/teleport/native/native.c index 042e2bfa95ea..c3cac80c2211 100644 --- a/keyboards/teleport/native/native.c +++ b/keyboards/teleport/native/native.c @@ -17,9 +17,11 @@ #include "quantum.h" /* This board has !SDB of the is31 wired to D2. Set high to enable */ -void keyboard_post_init_user(void) { +void keyboard_post_init_kb(void) { setPinOutput(B9); writePinHigh(B9); + + keyboard_post_init_user(); } #ifdef RGB_MATRIX_ENABLE