From 986e3b407ce67159d073eb477e602797051dc5fa Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Mon, 8 Jul 2019 11:32:16 +0200 Subject: [PATCH] Let keyIndex-macro use KeyAddr Signed-off-by: Florian Fleissner --- src/kaleidoscope/hardware/key_indexes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kaleidoscope/hardware/key_indexes.h b/src/kaleidoscope/hardware/key_indexes.h index 9ed9e670..fec3b839 100644 --- a/src/kaleidoscope/hardware/key_indexes.h +++ b/src/kaleidoscope/hardware/key_indexes.h @@ -28,8 +28,8 @@ * We're using a macro instead of a constexpr so that it is evaluated lazily, * when `HARDWARE_IMPLEMENTATION` can be properly resolved. */ -#define keyIndex(row,col) \ - (uint8_t)((row * HARDWARE_IMPLEMENTATION::matrix_columns) + col + 1) +#define keyIndex(row,col) \ + (uint8_t)(KeyAddr(row, col).toInt() + 1) constexpr uint8_t R0C0 = keyIndex(0, 0); constexpr uint8_t R0C1 = keyIndex(0, 1);