Skip to content

Commit b2c1745

Browse files
XScorpion2nhongooi
authored andcommitted
Adding keyboard level weak function for slave matrix scan (qmk#12317)
1 parent cc19442 commit b2c1745

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

quantum/matrix.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ void matrix_scan_kb(void);
7474
void matrix_init_user(void);
7575
void matrix_scan_user(void);
7676

77+
#ifdef SPLIT_KEYBOARD
78+
void matrix_slave_scan_kb(void);
79+
void matrix_slave_scan_user(void);
80+
#endif
81+
7782
#ifdef __cplusplus
7883
}
7984
#endif

quantum/split_common/matrix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
4343
uint8_t thisHand, thatHand;
4444

4545
// user-defined overridable functions
46+
__attribute__((weak)) void matrix_slave_scan_kb(void) { matrix_slave_scan_user(); }
4647
__attribute__((weak)) void matrix_slave_scan_user(void) {}
4748

4849
static inline void setPinOutput_writeLow(pin_t pin) {
@@ -284,7 +285,7 @@ bool matrix_post_scan(void) {
284285
} else {
285286
transport_slave(matrix + thatHand, matrix + thisHand);
286287

287-
matrix_slave_scan_user();
288+
matrix_slave_scan_kb();
288289
}
289290

290291
return changed;

0 commit comments

Comments
 (0)