diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-06-17 22:09:59 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-06-17 22:09:59 -0400 |
commit | 008c8d54a0a1a1e908d372d0fe9edb45a2d491e5 (patch) | |
tree | 7b98493f07430d860c26c2ad4918727e6816be7e /quantum/matrix.c | |
parent | de326d078d9de21acccfa96525597308a7ec036d (diff) | |
download | qmk_firmware-008c8d54a0a1a1e908d372d0fe9edb45a2d491e5.tar.gz qmk_firmware-008c8d54a0a1a1e908d372d0fe9edb45a2d491e5.zip |
adds power_up to quantum's matrix file
Diffstat (limited to 'quantum/matrix.c')
-rw-r--r-- | quantum/matrix.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/quantum/matrix.c b/quantum/matrix.c index 412662a79..4f1564ac8 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
@@ -66,6 +66,30 @@ uint8_t matrix_cols(void) { | |||
66 | return MATRIX_COLS; | 66 | return MATRIX_COLS; |
67 | } | 67 | } |
68 | 68 | ||
69 | void matrix_power_up(void) { | ||
70 | #if DIODE_DIRECTION == COL2ROW | ||
71 | for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { | ||
72 | /* DDRxn */ | ||
73 | _SFR_IO8(row_pins[r].input_addr + 1) |= _BV(row_pins[r].bit); | ||
74 | toggle_row(r); | ||
75 | } | ||
76 | for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { | ||
77 | /* PORTxn */ | ||
78 | _SFR_IO8(col_pins[c].input_addr + 2) |= _BV(col_pins[c].bit); | ||
79 | } | ||
80 | #else | ||
81 | for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { | ||
82 | /* DDRxn */ | ||
83 | _SFR_IO8(col_pins[c].input_addr + 1) |= _BV(col_pins[c].bit); | ||
84 | toggle_col(c); | ||
85 | } | ||
86 | for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { | ||
87 | /* PORTxn */ | ||
88 | _SFR_IO8(row_pins[r].input_addr + 2) |= _BV(row_pins[r].bit); | ||
89 | } | ||
90 | #endif | ||
91 | } | ||
92 | |||
69 | void matrix_init(void) { | 93 | void matrix_init(void) { |
70 | /* frees PORTF by setting the JTD bit twice within four cycles */ | 94 | /* frees PORTF by setting the JTD bit twice within four cycles */ |
71 | #ifdef __AVR_ATmega32U4__ | 95 | #ifdef __AVR_ATmega32U4__ |