diff options
Diffstat (limited to 'keyboards/xd84/custom_matrix_helper.c')
-rw-r--r-- | keyboards/xd84/custom_matrix_helper.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/keyboards/xd84/custom_matrix_helper.c b/keyboards/xd84/custom_matrix_helper.c index a4c5b6afa..e4e256381 100644 --- a/keyboards/xd84/custom_matrix_helper.c +++ b/keyboards/xd84/custom_matrix_helper.c | |||
@@ -23,72 +23,16 @@ | |||
23 | #include "debounce.h" | 23 | #include "debounce.h" |
24 | #include "quantum.h" | 24 | #include "quantum.h" |
25 | 25 | ||
26 | //_____COMMON__________________________________________________________________ | ||
27 | // user-defined overridable functions | ||
28 | __attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } | ||
29 | __attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } | ||
30 | __attribute__((weak)) void matrix_init_user(void) {} | ||
31 | __attribute__((weak)) void matrix_scan_user(void) {} | ||
32 | |||
33 | |||
34 | //_____COULD BE COMMON_________________________________________________________ | 26 | //_____COULD BE COMMON_________________________________________________________ |
35 | /* matrix state(1:on, 0:off) */ | 27 | /* matrix state(1:on, 0:off) */ |
36 | /*static*/ matrix_row_t raw_matrix[MATRIX_ROWS]; | 28 | /*static*/ matrix_row_t raw_matrix[MATRIX_ROWS]; |
37 | /*static*/ matrix_row_t matrix[MATRIX_ROWS]; | 29 | /*static*/ matrix_row_t matrix[MATRIX_ROWS]; |
38 | 30 | ||
39 | #if (MATRIX_COLS <= 8) | ||
40 | # define print_matrix_header() print("\nr/c 01234567\n") | ||
41 | # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) | ||
42 | # define matrix_bitpop(i) bitpop(matrix[i]) | ||
43 | # define ROW_SHIFTER ((uint8_t)1) | ||
44 | #elif (MATRIX_COLS <= 16) | ||
45 | # define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") | ||
46 | # define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) | ||
47 | # define matrix_bitpop(i) bitpop16(matrix[i]) | ||
48 | # define ROW_SHIFTER ((uint16_t)1) | ||
49 | #elif (MATRIX_COLS <= 32) | ||
50 | # define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") | ||
51 | # define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) | ||
52 | # define matrix_bitpop(i) bitpop32(matrix[i]) | ||
53 | # define ROW_SHIFTER ((uint32_t)1) | ||
54 | #endif | ||
55 | |||
56 | __attribute__ ((weak)) | ||
57 | uint8_t matrix_rows(void) { | ||
58 | return MATRIX_ROWS; | ||
59 | } | ||
60 | |||
61 | __attribute__ ((weak)) | ||
62 | uint8_t matrix_cols(void) { | ||
63 | return MATRIX_COLS; | ||
64 | } | ||
65 | |||
66 | __attribute__ ((weak)) | 31 | __attribute__ ((weak)) |
67 | matrix_row_t matrix_get_row(uint8_t row) { | 32 | matrix_row_t matrix_get_row(uint8_t row) { |
68 | return matrix[row]; | 33 | return matrix[row]; |
69 | } | 34 | } |
70 | 35 | ||
71 | __attribute__ ((weak)) | ||
72 | uint8_t matrix_key_count(void) { | ||
73 | uint8_t count = 0; | ||
74 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
75 | count += matrix_bitpop(i); | ||
76 | } | ||
77 | return count; | ||
78 | } | ||
79 | |||
80 | __attribute__ ((weak)) | ||
81 | void matrix_print(void) { | ||
82 | print_matrix_header(); | ||
83 | |||
84 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
85 | phex(row); print(": "); | ||
86 | print_matrix_row(row); | ||
87 | print("\n"); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | |||
92 | //_____CUSTOM MATRIX 'LITE'____________________________________________________ | 36 | //_____CUSTOM MATRIX 'LITE'____________________________________________________ |
93 | __attribute__ ((weak)) | 37 | __attribute__ ((weak)) |
94 | void custom_matrix_init(void) { | 38 | void custom_matrix_init(void) { |