summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2021-03-25 06:33:18 -0500
committerGitHub <noreply@github.com>2021-03-25 22:33:18 +1100
commitff41c22fdccd30cdba44ba840d68261f74f45135 (patch)
treeb9711e03582216c297e365c2eb5247aead397e64
parent2f6236d1eab8601f097d4acb0553a4511b5c4be7 (diff)
downloadqmk_firmware-ff41c22fdccd30cdba44ba840d68261f74f45135.tar.gz
qmk_firmware-ff41c22fdccd30cdba44ba840d68261f74f45135.zip
Adding keyboard level weak function for slave matrix scan (#12317)
-rw-r--r--quantum/matrix.h5
-rw-r--r--quantum/split_common/matrix.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/quantum/matrix.h b/quantum/matrix.h
index ce57010a47..3fe691aaee 100644
--- a/quantum/matrix.h
+++ b/quantum/matrix.h
@@ -74,6 +74,11 @@ void matrix_scan_kb(void);
void matrix_init_user(void);
void matrix_scan_user(void);
+#ifdef SPLIT_KEYBOARD
+void matrix_slave_scan_kb(void);
+void matrix_slave_scan_user(void);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index d6636b886a..f8de17809d 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -43,6 +43,7 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
uint8_t thisHand, thatHand;
// user-defined overridable functions
+__attribute__((weak)) void matrix_slave_scan_kb(void) { matrix_slave_scan_user(); }
__attribute__((weak)) void matrix_slave_scan_user(void) {}
static inline void setPinOutput_writeLow(pin_t pin) {
@@ -284,7 +285,7 @@ bool matrix_post_scan(void) {
} else {
transport_slave(matrix + thatHand, matrix + thisHand);
- matrix_slave_scan_user();
+ matrix_slave_scan_kb();
}
return changed;