From 6abc406172a1e08d575557f43e23212013d174dd Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 21 Nov 2018 07:09:07 +0100 Subject: [PATCH] hardware/ErgoDox: Switch debouncing to ~3 times / 5ms Based on the change made to `ATMegaKeyboard`, apply the same treatment to the `ErgoDoxScanner` too, and run debouncing only 3 times per 5ms, which is closer to what switch manufacturers recommend. Signed-off-by: Gergely Nagy --- src/kaleidoscope/hardware/ez/ErgoDox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kaleidoscope/hardware/ez/ErgoDox.cpp b/src/kaleidoscope/hardware/ez/ErgoDox.cpp index 5b183c3c..ce12d28e 100644 --- a/src/kaleidoscope/hardware/ez/ErgoDox.cpp +++ b/src/kaleidoscope/hardware/ez/ErgoDox.cpp @@ -67,11 +67,11 @@ void ErgoDox::setup(void) { setStatusLEDBrightness(2, 15); setStatusLEDBrightness(3, 15); - /* Set up Timer1 for 500usec */ + /* Set up Timer1 for 1700usec */ TCCR1B = _BV(WGM13); TCCR1A = 0; - const uint32_t cycles = (F_CPU / 2000000) * 500; + const uint32_t cycles = (F_CPU / 2000000) * 1700; ICR1 = cycles; TCCR1B = _BV(WGM13) | _BV(CS10);