summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/k2_pro/k2_pro.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keychron/k2_pro/k2_pro.c')
-rwxr-xr-x[-rw-r--r--]keyboards/keychron/k2_pro/k2_pro.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/keyboards/keychron/k2_pro/k2_pro.c b/keyboards/keychron/k2_pro/k2_pro.c
index 9442f20307..b63b20652b 100644..100755
--- a/keyboards/keychron/k2_pro/k2_pro.c
+++ b/keyboards/keychron/k2_pro/k2_pro.c
@@ -48,7 +48,7 @@ key_combination_t key_comb_list[4] = {
};
#ifdef KC_BLUETOOTH_ENABLE
-bool firstDisconnect = true;
+bool firstDisconnect = true;
bool bt_factory_reset = false;
static virtual_timer_t pairing_key_timer;
extern uint8_t g_pwm_buffer[DRIVER_COUNT][192];
@@ -154,7 +154,7 @@ void keyboard_post_init_kb(void) {
ckbt51_init(false);
bluetooth_init();
-# endif
+#endif
power_on_indicator_timer_buffer = sync_timer_read32() | 1;
writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE);
@@ -182,14 +182,15 @@ void matrix_scan_kb(void) {
#ifdef FACTORY_RESET_TASK
FACTORY_RESET_TASK();
-# endif
+#endif
matrix_scan_user();
}
#ifdef KC_BLUETOOTH_ENABLE
static void ckbt51_param_init(void) {
/* Set bluetooth device name */
- ckbt51_set_local_name(STR(PRODUCT));
+ // ckbt51_set_local_name(STR(PRODUCT));
+ ckbt51_set_local_name(PRODUCT);
/* Set bluetooth parameters */
module_param_t param = {.event_mode = 0x02,
.connected_idle_timeout = 7200,
@@ -201,6 +202,7 @@ static void ckbt51_param_init(void) {
.verndor_id = 0, // Must be 0x3434
.product_id = PRODUCT_ID};
ckbt51_set_param(&param);
+ (void)param;
}
void bluetooth_enter_disconnected_kb(uint8_t host_idx) {
@@ -217,6 +219,21 @@ void bluetooth_enter_disconnected_kb(uint8_t host_idx) {
}
}
+void ckbt51_default_ack_handler(uint8_t *data, uint8_t len) {
+ if (data[1] == 0x45) {
+ module_param_t param = {.event_mode = 0x02,
+ .connected_idle_timeout = 7200,
+ .pairing_timeout = 180,
+ .pairing_mode = 0,
+ .reconnect_timeout = 5,
+ .report_rate = 90,
+ .vendor_id_source = 1,
+ .verndor_id = 0, // Must be 0x3434
+ .product_id = PRODUCT_ID};
+ ckbt51_set_param(&param);
+ }
+}
+
void bluetooth_pre_task(void) {
static uint8_t mode = 1;