summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/bluetooth/bluetooth.c
diff options
context:
space:
mode:
authorlalalademaxiya1 <2831039915@qq.com>2023-09-13 15:42:01 +0800
committerlalalademaxiya1 <2831039915@qq.com>2023-09-13 15:42:01 +0800
commit747353348ecda25fd50ab47b802d1428f307fd1b (patch)
treeada65a50228fb93bcf07199e5d59dabe8c33b81f /keyboards/keychron/bluetooth/bluetooth.c
parent00af20f690b66b11c3c00826b5193a306b611ec4 (diff)
Added K10_Pro and K15_Pro
Diffstat (limited to 'keyboards/keychron/bluetooth/bluetooth.c')
-rw-r--r--keyboards/keychron/bluetooth/bluetooth.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/keyboards/keychron/bluetooth/bluetooth.c b/keyboards/keychron/bluetooth/bluetooth.c
index 481099af67..e87b435db4 100644
--- a/keyboards/keychron/bluetooth/bluetooth.c
+++ b/keyboards/keychron/bluetooth/bluetooth.c
@@ -291,6 +291,14 @@ uint8_t bluetooth_keyboard_leds(void) {
extern keymap_config_t keymap_config;
void bluetooth_send_keyboard(report_keyboard_t *report) {
+ if (battery_is_critical_low()) {
+ report_keyboard_t empty_report;
+ memset(&empty_report, 0, sizeof(empty_report));
+ if (memcmp(keyboard_report, &empty_report, sizeof(report_keyboard_t)) != 0) {
+ return;
+ }
+ }
+
if (bt_state == BLUETOOTH_PARING && !pincodeEntry) return;
if (bt_state == BLUETOOTH_CONNECTED || (bt_state == BLUETOOTH_PARING && pincodeEntry)) {
@@ -395,7 +403,7 @@ void bluetooth_low_battery_shutdown(void) {
indicator_battery_low_backlit_enable(false);
#endif
clear_keyboard();
- send_keyboard_report();
+ wait_ms(50);
bluetooth_disconnect();
}