summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-06-07 18:23:09 +0000
committerQMK Bot <hello@qmk.fm>2022-06-07 18:23:09 +0000
commit36109a887a60f7c83b01006578790b86c3f158cd (patch)
tree1b90dd12d9682a5417c2ef53382e35e6226a6a30
parentb74509d4ae5b84cfc51dc086ac1495414a6b46c2 (diff)
parentc681b6dbf300270e3e93ab72a57d4a7c18d794e1 (diff)
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r--keyboards/redox_w/matrix.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/keyboards/redox_w/matrix.c b/keyboards/redox_w/matrix.c
index fd25231d9e..6a33e89976 100644
--- a/keyboards/redox_w/matrix.c
+++ b/keyboards/redox_w/matrix.c
@@ -18,6 +18,8 @@
#include "matrix.h"
#include "uart.h"
+#define UART_MATRIX_RESPONSE_TIMEOUT 10000
+
void matrix_init_custom(void) {
uart_init(1000000);
}
@@ -39,11 +41,16 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
//harm to leave it in here
while (!uart_available()) {
timeout++;
- if (timeout > 10000) {
+ if (timeout > UART_MATRIX_RESPONSE_TIMEOUT) {
break;
}
}
- uart_data[i] = uart_read();
+
+ if (timeout < UART_MATRIX_RESPONSE_TIMEOUT) {
+ uart_data[i] = uart_read();
+ } else {
+ uart_data[i] = 0x00;
+ }
}
//check for the end packet, the key state bytes use the LSBs, so 0xE0