diff options
Diffstat (limited to 'quantum/debounce/eager_pr.c')
| -rw-r--r-- | quantum/debounce/eager_pr.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 | ||
