From a2e894534850581aa54cf49570cb78eb71358f66 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 6 Dec 2019 10:52:54 +0100 Subject: [PATCH] device/Raise: Fix the column loop in actOnMatrixScan() `RaiseKeyScanner::actOnMatrixScan()` erroneously looped through all the columns in the matrix, while we only wanted to loop through the left half, since we read the right half at the same time, not separately. This resulted in half the keys producing two events, due to overflow. We also calculated the key number incorrectly. Both of these issues are fixed with this patch. Signed-off-by: Gergely Nagy --- src/kaleidoscope/device/dygma/Raise.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kaleidoscope/device/dygma/Raise.cpp b/src/kaleidoscope/device/dygma/Raise.cpp index 45f134b7..ad1e53e8 100644 --- a/src/kaleidoscope/device/dygma/Raise.cpp +++ b/src/kaleidoscope/device/dygma/Raise.cpp @@ -297,8 +297,8 @@ void RaiseKeyScanner::readMatrix() { void RaiseKeyScanner::actOnMatrixScan() { for (byte row = 0; row < Props_::matrix_rows; row++) { - for (byte col = 0; col < Props_::matrix_columns; col++) { - uint8_t keynum = (row * Props_::matrix_rows) + (col); + for (byte col = 0; col < Props_::left_columns; col++) { + uint8_t keynum = (row * Props_::left_columns) + col; uint8_t keyState; // left