hardware::ATMegaKeyboard: Call into KeyboardHardware aggressively

Whenever calling a function implemented by the class, call it through
`KeyboardHardware`, so they can be overridden.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/461/head
Gergely Nagy 6 years ago
parent 1643829f9a
commit 490faa64ea
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -64,12 +64,12 @@ void ATMegaKeyboard::readMatrix(void) {
KeyboardHardware.previousKeyState_[current_row] = KeyboardHardware.keyState_[current_row]; KeyboardHardware.previousKeyState_[current_row] = KeyboardHardware.keyState_[current_row];
mask = debounceMaskForRow(current_row); mask = KeyboardHardware.debounceMaskForRow(current_row);
OUTPUT_TOGGLE(KeyboardHardware.matrix_row_pins[current_row]); OUTPUT_TOGGLE(KeyboardHardware.matrix_row_pins[current_row]);
cols = (readCols() & mask) | (KeyboardHardware.keyState_[current_row] & ~mask); cols = (KeyboardHardware.readCols() & mask) | (KeyboardHardware.keyState_[current_row] & ~mask);
OUTPUT_TOGGLE(KeyboardHardware.matrix_row_pins[current_row]); OUTPUT_TOGGLE(KeyboardHardware.matrix_row_pins[current_row]);
debounceRow(cols ^ KeyboardHardware.keyState_[current_row], current_row); KeyboardHardware.debounceRow(cols ^ KeyboardHardware.keyState_[current_row], current_row);
KeyboardHardware.keyState_[current_row] = cols; KeyboardHardware.keyState_[current_row] = cols;
} }
} }
@ -113,8 +113,8 @@ void ATMegaKeyboard::scanMatrix() {
do_scan_ = false; do_scan_ = false;
readMatrix(); KeyboardHardware.readMatrix();
actOnMatrixScan(); KeyboardHardware.actOnMatrixScan();
} }
void ATMegaKeyboard::maskKey(byte row, byte col) { void ATMegaKeyboard::maskKey(byte row, byte col) {

Loading…
Cancel
Save