diff --git a/keyboards/keychron/bluetooth/bluetooth.c b/keyboards/keychron/bluetooth/bluetooth.c index db9301ba4e..3f539e271f 100644 --- a/keyboards/keychron/bluetooth/bluetooth.c +++ b/keyboards/keychron/bluetooth/bluetooth.c @@ -452,6 +452,15 @@ void bluetooth_task(void) { lpm_task(); } +void send_string_task(void) { + if (get_transport() == TRANSPORT_BLUETOOTH && bluetooth_get_state()== BLUETOOTH_CONNECTED) { + bluetooth_transport.task(); +#ifndef DISABLE_REPORT_BUFFER + report_buffer_task(); +#endif + } +} + bluetooth_state_t bluetooth_get_state(void) { return bt_state; }; diff --git a/keyboards/keychron/bluetooth/bluetooth.h b/keyboards/keychron/bluetooth/bluetooth.h index 0ef14e0d06..44e8ffdc70 100644 --- a/keyboards/keychron/bluetooth/bluetooth.h +++ b/keyboards/keychron/bluetooth/bluetooth.h @@ -77,9 +77,11 @@ void bluetooth_enter_disconnected_kb(uint8_t host_idx); void bluetooth_enter_pin_code_entry_kb(void); void bluetooth_exit_pin_code_entry_kb(void); -void bluetooth_task(void); -void bluetooth_pre_task(void); -void bluetooth_post_task(void); +void bluetooth_task(void); +void bluetooth_pre_task(void); +void bluetooth_post_task(void); +void send_string_task(void); + bluetooth_state_t bluetooth_get_state(void); void bluetooth_low_battery_shutdown(void); diff --git a/quantum/send_string/send_string.c b/quantum/send_string/send_string.c index 4a707a3a88..a5058cdba7 100644 --- a/quantum/send_string/send_string.c +++ b/quantum/send_string/send_string.c @@ -26,6 +26,9 @@ #ifdef LK_WIRELESS_ENABLE #include "wireless.h" #endif +#if defined(KC_BLUETOOTH_ENABLE) +#include "bluetooth.h" +#endif #if defined(AUDIO_ENABLE) && defined(SENDSTRING_BELL) @@ -182,7 +185,7 @@ void send_string_with_delay(const char *string, uint8_t interval) { keycode = *(++string); } while (ms--) { -#ifdef LK_WIRELESS_ENABLE +#if defined(LK_WIRELESS_ENABLE) || defined(KC_BLUETOOTH_ENABLE) send_string_task(); #endif wait_ms(1); @@ -196,13 +199,13 @@ void send_string_with_delay(const char *string, uint8_t interval) { { uint8_t ms = interval; while (ms--) { -#ifdef LK_WIRELESS_ENABLE +#if defined(LK_WIRELESS_ENABLE) || defined(KC_BLUETOOTH_ENABLE) send_string_task(); #endif wait_ms(1); } } -#ifdef LK_WIRELESS_ENABLE +#if defined(LK_WIRELESS_ENABLE) || defined(KC_BLUETOOTH_ENABLE) send_string_task(); #endif }