diff options
author | Alex Ong <alex.ong@unsw.edu.au> | 2021-08-07 16:51:38 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 23:51:38 -0700 |
commit | 8a9688bc64ea4283ecfa19dc2bf2c3312e7c646f (patch) | |
tree | c8057c093a03d3cdf3a49736ffb26bd800ddff20 | |
parent | 9d88786b6fc6b1e9eeeba409cb5e4a17dd2bbe82 (diff) | |
download | qmk_firmware-8a9688bc64ea4283ecfa19dc2bf2c3312e7c646f.tar.gz qmk_firmware-8a9688bc64ea4283ecfa19dc2bf2c3312e7c646f.zip |
[Keyboard] Use new matrix_output_select_delay api (#13861)
* Use new matrix_output_select_delay api
* Updated delay to 15 after more spamming
-rw-r--r-- | keyboards/handwired/xealousbrown/config.h | 7 | ||||
-rw-r--r-- | keyboards/handwired/xealousbrown/matrix.c | 10 | ||||
-rw-r--r-- | keyboards/handwired/xealousbrown/readme.md | 5 | ||||
-rw-r--r-- | keyboards/handwired/xealousbrown/rules.mk | 2 | ||||
-rw-r--r-- | keyboards/handwired/xealousbrown/xealousbrown.c | 6 |
5 files changed, 20 insertions, 10 deletions
diff --git a/keyboards/handwired/xealousbrown/config.h b/keyboards/handwired/xealousbrown/config.h index bf9ad3e05..70775ffae 100644 --- a/keyboards/handwired/xealousbrown/config.h +++ b/keyboards/handwired/xealousbrown/config.h | |||
@@ -32,6 +32,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
32 | #define USB_POLLING_INTERVAL_MS 1 | 32 | #define USB_POLLING_INTERVAL_MS 1 |
33 | /* layer optimization */ | 33 | /* layer optimization */ |
34 | #define LAYER_STATE_8BIT | 34 | #define LAYER_STATE_8BIT |
35 | #define MAX_LAYER 2 | ||
36 | |||
37 | //debug scanrate | ||
38 | //#define DEBUG_MATRIX_SCAN_RATE | ||
39 | //debug scans taking longer than one ms | ||
40 | //#define BENCHMARK_MATRIX | ||
41 | #define MATRIX_IO_DELAY 15 | ||
35 | /* | 42 | /* |
36 | * Keyboard Matrix Assignments | 43 | * Keyboard Matrix Assignments |
37 | * | 44 | * |
diff --git a/keyboards/handwired/xealousbrown/matrix.c b/keyboards/handwired/xealousbrown/matrix.c index cce0d06eb..ba86ab7af 100644 --- a/keyboards/handwired/xealousbrown/matrix.c +++ b/keyboards/handwired/xealousbrown/matrix.c | |||
@@ -28,7 +28,7 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values | |||
28 | 28 | ||
29 | // matrix code | 29 | // matrix code |
30 | // super fast read_cols code. | 30 | // super fast read_cols code. |
31 | static matrix_row_t read_cols(void) { | 31 | static inline matrix_row_t read_cols(void) { |
32 | return (PINC & (1 << 6) ? 0 : (1UL << 0)) | | 32 | return (PINC & (1 << 6) ? 0 : (1UL << 0)) | |
33 | (PIND & (1 << 7) ? 0 : (1UL << 1)) | | 33 | (PIND & (1 << 7) ? 0 : (1UL << 1)) | |
34 | (PINE & (1 << 6) ? 0 : (1UL << 2)) | | 34 | (PINE & (1 << 6) ? 0 : (1UL << 2)) | |
@@ -100,13 +100,17 @@ uint8_t matrix_scan_custom(matrix_row_t current_matrix[]) { | |||
100 | // Set row, read cols | 100 | // Set row, read cols |
101 | for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { | 101 | for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { |
102 | select_row(current_row); | 102 | select_row(current_row); |
103 | asm volatile("nop"); | 103 | matrix_output_select_delay(); |
104 | asm volatile("nop"); | 104 | |
105 | matrix_row_t cols = read_cols(); | 105 | matrix_row_t cols = read_cols(); |
106 | changed |= (current_matrix[current_row] != cols); | 106 | changed |= (current_matrix[current_row] != cols); |
107 | current_matrix[current_row] = cols; | 107 | current_matrix[current_row] = cols; |
108 | |||
108 | unselect_rows(); | 109 | unselect_rows(); |
110 | //this internally calls matrix_io_delay() | ||
111 | matrix_output_unselect_delay(); | ||
109 | } | 112 | } |
110 | 113 | ||
111 | return changed; | 114 | return changed; |
112 | } | 115 | } |
116 | |||
diff --git a/keyboards/handwired/xealousbrown/readme.md b/keyboards/handwired/xealousbrown/readme.md index bbc2233d1..fa5537e47 100644 --- a/keyboards/handwired/xealousbrown/readme.md +++ b/keyboards/handwired/xealousbrown/readme.md | |||
@@ -19,4 +19,7 @@ The brief list of speedhacks to make this keyboard blazing fast: | |||
19 | 3) Eager-per-key Debouncing algorithm (no 5ms delay before message is sent) | 19 | 3) Eager-per-key Debouncing algorithm (no 5ms delay before message is sent) |
20 | 4) 1000hz polling | 20 | 4) 1000hz polling |
21 | 21 | ||
22 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | 22 | See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the |
23 | [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. | ||
24 | |||
25 | Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). | ||
diff --git a/keyboards/handwired/xealousbrown/rules.mk b/keyboards/handwired/xealousbrown/rules.mk index df90cd030..04a01ec6b 100644 --- a/keyboards/handwired/xealousbrown/rules.mk +++ b/keyboards/handwired/xealousbrown/rules.mk | |||
@@ -25,7 +25,7 @@ SPACE_CADET_ENABLE = no # Unneeded feature. | |||
25 | LAYOUTS = 60_ansi | 25 | LAYOUTS = 60_ansi |
26 | 26 | ||
27 | # special sauce for this keyboard | 27 | # special sauce for this keyboard |
28 | DEBOUNCE_TYPE = eager_pk # Debounce using eager_pk. | 28 | DEBOUNCE_TYPE = sym_eager_pk # Debounce using eager_pk. |
29 | CUSTOM_MATRIX = lite # Custom matrix that polls at 7000hz instead of a measly 2000hz. | 29 | CUSTOM_MATRIX = lite # Custom matrix that polls at 7000hz instead of a measly 2000hz. |
30 | LTO_ENABLE = yes # smaller binary | 30 | LTO_ENABLE = yes # smaller binary |
31 | SRC += matrix.c | 31 | SRC += matrix.c |
diff --git a/keyboards/handwired/xealousbrown/xealousbrown.c b/keyboards/handwired/xealousbrown/xealousbrown.c index 03512b1ac..57c69bd31 100644 --- a/keyboards/handwired/xealousbrown/xealousbrown.c +++ b/keyboards/handwired/xealousbrown/xealousbrown.c | |||
@@ -50,13 +50,9 @@ void matrix_scan_user(void) { | |||
50 | 50 | ||
51 | last_timer = timer; | 51 | last_timer = timer; |
52 | if ((timer % 1000 == 0) && (timer != last_print_out)) { | 52 | if ((timer % 1000 == 0) && (timer != last_print_out)) { |
53 | print("Benchmark:"); | 53 | print("Scans: "); |
54 | print("\n"); | ||
55 | print_dec(timer); | ||
56 | print("\n"); | ||
57 | print_dec(scans); | 54 | print_dec(scans); |
58 | print("\n"); | 55 | print("\n"); |
59 | print("-------"); | ||
60 | scans = 0; | 56 | scans = 0; |
61 | last_print_out = timer; | 57 | last_print_out = timer; |
62 | } | 58 | } |