summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/q6_pro/q6_pro.c
diff options
context:
space:
mode:
authorlalalademaxiya1 <2831039915@qq.com>2023-06-05 17:23:24 +0800
committerlalalademaxiya1 <2831039915@qq.com>2023-06-05 17:23:24 +0800
commit3707b542c498ab833c0829c99de2102d01410adf (patch)
tree16fb85bf1bd6984beb7335f3a04a3427ab0bf967 /keyboards/keychron/q6_pro/q6_pro.c
parentef737f8529ad964aeca85bff62d9762e6b2ba621 (diff)
Update q6_pro.c fixed the wrong pid and device name after factory reset
Diffstat (limited to 'keyboards/keychron/q6_pro/q6_pro.c')
-rwxr-xr-xkeyboards/keychron/q6_pro/q6_pro.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/keyboards/keychron/q6_pro/q6_pro.c b/keyboards/keychron/q6_pro/q6_pro.c
index 10759ea81d..5ad0d2d5f6 100755
--- a/keyboards/keychron/q6_pro/q6_pro.c
+++ b/keyboards/keychron/q6_pro/q6_pro.c
@@ -87,6 +87,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
}
return false; // Skip all further processing of this key)
case KC_TASK:
+ if (record->event.pressed) {
+ ckbt51_factory_reset();
+ }
case KC_FILE:
case KC_SNAP:
case KC_CTANA:
@@ -177,11 +180,10 @@ void keyboard_post_init_kb(void) {
static void ckbt51_param_init(void);
void matrix_scan_kb(void) {
- if (factory_timer_buffer && timer_elapsed32(factory_timer_buffer) > 20000) {
+ if (factory_timer_buffer && timer_elapsed32(factory_timer_buffer) > 2000) {
factory_timer_buffer = 0;
if (bt_factory_reset) {
bt_factory_reset = false;
- ckbt51_param_init();
palWriteLine(CKBT51_RESET_PIN, PAL_LOW);
wait_ms(5);
palWriteLine(CKBT51_RESET_PIN, PAL_HIGH);
@@ -214,7 +216,6 @@ static void ckbt51_param_init(void) {
/* Set bluetooth device name */
// ckbt51_set_local_name(STR(PRODUCT));
ckbt51_set_local_name(PRODUCT);
- wait_ms(10);
/* Set bluetooth parameters */
module_param_t param = {.event_mode = 0x02,
.connected_idle_timeout = 7200,
@@ -230,6 +231,7 @@ static void ckbt51_param_init(void) {
void bluetooth_enter_disconnected_kb(uint8_t host_idx) {
if (bt_factory_reset) {
+ ckbt51_param_init();
factory_timer_buffer = timer_read32();
}