diff options
author | lalalademaxiya1 <2831039915@qq.com> | 2023-03-15 16:51:53 +0800 |
---|---|---|
committer | lalalademaxiya1 <2831039915@qq.com> | 2023-03-15 16:51:53 +0800 |
commit | c6243da12f6643747a24a7aa761e103cc4a848c2 (patch) | |
tree | 82d29a9567d09c2d3845654c7e5b16b284b2bc30 /keyboards/keychron/k8_pro/k8_pro.c | |
parent | ee715fc26ade41e56f47e60527f17d5cbdfb584b (diff) |
Update Keychron K Pro series keyboards
Diffstat (limited to 'keyboards/keychron/k8_pro/k8_pro.c')
-rwxr-xr-x[-rw-r--r--] | keyboards/keychron/k8_pro/k8_pro.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/keyboards/keychron/k8_pro/k8_pro.c b/keyboards/keychron/k8_pro/k8_pro.c index f8b4f6d99e..4b7a4f42fb 100644..100755 --- a/keyboards/keychron/k8_pro/k8_pro.c +++ b/keyboards/keychron/k8_pro/k8_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,14 +154,14 @@ 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); writePin(LED_CAPS_LOCK_PIN, LED_PIN_ON_STATE); -# ifdef KC_BLUETOOTH_ENABLE +#ifdef KC_BLUETOOTH_ENABLE writePin(H3, HOST_LED_PIN_ON_STATE); -# endif +#endif keyboard_post_init_user(); } @@ -189,14 +189,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, @@ -224,6 +225,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(¶m); + } +} + void bluetooth_pre_task(void) { static uint8_t mode = 1; |