Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
QMK Bot 2022-06-07 18:23:09 +00:00
commit 36109a887a

View file

@ -18,6 +18,8 @@
#include "matrix.h" #include "matrix.h"
#include "uart.h" #include "uart.h"
#define UART_MATRIX_RESPONSE_TIMEOUT 10000
void matrix_init_custom(void) { void matrix_init_custom(void) {
uart_init(1000000); uart_init(1000000);
} }
@ -39,11 +41,16 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
//harm to leave it in here //harm to leave it in here
while (!uart_available()) { while (!uart_available()) {
timeout++; timeout++;
if (timeout > 10000) { if (timeout > UART_MATRIX_RESPONSE_TIMEOUT) {
break; 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 //check for the end packet, the key state bytes use the LSBs, so 0xE0