aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vlasov <sigprof@gmail.com>2020-04-29 13:52:15 +0300
committerGitHub <noreply@github.com>2020-04-29 03:52:15 -0700
commit8fdb229b661e2f9d5e493a83c2efa6765f3b5f4d (patch)
treea373fd4b7f95c4ff6e5f9834b428854b62275565
parentfd3456f362b3cacbd1506f12280dd42e38e98950 (diff)
downloadqmk_firmware-8fdb229b661e2f9d5e493a83c2efa6765f3b5f4d.tar.gz
qmk_firmware-8fdb229b661e2f9d5e493a83c2efa6765f3b5f4d.zip
[Keyboard] id80: Transpose matrix to use faster COL2ROW routines (#8930)
* id80: Transpose matrix to use faster COL2ROW routines Even the standard QMK matrix_scan() function can give about 2 times higher scan rate (if compiled with optimizations enabled) if the COL2ROW matrix layout is used instead of ROW2COL. Although the ID80 PCB is wired using the ROW2COL matrix layout, it is possible to transpose the matrix from the QMK standpoint, so that "columns" would correspond to horizontal connections, and "rows" would correspond to (mostly) vertical connections; in this case the matrix could be handled as if it had the COL2ROW layout. The matrix layout change makes the older VIA JSON layout definition incompatible, but the corresponding JSON was not yet accepted to the VIA repository, so it should still be safe to make this change. * id80: Remove obsolete comments
-rw-r--r--keyboards/id80/config.h28
-rw-r--r--keyboards/id80/id80.h23
2 files changed, 26 insertions, 25 deletions
diff --git a/keyboards/id80/config.h b/keyboards/id80/config.h
index 12ee5400c..936fd5b2e 100644
--- a/keyboards/id80/config.h
+++ b/keyboards/id80/config.h
@@ -28,8 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28#define DESCRIPTION A 75% hotswap keyboard 28#define DESCRIPTION A 75% hotswap keyboard
29 29
30/* key matrix size */ 30/* key matrix size */
31#define MATRIX_ROWS 11 31#define MATRIX_ROWS 9
32#define MATRIX_COLS 9 32#define MATRIX_COLS 11
33 33
34/* 34/*
35 * Keyboard Matrix Assignments 35 * Keyboard Matrix Assignments
@@ -41,16 +41,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
41 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) 41 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
42 * 42 *
43 * The matrix description in the vendor-supplied JSON file for kbfirmware.com 43 * The matrix description in the vendor-supplied JSON file for kbfirmware.com
44 * had 12 rows: 44 * had 9 columns:
45 * { D0, D1, D2, D3, D5, D4, D6, D7, B4 }
46 * and 12 rows:
45 * { B7, B3, B2, B1, B0, E6, F0, F1, F4, F5, F6, F7 } 47 * { B7, B3, B2, B1, B0, E6, F0, F1, F4, F5, F6, F7 }
46 * However, the row 6 was completely empty, and the pin F0 was not actually 48 * However, the row 6 was completely empty, and the pin F0 was not actually
47 * routed anywhere on the PCB, therefore this row was removed to save some 49 * routed anywhere on the PCB, therefore this row was removed to save some
48 * resources (the EEPROM space for dynamic keymaps is especially scarce). 50 * resources (the EEPROM space for dynamic keymaps is especially scarce).
51 *
52 * After doing the above change, the matrix was transposed (rows and columns
53 * were swapped), because a matrix with the COL2ROW layout can be scanned much
54 * more efficiently than a matrix with the ROW2COL layout (depending on various
55 * optimizations, the difference in scan rate can be over 2 times). Because of
56 * this, the "columns" in the matrix layout now mostly correspond to physical
57 * rows, and the "rows" have mostly vertical physical orientation.
49 */ 58 */
50#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0, E6, F1, F4, F5, F6, F7 } 59#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4 }
51#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4 } 60#define MATRIX_COL_PINS { B7, B3, B2, B1, B0, E6, F1, F4, F5, F6, F7 }
52 61
53#define DIODE_DIRECTION ROW2COL 62#define DIODE_DIRECTION COL2ROW
54 63
55#define BACKLIGHT_PIN B6 64#define BACKLIGHT_PIN B6
56// #define BACKLIGHT_BREATHING 65// #define BACKLIGHT_BREATHING
@@ -81,8 +90,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
81#endif 90#endif
82 91
83/* Bootmagic Lite key configuration: use the Esc key */ 92/* Bootmagic Lite key configuration: use the Esc key */
84#define BOOTMAGIC_LITE_ROW 5 93#define BOOTMAGIC_LITE_ROW 0
85#define BOOTMAGIC_LITE_COLUMN 0 94#define BOOTMAGIC_LITE_COLUMN 5
86
87// partially generated by KBFirmware JSON to QMK Parser
88// https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/id80/id80.h b/keyboards/id80/id80.h
index 2f2cab71b..94626fe4f 100644
--- a/keyboards/id80/id80.h
+++ b/keyboards/id80/id80.h
@@ -25,18 +25,13 @@
25 K10, K12, K13, K14, K15, K16, K17, K18, K68, K67, K65, K64, K63, \ 25 K10, K12, K13, K14, K15, K16, K17, K18, K68, K67, K65, K64, K63, \
26 K00, K01, K02, K06, K08, K07, K05, K04, K03 \ 26 K00, K01, K02, K06, K08, K07, K05, K04, K03 \
27) { \ 27) { \
28 { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ 28 { K00, K10, K20, K30, K40, K50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
29 { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18 }, \ 29 { K01, KC_NO, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
30 { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ 30 { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, K82, K92, KA2 }, \
31 { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ 31 { K03, K13, K23, K33, K43, K53, K63, KC_NO, K83, KC_NO, KA3 }, \
32 { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ 32 { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4 }, \
33 { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ 33 { K05, K15, K25, K35, K45, K55, K65, K75, K85, K95, KA5 }, \
34 { KC_NO, KC_NO, KC_NO, K63, K64, K65, KC_NO, K67, K68 }, \ 34 { K06, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, K96, KA6 }, \
35 { KC_NO, KC_NO, KC_NO, KC_NO, K74, K75, KC_NO, K77, K78 }, \ 35 { K07, K17, K27, K37, K47, K57, K67, K77, K87, K97, KA7 }, \
36 { KC_NO, KC_NO, K82, K83, K84, K85, KC_NO, K87, K88 }, \ 36 { K08, K18, K28, K38, K48, K58, K68, K78, K88, K98, KC_NO }, \
37 { KC_NO, KC_NO, K92, KC_NO, K94, K95, K96, K97, K98 }, \
38 { KC_NO, KC_NO, KA2, KA3, KA4, KA5, KA6, KA7, KC_NO }, \
39} 37}
40
41// generated by KBFirmware JSON to QMK Parser
42// https://noroadsleft.github.io/kbf_qmk_converter/