summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/k11_pro/k11_pro.c
diff options
context:
space:
mode:
authorlalalademaxiya1 <2831039915@qq.com>2023-08-15 11:50:34 +0800
committerlalalademaxiya1 <2831039915@qq.com>2023-08-15 11:50:34 +0800
commit940411d2cb1702e2b3cb5e0e563d328da1005029 (patch)
tree1f15e7a571552057987eac5dfcbd649fa124e33f /keyboards/keychron/k11_pro/k11_pro.c
parent619fe01bc3635683ea158f6885b4b3dd20e512f0 (diff)
Add pad interrupt of k11 pro knob version
Diffstat (limited to 'keyboards/keychron/k11_pro/k11_pro.c')
-rwxr-xr-xkeyboards/keychron/k11_pro/k11_pro.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/keyboards/keychron/k11_pro/k11_pro.c b/keyboards/keychron/k11_pro/k11_pro.c
index 9189ef8586..3c02df0c4f 100755
--- a/keyboards/keychron/k11_pro/k11_pro.c
+++ b/keyboards/keychron/k11_pro/k11_pro.c
@@ -135,8 +135,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return true;
}
-#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENBALE)
-static void encoder0_pad_cb(void *param) {
+#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE)
+static void encoder_pad_cb(void *param) {
encoder_inerrupt_read((uint32_t)param & 0xFF);
}
#endif
@@ -157,16 +157,16 @@ void keyboard_post_init_kb(void) {
ckbt51_init(false);
bluetooth_init();
-#endif
-#ifdef ENCODER_ENBALE
+# ifdef ENCODER_ENABLE
pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A;
pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B;
- for (uint8_t i = 0; i < NUM_ENCODERS; i++) {
+ for (uint32_t i = 0; i < NUM_ENCODERS; i++) {
palEnableLineEvent(encoders_pad_a[i], PAL_EVENT_MODE_BOTH_EDGES);
palEnableLineEvent(encoders_pad_b[i], PAL_EVENT_MODE_BOTH_EDGES);
- palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, &i);
- palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, &i);
+ palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i);
+ palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i);
}
+# endif
#endif
power_on_indicator_timer_buffer = sync_timer_read32() | 1;