From 680278bb78b2d0d72693006ef54e28491112ac6b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 29 Aug 2020 12:30:48 +0200 Subject: [PATCH] Update the recently added gHeavy devices for new APIs Since the PR was made for the ButterStick and FaunchPad, ATMega32U4Keyboard has had a breaking API update. Follow up on that now. Signed-off-by: Gergely Nagy --- src/kaleidoscope/device/gheavy/ButterStick.cpp | 12 +++--------- src/kaleidoscope/device/gheavy/FaunchPad.cpp | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/kaleidoscope/device/gheavy/ButterStick.cpp b/src/kaleidoscope/device/gheavy/ButterStick.cpp index 016d1f02..540d0077 100644 --- a/src/kaleidoscope/device/gheavy/ButterStick.cpp +++ b/src/kaleidoscope/device/gheavy/ButterStick.cpp @@ -41,15 +41,9 @@ const uint8_t KeyScannerProps::matrix_columns; constexpr uint8_t KeyScannerProps::matrix_row_pins[matrix_rows]; constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns]; -// Resolving is a bit different in case of templates, however: the name of the -// array is resolved within the scope of the namespace and the class, but the -// array size is not - because it is a template. Therefore, we need a fully -// qualified name there - or an alias in the global scope, which we set up just -// above. -template<> uint16_t KeyScanner::previousKeyState_[KeyScannerProps::matrix_rows] = {}; -template<> uint16_t KeyScanner::keyState_[KeyScannerProps::matrix_rows] = {}; -template<> uint16_t KeyScanner::masks_[KeyScannerProps::matrix_rows] = {}; -template<> uint8_t KeyScanner::debounce_matrix_[KeyScannerProps::matrix_rows][KeyScannerProps::matrix_columns] = {}; +// `KeyScanner` here refers to the alias set up above, just like in the +// `KeyScannerProps` case above. +template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // cannot be in a header-only driver, and must be placed here. diff --git a/src/kaleidoscope/device/gheavy/FaunchPad.cpp b/src/kaleidoscope/device/gheavy/FaunchPad.cpp index bdac228f..09aeea33 100644 --- a/src/kaleidoscope/device/gheavy/FaunchPad.cpp +++ b/src/kaleidoscope/device/gheavy/FaunchPad.cpp @@ -41,15 +41,9 @@ const uint8_t KeyScannerProps::matrix_columns; constexpr uint8_t KeyScannerProps::matrix_row_pins[matrix_rows]; constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns]; -// Resolving is a bit different in case of templates, however: the name of the -// array is resolved within the scope of the namespace and the class, but the -// array size is not - because it is a template. Therefore, we need a fully -// qualified name there - or an alias in the global scope, which we set up just -// above. -template<> uint16_t KeyScanner::previousKeyState_[KeyScannerProps::matrix_rows] = {}; -template<> uint16_t KeyScanner::keyState_[KeyScannerProps::matrix_rows] = {}; -template<> uint16_t KeyScanner::masks_[KeyScannerProps::matrix_rows] = {}; -template<> uint8_t KeyScanner::debounce_matrix_[KeyScannerProps::matrix_rows][KeyScannerProps::matrix_columns] = {}; +// `KeyScanner` here refers to the alias set up above, just like in the +// `KeyScannerProps` case above. +template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // cannot be in a header-only driver, and must be placed here.