From 3577e26fd9916ceab58779ec6323d43da54eb3b5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 6 Jul 2016 00:24:31 -0400 Subject: fix/annotate wait_us lines --- keyboards/ergodox_ez/matrix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'keyboards') diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 9c1efa1d0..dc29cf5cd 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -39,6 +39,17 @@ along with this program. If not, see . #include "timer.h" #endif +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + #ifndef DEBOUNCE # define DEBOUNCE 5 #endif @@ -181,6 +192,7 @@ uint8_t matrix_scan(void) if (debouncing) { if (--debouncing) { wait_us(1); + // this should be wait_ms(1) but has been left as-is at EZ's request } else { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; -- cgit v1.2.3-24-g4f1b From a7e3e4e652a2b9f172282f3876d74ee247a63105 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 14:29:46 +0300 Subject: Add serial_link compilation to Infinity Ergodox --- keyboards/infinity_ergodox/Makefile | 1 + keyboards/infinity_ergodox/infinity_ergodox.c | 10 ++++++++++ 2 files changed, 11 insertions(+) (limited to 'keyboards') diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile index fb21aae5e..efa32e037 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/infinity_ergodox/Makefile @@ -66,6 +66,7 @@ COMMAND_ENABLE ?= yes # Commands for debug and configuration SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend NKRO_ENABLE ?= yes # USB Nkey Rollover CUSTOM_MATRIX ?= yes # Custom matrix file +SERIAL_LINK_ENABLE = yes ifndef QUANTUM_DIR include ../../Makefile diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c index 34aded1a7..85054775e 100644 --- a/keyboards/infinity_ergodox/infinity_ergodox.c +++ b/keyboards/infinity_ergodox/infinity_ergodox.c @@ -1 +1,11 @@ #include "infinity_ergodox.h" +#include "ch.h" +#include "hal.h" +#include "serial_link/system/serial_link.h" + +void init_serial_link_hal(void) { + PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); + PORTA->PCR[2] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(2); + PORTE->PCR[0] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(3); + PORTE->PCR[1] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(3); +} -- cgit v1.2.3-24-g4f1b