From 2dde284d1738c451f98505d6b961dbf3858e224a Mon Sep 17 00:00:00 2001 From: Michiel Visser Date: Mon, 23 Sep 2019 23:26:41 +0200 Subject: [PATCH] Start sending Bluetooth keystrokes directly This was added to support the SEND_STRING macros, which send all keystrokes at once without returning to the matrix update loop, which meant the update function did not run and the transmission buffer was not emptied. However, if you would like to use SEND_STRING macros with this commit you still need to use the delayed version, otherwise you will overwhelm the Bluetooth UART connection with keystrokes. Example: ``` send_string_with_delay_P(PSTR("QMK is the best thing ever!"), 50); ``` --- keyboards/anne_pro/anne_pro_bluetooth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/keyboards/anne_pro/anne_pro_bluetooth.c b/keyboards/anne_pro/anne_pro_bluetooth.c index 3465fa84a2..2058abf11e 100644 --- a/keyboards/anne_pro/anne_pro_bluetooth.c +++ b/keyboards/anne_pro/anne_pro_bluetooth.c @@ -349,6 +349,12 @@ static void send_keyboard(report_keyboard_t *report) { bluetooth_report[5+i] = report->keys[i]; } uart_tx_ringbuf_write(&bluetooth_uart_ringbuf, 11, bluetooth_report); + /* If the Bluetooth UART is currently not sending anything, start sending */ + if (bluetooth_uart_ringbuf.sending_elements == 0) { + if (bluetooth_wakeup() == MSG_OK) { + uart_tx_ringbuf_start_transmission(&bluetooth_uart_ringbuf); + } + } } /* Send mouse HID report for Bluetooth driver */