Skip to content

Commit

Permalink
Fix/enhance regression count code
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Apr 19, 2021
1 parent 389f2bd commit 533dc62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion quantum/wpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ void update_wpm(uint16_t keycode) {
wpm_timer = timer_read();
}
#ifdef WPM_ALLOW_COUNT_REGRESSION
current_wpm -= wpm_regress_count(keycode);
uint8_t regress = wpm_regress_count(keycode);
if (regress) {
current_wpm -= regress;
wpm_timer = timer_read();
}
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion quantum/wpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool wpm_keycode_kb(uint16_t keycode);
bool wpm_keycode_user(uint16_t keycode);

#ifdef WPM_ALLOW_COUNT_REGRESSION
bool wpm_regress_count(uint16_t keycode);
uint8_t wpm_regress_count(uint16_t keycode);
#endif

void set_current_wpm(uint8_t);
Expand Down

0 comments on commit 533dc62

Please sign in to comment.