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);
```
anne_pro
Michiel Visser 2019-09-23 23:26:41 +02:00
parent 49ed796056
commit 2dde284d17
1 changed files with 6 additions and 0 deletions

View File

@ -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 */