Only treat "key pressed down" events as issues for the debounce counter.

That way, we can look for two presses a bit more easily with only one
variable.
pull/365/head
Jesse Vincent 7 years ago
parent 8b562fe64b
commit 54cbf18e1c

@ -99,7 +99,7 @@ void TestMode_::testMatrix() {
uint8_t keyState = ((bitRead(KeyboardHardware.previousLeftHandState.all, keynum) << 1) | uint8_t keyState = ((bitRead(KeyboardHardware.previousLeftHandState.all, keynum) << 1) |
(bitRead(KeyboardHardware.leftHandState.all, keynum) << 0)); (bitRead(KeyboardHardware.leftHandState.all, keynum) << 0));
if ( keyState == TOGGLED_ON || keyState == TOGGLED_OFF ) { if ( keyState == TOGGLED_ON ) {
if (cyclesSinceStateChange[keynum] < CHATTER_CYCLE_LIMIT) { if (cyclesSinceStateChange[keynum] < CHATTER_CYCLE_LIMIT) {
bitSet(leftBadKeys, keynum); bitSet(leftBadKeys, keynum);
} }
@ -130,7 +130,7 @@ void TestMode_::testMatrix() {
(bitRead(KeyboardHardware.rightHandState.all, keynum) << 0)); (bitRead(KeyboardHardware.rightHandState.all, keynum) << 0));
if ( keyState == TOGGLED_ON || keyState == TOGGLED_OFF ) { if ( keyState == TOGGLED_ON) {
if (cyclesSinceStateChange[keynum+32] < CHATTER_CYCLE_LIMIT) { if (cyclesSinceStateChange[keynum+32] < CHATTER_CYCLE_LIMIT) {
bitSet(rightBadKeys, keynum); bitSet(rightBadKeys, keynum);
} }

Loading…
Cancel
Save