diff --git a/docs/api-reference/device-apis.md b/docs/api-reference/device-apis.md index 78c0a229..8e2e77a8 100644 --- a/docs/api-reference/device-apis.md +++ b/docs/api-reference/device-apis.md @@ -223,15 +223,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::state_t KeyScanner::state_ = {}; // 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/kbdfans/KBD4x.cpp b/src/kaleidoscope/device/kbdfans/KBD4x.cpp index 6dddcbfd..b10618f5 100644 --- a/src/kaleidoscope/device/kbdfans/KBD4x.cpp +++ b/src/kaleidoscope/device/kbdfans/KBD4x.cpp @@ -42,15 +42,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::state_t KeyScanner::state_ = {}; // 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/keyboardio/Imago.cpp b/src/kaleidoscope/device/keyboardio/Imago.cpp index 6792433e..9f85ab56 100644 --- a/src/kaleidoscope/device/keyboardio/Imago.cpp +++ b/src/kaleidoscope/device/keyboardio/Imago.cpp @@ -69,15 +69,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::state_t KeyScanner::state_ = {}; // 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/olkb/Planck.cpp b/src/kaleidoscope/device/olkb/Planck.cpp index 10e1c690..a8039d0d 100644 --- a/src/kaleidoscope/device/olkb/Planck.cpp +++ b/src/kaleidoscope/device/olkb/Planck.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::state_t KeyScanner::state_ = {}; // 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/softhruf/Splitography.cpp b/src/kaleidoscope/device/softhruf/Splitography.cpp index bbec531d..effe717b 100644 --- a/src/kaleidoscope/device/softhruf/Splitography.cpp +++ b/src/kaleidoscope/device/softhruf/Splitography.cpp @@ -48,15 +48,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::state_t KeyScanner::state_ = {}; // 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/technomancy/Atreus.cpp b/src/kaleidoscope/device/technomancy/Atreus.cpp index 7a34e66f..97667357 100644 --- a/src/kaleidoscope/device/technomancy/Atreus.cpp +++ b/src/kaleidoscope/device/technomancy/Atreus.cpp @@ -51,15 +51,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::state_t KeyScanner::state_ = {}; // 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.