preonic/rev3_drop: Fix old custom matrix code (#14857)

The old custom matrix code for Preonic rev3 was relying on the
`matrix_col_t` type, because the code actually reads the row pins and
assembles the state for whole columns, and then transposes the matrix in
the custom debouncing code.  Restore that type (which is no longer
defined by the core QMK code) to make the custom matrix code work
properly (when `matrix_row_t` was used instead of `matrix_col_t`, the
state of two electrical rows was lost, and those electrical rows
corresponded to the bottom physical row, which did not work).
This commit is contained in:
Sergey Vlasov 2021-10-18 03:09:33 +03:00 committed by GitHub
parent d2f9e352c8
commit 587f7508fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -24,13 +24,15 @@
#include "debug.h" #include "debug.h"
#include "matrix.h" #include "matrix.h"
typedef uint16_t matrix_col_t;
/* /*
* col: { B11, B10, B2, B1, A7, B0 } * col: { B11, B10, B2, B1, A7, B0 }
* row: { A10, A9, A8, B15, C13, C14, C15, A2 } * row: { A10, A9, A8, B15, C13, C14, C15, A2 }
*/ */
/* matrix state(1:on, 0:off) */ /* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS]; 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 bool debouncing = false;
static uint16_t debouncing_time = 0; static uint16_t debouncing_time = 0;
@ -66,7 +68,7 @@ void matrix_init(void) {
palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN);
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); 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(); matrix_init_quantum();
} }
@ -74,7 +76,7 @@ void matrix_init(void) {
uint8_t matrix_scan(void) { uint8_t matrix_scan(void) {
// actual matrix // actual matrix
for (int col = 0; col < MATRIX_COLS; col++) { 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 } // strobe col { B11, B10, B2, B1, A7, B0 }
switch (col) { switch (col) {