From 89fb57c7240d0fdef8d8517325dc41e64f42e253 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 2 Jul 2020 21:40:10 -0700 Subject: [PATCH 1/2] Make the default keyscan interval configurable from the device's props --- src/kaleidoscope/driver/keyscanner/ATmega.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kaleidoscope/driver/keyscanner/ATmega.h b/src/kaleidoscope/driver/keyscanner/ATmega.h index 6ffd36fc..54d8a37d 100644 --- a/src/kaleidoscope/driver/keyscanner/ATmega.h +++ b/src/kaleidoscope/driver/keyscanner/ATmega.h @@ -35,6 +35,8 @@ namespace keyscanner { struct ATmegaProps: kaleidoscope::driver::keyscanner::BaseProps { static const uint8_t debounce = 3; + static const uint16_t keyscan_interval = 1700; + /* * The following two lines declare an empty array. Both of these must be @@ -75,7 +77,7 @@ class ATmega: public kaleidoscope::driver::keyscanner::Base<_KeyScannerProps> { } /* Set up Timer1 for 1700usec */ - setScanCycleTime(1700); + setScanCycleTime(_KeyScannerProps::keyscan_interval); } void setScanCycleTime(uint16_t c) { From ca216b53089cfb057627c4aa0536ad71480e5575 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 2 Jul 2020 21:40:53 -0700 Subject: [PATCH 2/2] Make the Atreus' keyscan interval more conservative by default to help smooth out perceived chatter issues with Speed Copper switches. --- src/kaleidoscope/device/keyboardio/Atreus2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/kaleidoscope/device/keyboardio/Atreus2.h b/src/kaleidoscope/device/keyboardio/Atreus2.h index 5b2659c2..66b307fe 100644 --- a/src/kaleidoscope/device/keyboardio/Atreus2.h +++ b/src/kaleidoscope/device/keyboardio/Atreus2.h @@ -33,6 +33,8 @@ namespace keyboardio { struct AtreusProps : kaleidoscope::device::ATmega32U4KeyboardProps { struct KeyScannerProps : public kaleidoscope::driver::keyscanner::ATmegaProps { + static const uint16_t keyscan_interval = 2700; + static constexpr uint8_t matrix_rows = 4; static constexpr uint8_t matrix_columns = 12; typedef MatrixAddr KeyAddr;