diff options
author | Ryan <fauxpark@gmail.com> | 2021-11-14 05:23:14 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 18:23:14 +0000 |
commit | 04b51e381e2ff3f4c7aba662e1c817ce5daa931d (patch) | |
tree | 3b5c4415b94184f182d11e2629b405af9b3f0c57 /keyboards | |
parent | 7e86c37962935e2f791864201b684345995f0b82 (diff) |
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')
-rw-r--r-- | keyboards/mschwingen/modelm/modelm.c | 2 | ||||
-rw-r--r-- | keyboards/nullbitsco/common/remote_kb.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/keyboards/mschwingen/modelm/modelm.c b/keyboards/mschwingen/modelm/modelm.c index c1180612ad..7dcd4ac024 100644 --- a/keyboards/mschwingen/modelm/modelm.c +++ b/keyboards/mschwingen/modelm/modelm.c @@ -27,7 +27,7 @@ # undef sendchar static int8_t capture_sendchar(uint8_t c) { // sendchar(c); - uart_putchar(c); + uart_write(c); return 0; } #endif diff --git a/keyboards/nullbitsco/common/remote_kb.c b/keyboards/nullbitsco/common/remote_kb.c index 89cbf9a92a..4dcc9f4616 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) { msg[IDX_PRESSED] = pressed; msg[IDX_CHECKSUM] = chksum8(msg, UART_MSG_LEN-1); - for (int i=0; i<UART_MSG_LEN; i++) { - uart_putchar(msg[i]); - } + uart_transmit(msg, UART_MSG_LEN); } static void print_message_buffer(void) { @@ -103,7 +101,7 @@ static void process_uart(void) { static void get_msg(void) { while (uart_available()) { - msg[msg_idx] = uart_getchar(); + msg[msg_idx] = uart_read(); dprintf("idx: %u, recv: %u\n", msg_idx, msg[msg_idx]); if (msg_idx == 0 && (msg[msg_idx] != UART_PREAMBLE)) { dprintf("Byte sync error!\n"); |