diff options
author | Nick Brassel <nick@tzarc.org> | 2024-02-18 21:17:15 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 21:17:15 +1100 |
commit | 9d9cdaaa2d035787b0b50c26f2975695fdbc16f4 (patch) | |
tree | 1a9f5d16ffc0e3bd27bc14791c25405a79ccd069 /keyboards/mechwild | |
parent | 2eb9ff8efd1df2c98724481c71c8ab8a5b62e31e (diff) |
Add encoder abstraction. (#21548)
Diffstat (limited to 'keyboards/mechwild')
-rw-r--r-- | keyboards/mechwild/sugarglider/matrix.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c index 96a16df542..c76a8345d3 100644 --- a/keyboards/mechwild/sugarglider/matrix.c +++ b/keyboards/mechwild/sugarglider/matrix.c @@ -50,7 +50,7 @@ static void select_row(uint8_t row) { //wait_us(100); return; } - + if (row > 1) { mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ALL_INPUT); mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ~(row_pos[row])); @@ -87,8 +87,10 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { bool changed = false; for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { changed |= read_cols_on_row(current_matrix, current_row); + #ifdef ENCODER_ENABLE - encoder_read(); + // Need to frequently read the encoder pins while scanning because the I/O expander takes a long time in comparison. + encoder_driver_task(); #endif } return changed; |