sxkbd

Firmware for RP2040-based corne split keyboard
git clone https://git.sinitax.com/sinitax/sxkbd
Log | Files | Refs | Submodules | README | LICENSE | sfeed.txt

commit c9a46c2c0474c7b5bed67519a3df499863db0096
parent 4c462d0af136c244e2c2edf6f464c5f495f5b870
Author: Louis Burda <quent.burda@gmail.com>
Date:   Sat, 10 Aug 2024 03:20:36 +0200

Remove old debouncing code and adjust timeout

Diffstat:
Msrc/hid.c | 15---------------
Msrc/keymat.c | 2+-
2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/src/hid.c b/src/hid.c @@ -8,10 +8,7 @@ #include "class/hid/hid.h" #include "keysym/consumer.h" -#include "keysym/system.h" #include "hid/keyboard.h" -#include "hid/consumer.h" -#include "hid/system.h" #include "hardware/timer.h" #include "bsp/board.h" #include "pico/types.h" @@ -79,8 +76,6 @@ static struct hid_gamepad_report gamepad_report = { 0 }; static uint8_t active_weak_mods = 0; static uint8_t active_mods = 0; -static uint64_t bounce_mat[KEY_ROWS][KEY_COLS] = { 0 }; - static bool seen_mat[KEY_ROWS][KEY_COLS] = { 0 }; static uint32_t macro_held_stack[MACRO_HOLD_MAX] = { 0 }; @@ -325,16 +320,6 @@ process_keyup(uint32_t keysym, uint x, uint y) void process_key(uint x, uint y, uint64_t now_us) { - if (keymat[y][x] != keymat_prev[y][x]) { - if (bounce_mat[y][x] > now_us - 50000) { - DEBUG(LOG_KEYMAT, "Bouncing prevented %i vs %i", - keymat[y][x], keymat_prev[y][x]); - keymat[y][x] = keymat_prev[y][x]; - } else { - bounce_mat[y][x] = now_us; - } - } - if (keymat[y][x] && !keymat_prev[y][x]) keysyms[y][x] = determine_keysym(x, y); diff --git a/src/keymat.c b/src/keymat.c @@ -11,7 +11,7 @@ #include <string.h> -#define DEBOUNCE_MS 5 +#define DEBOUNCE_MS 50 #ifdef BAD_GPIO_MITIGATION static const uint keymat_row_pins[] = { 4, 9, 6, 7 };