Skip to content

Commit

Permalink
Start sending Bluetooth keystrokes directly
Browse files Browse the repository at this point in the history
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);
```
  • Loading branch information
msvisser committed Sep 23, 2019
1 parent 49ed796 commit 2dde284
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions keyboards/anne_pro/anne_pro_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 2dde284

Please sign in to comment.