aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/matrix.c5
-rw-r--r--quantum/matrix_common.c7
-rw-r--r--quantum/split_common/matrix.c5
3 files changed, 11 insertions, 6 deletions
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 6bd604bb7..67d8af6ee 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#include <stdint.h> 17#include <stdint.h>
18#include <stdbool.h> 18#include <stdbool.h>
19#include "wait.h"
20#include "util.h" 19#include "util.h"
21#include "matrix.h" 20#include "matrix.h"
22#include "debounce.h" 21#include "debounce.h"
@@ -94,7 +93,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
94 93
95 // Select row and wait for row selecton to stabilize 94 // Select row and wait for row selecton to stabilize
96 select_row(current_row); 95 select_row(current_row);
97 wait_us(30); 96 matrix_io_delay();
98 97
99 // For each col... 98 // For each col...
100 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 99 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
@@ -138,7 +137,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
138 137
139 // Select col and wait for col selecton to stabilize 138 // Select col and wait for col selecton to stabilize
140 select_col(current_col); 139 select_col(current_col);
141 wait_us(30); 140 matrix_io_delay();
142 141
143 // For each row... 142 // For each row...
144 for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) { 143 for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
diff --git a/quantum/matrix_common.c b/quantum/matrix_common.c
index c326e59ca..de62b8070 100644
--- a/quantum/matrix_common.c
+++ b/quantum/matrix_common.c
@@ -1,8 +1,13 @@
1#include "matrix.h" 1#include "matrix.h"
2#include "debounce.h" 2#include "debounce.h"
3#include "wait.h"
3#include "print.h" 4#include "print.h"
4#include "debug.h" 5#include "debug.h"
5 6
7#ifndef MATRIX_IO_DELAY
8# define MATRIX_IO_DELAY 30
9#endif
10
6/* matrix state(1:on, 0:off) */ 11/* matrix state(1:on, 0:off) */
7matrix_row_t raw_matrix[MATRIX_ROWS]; 12matrix_row_t raw_matrix[MATRIX_ROWS];
8matrix_row_t matrix[MATRIX_ROWS]; 13matrix_row_t matrix[MATRIX_ROWS];
@@ -78,6 +83,8 @@ uint8_t matrix_key_count(void) {
78 return count; 83 return count;
79} 84}
80 85
86__attribute__((weak)) void matrix_io_delay(void) { wait_us(MATRIX_IO_DELAY); }
87
81// CUSTOM MATRIX 'LITE' 88// CUSTOM MATRIX 'LITE'
82__attribute__((weak)) void matrix_init_custom(void) {} 89__attribute__((weak)) void matrix_init_custom(void) {}
83 90
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index 2c0e028f7..a82334128 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#include <stdint.h> 17#include <stdint.h>
18#include <stdbool.h> 18#include <stdbool.h>
19#include "wait.h"
20#include "util.h" 19#include "util.h"
21#include "matrix.h" 20#include "matrix.h"
22#include "debounce.h" 21#include "debounce.h"
@@ -111,7 +110,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
111 110
112 // Select row and wait for row selecton to stabilize 111 // Select row and wait for row selecton to stabilize
113 select_row(current_row); 112 select_row(current_row);
114 wait_us(30); 113 matrix_io_delay();
115 114
116 // For each col... 115 // For each col...
117 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { 116 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
@@ -155,7 +154,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
155 154
156 // Select col and wait for col selecton to stabilize 155 // Select col and wait for col selecton to stabilize
157 select_col(current_col); 156 select_col(current_col);
158 wait_us(30); 157 matrix_io_delay();
159 158
160 // For each row... 159 // For each row...
161 for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { 160 for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) {