summaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/bpiphany/pegasushoof/2015/matrix.c12
-rw-r--r--keyboards/handwired/datahand/matrix.c15
-rw-r--r--keyboards/keyboardio/model01/matrix.c11
-rw-r--r--keyboards/matrix/noah/matrix.c11
-rw-r--r--keyboards/ymdk/sp64/matrix.c11
5 files changed, 58 insertions, 2 deletions
diff --git a/keyboards/bpiphany/pegasushoof/2015/matrix.c b/keyboards/bpiphany/pegasushoof/2015/matrix.c
index 42c5da3bc5..b05869feda 100644
--- a/keyboards/bpiphany/pegasushoof/2015/matrix.c
+++ b/keyboards/bpiphany/pegasushoof/2015/matrix.c
@@ -33,6 +33,18 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
static matrix_row_t read_cols(void);
static void select_row(uint8_t col);
+// user-defined overridable functions
+
+__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
+
+__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
+
+__attribute__((weak)) void matrix_init_user(void) {}
+
+__attribute__((weak)) void matrix_scan_user(void) {}
+
+// helper functions
+
inline uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
diff --git a/keyboards/handwired/datahand/matrix.c b/keyboards/handwired/datahand/matrix.c
index d276c47b2b..9eead28cd6 100644
--- a/keyboards/handwired/datahand/matrix.c
+++ b/keyboards/handwired/datahand/matrix.c
@@ -27,6 +27,17 @@ static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t read_cols(void);
static void select_row(uint8_t row);
+// user-defined overridable functions
+
+__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
+
+__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
+
+__attribute__((weak)) void matrix_init_user(void) {}
+
+__attribute__((weak)) void matrix_scan_user(void) {}
+
+// helper functions
void matrix_init(void) {
/* See datahand.h for more detail on pins. */
@@ -48,7 +59,7 @@ void matrix_init(void) {
/* Turn off the lock LEDs. */
PORTF |= LED_CAPS_LOCK | LED_NUM_LOCK | LED_SCROLL_LOCK | LED_MOUSE_LOCK;
- matrix_init_user();
+ matrix_init_quantum();
}
uint8_t matrix_scan(void) {
@@ -62,7 +73,7 @@ uint8_t matrix_scan(void) {
matrix[row] = read_cols();
}
- matrix_scan_user();
+ matrix_scan_quantum();
return 1;
}
diff --git a/keyboards/keyboardio/model01/matrix.c b/keyboards/keyboardio/model01/matrix.c
index 450e48d947..524ec9bdca 100644
--- a/keyboards/keyboardio/model01/matrix.c
+++ b/keyboards/keyboardio/model01/matrix.c
@@ -25,6 +25,17 @@
static matrix_row_t rows[MATRIX_ROWS];
#define ROWS_PER_HAND (MATRIX_ROWS / 2)
+// user-defined overridable functions
+
+__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
+
+__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
+
+__attribute__((weak)) void matrix_init_user(void) {}
+
+__attribute__((weak)) void matrix_scan_user(void) {}
+
+// helper functions
inline
uint8_t matrix_rows(void) {
return MATRIX_ROWS;
diff --git a/keyboards/matrix/noah/matrix.c b/keyboards/matrix/noah/matrix.c
index 94a27b181f..17f7a2fb62 100644
--- a/keyboards/matrix/noah/matrix.c
+++ b/keyboards/matrix/noah/matrix.c
@@ -26,6 +26,17 @@ static matrix_row_t matrix_debouncing[MATRIX_COLS];
static bool debouncing = false;
static uint16_t debouncing_time = 0;
+// user-defined overridable functions
+
+__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
+
+__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
+
+__attribute__((weak)) void matrix_init_user(void) {}
+
+__attribute__((weak)) void matrix_scan_user(void) {}
+
+// helper functions
void matrix_init(void)
{
//debug_enable = true;
diff --git a/keyboards/ymdk/sp64/matrix.c b/keyboards/ymdk/sp64/matrix.c
index 74bddc0578..9a6e37bcdc 100644
--- a/keyboards/ymdk/sp64/matrix.c
+++ b/keyboards/ymdk/sp64/matrix.c
@@ -38,6 +38,17 @@ static void matrix_select_row(uint8_t row);
static uint8_t mcp23018_reset_loop = 0;
#endif
+// user-defined overridable functions
+
+__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
+
+__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
+
+__attribute__((weak)) void matrix_init_user(void) {}
+
+__attribute__((weak)) void matrix_scan_user(void) {}
+
+// helper functions
void matrix_init(void)
{
// all outputs for rows high