aboutsummaryrefslogtreecommitdiff
path: root/quantum/debounce/sym_defer_pk.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/debounce/sym_defer_pk.c')
-rw-r--r--quantum/debounce/sym_defer_pk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/quantum/debounce/sym_defer_pk.c b/quantum/debounce/sym_defer_pk.c
index f404cf9c4..6c0e3bb07 100644
--- a/quantum/debounce/sym_defer_pk.c
+++ b/quantum/debounce/sym_defer_pk.c
@@ -38,12 +38,12 @@ static bool counters_need_update;
38#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) 38#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1)
39 39
40static uint8_t wrapping_timer_read(void) { 40static uint8_t wrapping_timer_read(void) {
41 static uint16_t time = 0; 41 static uint16_t time = 0;
42 static uint8_t last_result = 0; 42 static uint8_t last_result = 0;
43 uint16_t new_time = timer_read(); 43 uint16_t new_time = timer_read();
44 uint16_t diff = new_time - time; 44 uint16_t diff = new_time - time;
45 time = new_time; 45 time = new_time;
46 last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); 46 last_result = (last_result + diff) % (MAX_DEBOUNCE + 1);
47 return last_result; 47 return last_result;
48} 48}
49 49