Skip to content

Commit

Permalink
Adding keyboard level weak function for slave matrix scan (qmk#12317)
Browse files Browse the repository at this point in the history
  • Loading branch information
XScorpion2 authored and obosob committed May 9, 2021
1 parent a2e5442 commit 012fb00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions quantum/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion quantum/split_common/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 012fb00

Please sign in to comment.