|
|
|
@ -89,7 +89,7 @@ void TestMode_::testMatrix() {
|
|
|
|
|
LEDControl.set_all_leds_to(200, 0, 0);
|
|
|
|
|
// Clear out the key event buffer so we don't get messed up information from
|
|
|
|
|
// taps during LED test mode.
|
|
|
|
|
for(auto temp =0; temp<16; temp++) {
|
|
|
|
|
for (auto temp = 0; temp < 16; temp++) {
|
|
|
|
|
KeyboardHardware.readMatrix();
|
|
|
|
|
}
|
|
|
|
|
while (1) {
|
|
|
|
@ -104,7 +104,7 @@ void TestMode_::testMatrix() {
|
|
|
|
|
uint8_t keyState = ((bitRead(KeyboardHardware.previousLeftHandState.all, keynum) << 1) |
|
|
|
|
|
(bitRead(KeyboardHardware.leftHandState.all, keynum) << 0));
|
|
|
|
|
|
|
|
|
|
if ( keyState == TOGGLED_ON ) {
|
|
|
|
|
if (keyState == TOGGLED_ON) {
|
|
|
|
|
if (cyclesSinceStateChange[keynum] < CHATTER_CYCLE_LIMIT) {
|
|
|
|
|
bitSet(leftBadKeys, keynum);
|
|
|
|
|
}
|
|
|
|
@ -135,13 +135,13 @@ void TestMode_::testMatrix() {
|
|
|
|
|
(bitRead(KeyboardHardware.rightHandState.all, keynum) << 0));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( keyState == TOGGLED_ON) {
|
|
|
|
|
if (cyclesSinceStateChange[keynum+32] < CHATTER_CYCLE_LIMIT) {
|
|
|
|
|
if (keyState == TOGGLED_ON) {
|
|
|
|
|
if (cyclesSinceStateChange[keynum + 32] < CHATTER_CYCLE_LIMIT) {
|
|
|
|
|
bitSet(rightBadKeys, keynum);
|
|
|
|
|
}
|
|
|
|
|
cyclesSinceStateChange[keynum+32] = 0;
|
|
|
|
|
} else if (cyclesSinceStateChange[keynum+32] <= CHATTER_CYCLE_LIMIT) {
|
|
|
|
|
cyclesSinceStateChange[keynum+32]++;
|
|
|
|
|
cyclesSinceStateChange[keynum + 32] = 0;
|
|
|
|
|
} else if (cyclesSinceStateChange[keynum + 32] <= CHATTER_CYCLE_LIMIT) {
|
|
|
|
|
cyclesSinceStateChange[keynum + 32]++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If the key is held down
|
|
|
|
@ -149,7 +149,7 @@ void TestMode_::testMatrix() {
|
|
|
|
|
KeyboardHardware.setCrgbAt(row, 15 - col, green);
|
|
|
|
|
}
|
|
|
|
|
// If we triggered chatter detection ever on this key
|
|
|
|
|
else if (bitRead(rightBadKeys, keynum) == 1 ) {
|
|
|
|
|
else if (bitRead(rightBadKeys, keynum) == 1) {
|
|
|
|
|
KeyboardHardware.setCrgbAt(row, 15 - col, red);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|