uint8_t matrix_scan(void) { #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { # if (DEBOUNCING_DELAY > 0) bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row); if (matrix_changed) { debouncing = true; debouncing_time = timer_read(); } # else read_cols_on_row(matrix, current_row); # endif } #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { # if (DEBOUNCING_DELAY > 0) bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col); if (matrix_changed) { debouncing = true; debouncing_time = timer_read(); } # else read_rows_on_col(matrix, current_col); # endif } #endif # if (DEBOUNCING_DELAY > 0) if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; } debouncing = false; } # endif matrix_scan_quantum(); return 1; }
bool custom_matrix_scan(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); } return changed; }
uint8_t _matrix_scan(void) { bool changed = false; #if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { changed |= read_cols_on_row(raw_matrix, current_row); } #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { changed |= read_rows_on_col(raw_matrix, current_col); } #endif debounce(raw_matrix, matrix + thisHand, ROWS_PER_HAND, changed); return 1; }
uint8_t matrix_scan(void) { bool changed = false; #if (DIODE_DIRECTION == COL2ROW) // Set row, read cols for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { changed |= read_cols_on_row(raw_matrix, current_row); } #elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { changed |= read_rows_on_col(raw_matrix, current_col); } #endif debounce(raw_matrix, matrix, MATRIX_ROWS, changed); matrix_scan_quantum(); return 1; }