#include "quantum.h" static uint8_t debouncing = DEBOUNCE; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static uint8_t read_rows(void); static void init_rows(void); static void init_cols(void); static void unselect_cols(void); static void select_col(uint8_t col); __attribute__ ((weak)) void matrix_init_kb(void) { } __attribute__ ((weak)) void matrix_scan_kb(void) { } __attribute__ ((weak)) void matrix_init_user(void) {} __attribute__ ((weak)) void matrix_scan_user(void) {} void matrix_init(void) { //setPinOutput(F0); //writePinHigh(F0); setPinOutput(B4); writePinLow(B4); init_cols(); init_rows(); for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; matrix_debouncing[i] = 0; } matrix_init_quantum(); } uint8_t matrix_scan(void) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { select_col(col); _delay_us(3); uint8_t rows = read_rows(); for (uint8_t row = 0; row < MATRIX_ROWS; row++) { bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<