Migrate more custom matrix 'lite' code to core (#7863)

* Migrate more custom matrix lite code to core

* Align function names

* fix up MATRIX_MASKED
This commit is contained in:
Joel Challis 2020-01-15 01:58:32 +00:00 committed by GitHub
parent 537b8713e5
commit 48cac9e3c8
Failed to generate hash of commit
9 changed files with 58 additions and 176 deletions

View file

@ -41,8 +41,8 @@ static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
#endif
/* matrix state(1:on, 0:off) */
static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
static matrix_row_t matrix[MATRIX_ROWS]; // debounced values
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
// row offsets for each hand
uint8_t thisHand, thatHand;
@ -50,12 +50,6 @@ uint8_t thisHand, thatHand;
// user-defined overridable functions
__attribute__((weak)) void matrix_slave_scan_user(void) {}
// helper functions
inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); }
inline matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
// matrix code
#ifdef DIRECT_PINS