aboutsummaryrefslogtreecommitdiff
path: root/keyboards/nullbitsco/common/remote_kb.c
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-11-14 05:23:14 +1100
committerGitHub <noreply@github.com>2021-11-13 18:23:14 +0000
commit04b51e381e2ff3f4c7aba662e1c817ce5daa931d (patch)
tree3b5c4415b94184f182d11e2629b405af9b3f0c57 /keyboards/nullbitsco/common/remote_kb.c
parent7e86c37962935e2f791864201b684345995f0b82 (diff)
downloadqmk_firmware-04b51e381e2ff3f4c7aba662e1c817ce5daa931d.tar.gz
qmk_firmware-04b51e381e2ff3f4c7aba662e1c817ce5daa931d.zip
Update UART driver API (#14839)
* Add uart_puts() and uart_gets() * Add some docs * Rework API * Formatting * Update docs/uart_driver.md Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * Simplify a uart_write() loop * Update platforms/avr/drivers/uart.c Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Sergey Vlasov <sigprof@gmail.com> Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'keyboards/nullbitsco/common/remote_kb.c')
-rw-r--r--keyboards/nullbitsco/common/remote_kb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/keyboards/nullbitsco/common/remote_kb.c b/keyboards/nullbitsco/common/remote_kb.c
index 89cbf9a92..4dcc9f461 100644
--- a/keyboards/nullbitsco/common/remote_kb.c
+++ b/keyboards/nullbitsco/common/remote_kb.c
@@ -63,9 +63,7 @@ static void send_msg(uint16_t keycode, bool pressed) {
63 msg[IDX_PRESSED] = pressed; 63 msg[IDX_PRESSED] = pressed;
64 msg[IDX_CHECKSUM] = chksum8(msg, UART_MSG_LEN-1); 64 msg[IDX_CHECKSUM] = chksum8(msg, UART_MSG_LEN-1);
65 65
66 for (int i=0; i<UART_MSG_LEN; i++) { 66 uart_transmit(msg, UART_MSG_LEN);
67 uart_putchar(msg[i]);
68 }
69} 67}
70 68
71static void print_message_buffer(void) { 69static void print_message_buffer(void) {
@@ -103,7 +101,7 @@ static void process_uart(void) {
103 101
104static void get_msg(void) { 102static void get_msg(void) {
105 while (uart_available()) { 103 while (uart_available()) {
106 msg[msg_idx] = uart_getchar(); 104 msg[msg_idx] = uart_read();
107 dprintf("idx: %u, recv: %u\n", msg_idx, msg[msg_idx]); 105 dprintf("idx: %u, recv: %u\n", msg_idx, msg[msg_idx]);
108 if (msg_idx == 0 && (msg[msg_idx] != UART_PREAMBLE)) { 106 if (msg_idx == 0 && (msg[msg_idx] != UART_PREAMBLE)) {
109 dprintf("Byte sync error!\n"); 107 dprintf("Byte sync error!\n");