hardware/ErgoDox: Reset our latest state when updating Kaleidoscope

Set the previous key state when reporting the state to Kaleidoscope, instead of
on every read. This eliminates a possible chatter bug. Idea taken from a similar
change made to `ATMegaKeyboard`.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/473/head
Gergely Nagy 6 years ago
parent 6abc406172
commit 3202bc417e
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -85,7 +85,6 @@ ISR(TIMER1_OVF_vect) {
void ErgoDox::readMatrixRow(uint8_t row) { void ErgoDox::readMatrixRow(uint8_t row) {
uint8_t mask, cols; uint8_t mask, cols;
previousKeyState_[row] = keyState_[row];
mask = debounceMaskForRow(row); mask = debounceMaskForRow(row);
cols = (scanner_.readCols(row) & mask) | (keyState_[row] & ~mask); cols = (scanner_.readCols(row) & mask) | (keyState_[row] & ~mask);
debounceRow(cols ^ keyState_[row], row); debounceRow(cols ^ keyState_[row], row);
@ -116,6 +115,7 @@ void ErgoDox::actOnMatrixScan() {
if (keyState) if (keyState)
handleKeyswitchEvent(Key_NoKey, row, col, keyState); handleKeyswitchEvent(Key_NoKey, row, col, keyState);
} }
previousKeyState_[row] = keyState_[row];
} }
} }

Loading…
Cancel
Save