diff options
author | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-06-20 12:20:52 -0400 |
---|---|---|
committer | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-06-20 12:20:52 -0400 |
commit | f6d1ce7863893e6dd0233c57f04b262f6808d78a (patch) | |
tree | 723db2fdaff2ccf810a328511d7f54cbc568d326 /quantum/matrix.c | |
parent | f566125c6e29e3db62552c089428591d460ce583 (diff) | |
parent | 44e098ef2d6c571cee9e5fa1b007b40f6289852f (diff) |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
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 412662a794..4f1564ac87 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -66,6 +66,30 @@ uint8_t matrix_cols(void) { return MATRIX_COLS; } +void matrix_power_up(void) { +#if DIODE_DIRECTION == COL2ROW + for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { + /* DDRxn */ + _SFR_IO8(row_pins[r].input_addr + 1) |= _BV(row_pins[r].bit); + toggle_row(r); + } + for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { + /* PORTxn */ + _SFR_IO8(col_pins[c].input_addr + 2) |= _BV(col_pins[c].bit); + } +#else + for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { + /* DDRxn */ + _SFR_IO8(col_pins[c].input_addr + 1) |= _BV(col_pins[c].bit); + toggle_col(c); + } + for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { + /* PORTxn */ + _SFR_IO8(row_pins[r].input_addr + 2) |= _BV(row_pins[r].bit); + } +#endif +} + void matrix_init(void) { /* frees PORTF by setting the JTD bit twice within four cycles */ #ifdef __AVR_ATmega32U4__ |