Restore the logic of the key debouncer. Make it only debounce keypresses and set its timeout to 100ms.

This commit is contained in:
László Monda
2018-06-27 21:42:15 +02:00
parent d21fe30139
commit 5c3e2966c4
3 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
// Macros:
#define KEY_DEBOUNCER_INTERVAL_MSEC 1
#define KEY_DEBOUNCER_TIMEOUT_MSEC 5
#define KEY_DEBOUNCER_TIMEOUT_MSEC 100
// Functions:

View File

@@ -326,7 +326,7 @@ static void updateActiveUsbReports(void)
if (keyState->debounceCounter) {
keyState->current = keyState->previous;
} else if (keyState->previous != keyState->current) {
} else if (!keyState->previous && keyState->current) {
keyState->debounceCounter = KEY_DEBOUNCER_TIMEOUT_MSEC + 1;
}