Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preonic/rev3_drop: Fix old custom matrix code #14857

Merged
merged 1 commit into from
Oct 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions keyboards/preonic/rev3_drop/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
#include "debug.h"
#include "matrix.h"

typedef uint16_t matrix_col_t;

/*
* col: { B11, B10, B2, B1, A7, B0 }
* row: { A10, A9, A8, B15, C13, C14, C15, A2 }
*/
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_COLS];
static matrix_col_t matrix_debouncing[MATRIX_COLS];
static bool debouncing = false;
static uint16_t debouncing_time = 0;

Expand Down Expand Up @@ -66,15 +68,15 @@ void matrix_init(void) {
palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN);

memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t));
memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_col_t));

matrix_init_quantum();
}

uint8_t matrix_scan(void) {
// actual matrix
for (int col = 0; col < MATRIX_COLS; col++) {
matrix_row_t data = 0;
matrix_col_t data = 0;

// strobe col { B11, B10, B2, B1, A7, B0 }
switch (col) {
Expand Down