From 490faa64ea692d1c1e8d64474a1b7d61e6655746 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 16 Nov 2018 08:34:42 +0100 Subject: [PATCH] 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 --- src/kaleidoscope/hardware/ATMegaKeyboard.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kaleidoscope/hardware/ATMegaKeyboard.cpp b/src/kaleidoscope/hardware/ATMegaKeyboard.cpp index 52dd1192..1e1130f5 100644 --- a/src/kaleidoscope/hardware/ATMegaKeyboard.cpp +++ b/src/kaleidoscope/hardware/ATMegaKeyboard.cpp @@ -64,12 +64,12 @@ void ATMegaKeyboard::readMatrix(void) { 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]); - 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]); - debounceRow(cols ^ KeyboardHardware.keyState_[current_row], current_row); + KeyboardHardware.debounceRow(cols ^ KeyboardHardware.keyState_[current_row], current_row); KeyboardHardware.keyState_[current_row] = cols; } } @@ -113,8 +113,8 @@ void ATMegaKeyboard::scanMatrix() { do_scan_ = false; - readMatrix(); - actOnMatrixScan(); + KeyboardHardware.readMatrix(); + KeyboardHardware.actOnMatrixScan(); } void ATMegaKeyboard::maskKey(byte row, byte col) {