summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/q8_pro/q8_pro.c
diff options
context:
space:
mode:
authorlalalademaxiya1 <2831039915@qq.com>2023-10-16 10:57:35 +0800
committerlalalademaxiya1 <2831039915@qq.com>2023-10-16 10:57:35 +0800
commit39503982d15af018f55b536f3d2671ae58e58df3 (patch)
treea5d9f8a9708a4c0fdc9f06dd9b2faf63f49b9cec /keyboards/keychron/q8_pro/q8_pro.c
parent156b2cf426f960cf4c6de0818dc5999f5d68903c (diff)
parent00af20f690b66b11c3c00826b5193a306b611ec4 (diff)
Merge branch 'temp' into keychron_k5_pro
Diffstat (limited to 'keyboards/keychron/q8_pro/q8_pro.c')
-rwxr-xr-xkeyboards/keychron/q8_pro/q8_pro.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/keyboards/keychron/q8_pro/q8_pro.c b/keyboards/keychron/q8_pro/q8_pro.c
index eade1dce33..aa0426149a 100755
--- a/keyboards/keychron/q8_pro/q8_pro.c
+++ b/keyboards/keychron/q8_pro/q8_pro.c
@@ -134,9 +134,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return true;
}
-#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE)
+#if defined(ENCODER_ENABLE)
static void encoder_pad_cb(void *param) {
- encoder_inerrupt_read((uint32_t)param & 0XFF);
+ encoder_inerrupt_read((uint32_t)param & 0xFF);
}
#endif
@@ -156,8 +156,9 @@ void keyboard_post_init_kb(void) {
ckbt51_init(false);
bluetooth_init();
+#endif
-# ifdef ENCODER_ENABLE
+#ifdef ENCODER_ENABLE
pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A;
pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B;
for (uint32_t i = 0; i < NUM_ENCODERS; i++) {
@@ -166,7 +167,6 @@ void keyboard_post_init_kb(void) {
palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i);
palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i);
}
-# endif
#endif
keyboard_post_init_user();
@@ -312,3 +312,9 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
}
}
#endif
+
+void suspend_wakeup_init_kb(void) {
+ // code will run on keyboard wakeup
+ clear_keyboard();
+ send_keyboard_report();
+}