Skip to content

Commit 22a7edd

Browse files
drashnaBilly Bryant
authored andcommitted
[Bug] Fix compile issues for boards with custom matrix (qmk#14323)
1 parent 060db37 commit 22a7edd

File tree

5 files changed

+58
-2
lines changed

5 files changed

+58
-2
lines changed

keyboards/bpiphany/pegasushoof/2015/matrix.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
3333
static matrix_row_t read_cols(void);
3434
static void select_row(uint8_t col);
3535

36+
// user-defined overridable functions
37+
38+
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
39+
40+
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
41+
42+
__attribute__((weak)) void matrix_init_user(void) {}
43+
44+
__attribute__((weak)) void matrix_scan_user(void) {}
45+
46+
// helper functions
47+
3648
inline uint8_t matrix_rows(void)
3749
{
3850
return MATRIX_ROWS;

keyboards/handwired/datahand/matrix.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ static matrix_row_t matrix[MATRIX_ROWS];
2727
static matrix_row_t read_cols(void);
2828
static void select_row(uint8_t row);
2929

30+
// user-defined overridable functions
31+
32+
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
33+
34+
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
35+
36+
__attribute__((weak)) void matrix_init_user(void) {}
37+
38+
__attribute__((weak)) void matrix_scan_user(void) {}
39+
40+
// helper functions
3041
void matrix_init(void) {
3142
/* See datahand.h for more detail on pins. */
3243

@@ -48,7 +59,7 @@ void matrix_init(void) {
4859
/* Turn off the lock LEDs. */
4960
PORTF |= LED_CAPS_LOCK | LED_NUM_LOCK | LED_SCROLL_LOCK | LED_MOUSE_LOCK;
5061

51-
matrix_init_user();
62+
matrix_init_quantum();
5263
}
5364

5465
uint8_t matrix_scan(void) {
@@ -62,7 +73,7 @@ uint8_t matrix_scan(void) {
6273
matrix[row] = read_cols();
6374
}
6475

65-
matrix_scan_user();
76+
matrix_scan_quantum();
6677

6778
return 1;
6879
}

keyboards/keyboardio/model01/matrix.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
static matrix_row_t rows[MATRIX_ROWS];
2626
#define ROWS_PER_HAND (MATRIX_ROWS / 2)
2727

28+
// user-defined overridable functions
29+
30+
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
31+
32+
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
33+
34+
__attribute__((weak)) void matrix_init_user(void) {}
35+
36+
__attribute__((weak)) void matrix_scan_user(void) {}
37+
38+
// helper functions
2839
inline
2940
uint8_t matrix_rows(void) {
3041
return MATRIX_ROWS;

keyboards/matrix/noah/matrix.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ static matrix_row_t matrix_debouncing[MATRIX_COLS];
2626
static bool debouncing = false;
2727
static uint16_t debouncing_time = 0;
2828

29+
// user-defined overridable functions
30+
31+
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
32+
33+
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
34+
35+
__attribute__((weak)) void matrix_init_user(void) {}
36+
37+
__attribute__((weak)) void matrix_scan_user(void) {}
38+
39+
// helper functions
2940
void matrix_init(void)
3041
{
3142
//debug_enable = true;

keyboards/ymdk/sp64/matrix.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ static void matrix_select_row(uint8_t row);
3838
static uint8_t mcp23018_reset_loop = 0;
3939
#endif
4040

41+
// user-defined overridable functions
42+
43+
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
44+
45+
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
46+
47+
__attribute__((weak)) void matrix_init_user(void) {}
48+
49+
__attribute__((weak)) void matrix_scan_user(void) {}
50+
51+
// helper functions
4152
void matrix_init(void)
4253
{
4354
// all outputs for rows high

0 commit comments

Comments
 (0)