diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/debounce/eager_pk.c | 10 | ||||
| -rw-r--r-- | quantum/debounce/eager_pr.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/quantum/debounce/eager_pk.c b/quantum/debounce/eager_pk.c index 467689224..6fa956bf3 100644 --- a/quantum/debounce/eager_pk.c +++ b/quantum/debounce/eager_pk.c | |||
| @@ -45,12 +45,12 @@ static bool matrix_need_update; | |||
| 45 | #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) | 45 | #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) |
| 46 | 46 | ||
| 47 | static uint8_t wrapping_timer_read(void) { | 47 | static uint8_t wrapping_timer_read(void) { |
| 48 | static uint16_t time = 0; | 48 | static uint16_t time = 0; |
| 49 | static uint8_t last_result = 0; | 49 | static uint8_t last_result = 0; |
| 50 | uint16_t new_time = timer_read(); | 50 | uint16_t new_time = timer_read(); |
| 51 | uint16_t diff = new_time - time; | 51 | uint16_t diff = new_time - time; |
| 52 | time = new_time; | 52 | time = new_time; |
| 53 | last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); | 53 | last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); |
| 54 | return last_result; | 54 | return last_result; |
| 55 | } | 55 | } |
| 56 | 56 | ||
diff --git a/quantum/debounce/eager_pr.c b/quantum/debounce/eager_pr.c index 41843aedb..d12931fdd 100644 --- a/quantum/debounce/eager_pr.c +++ b/quantum/debounce/eager_pr.c | |||
| @@ -37,12 +37,12 @@ static bool counters_need_update; | |||
| 37 | #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) | 37 | #define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1) |
| 38 | 38 | ||
| 39 | static uint8_t wrapping_timer_read(void) { | 39 | static uint8_t wrapping_timer_read(void) { |
| 40 | static uint16_t time = 0; | 40 | static uint16_t time = 0; |
| 41 | static uint8_t last_result = 0; | 41 | static uint8_t last_result = 0; |
| 42 | uint16_t new_time = timer_read(); | 42 | uint16_t new_time = timer_read(); |
| 43 | uint16_t diff = new_time - time; | 43 | uint16_t diff = new_time - time; |
| 44 | time = new_time; | 44 | time = new_time; |
| 45 | last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); | 45 | last_result = (last_result + diff) % (MAX_DEBOUNCE + 1); |
| 46 | return last_result; | 46 | return last_result; |
| 47 | } | 47 | } |
| 48 | 48 | ||
