aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2024-08-10 03:20:36 +0200
committerLouis Burda <quent.burda@gmail.com>2024-08-10 03:20:36 +0200
commitc9a46c2c0474c7b5bed67519a3df499863db0096 (patch)
treea1527cfebb28e9f623b363c237cb7f43fec9a7b4 /src
parent4c462d0af136c244e2c2edf6f464c5f495f5b870 (diff)
downloadsxkbd-c9a46c2c0474c7b5bed67519a3df499863db0096.tar.gz
sxkbd-c9a46c2c0474c7b5bed67519a3df499863db0096.zip
Remove old debouncing code and adjust timeout
Diffstat (limited to 'src')
-rw-r--r--src/hid.c15
-rw-r--r--src/keymat.c2
2 files changed, 1 insertions, 16 deletions
diff --git a/src/hid.c b/src/hid.c
index b030ce2..14ac955 100644
--- 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
index a51bd52..d1349e3 100644
--- 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 };