diff options
author | lokher <lokher@gmail.com> | 2023-09-07 15:35:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 15:35:26 +0800 |
commit | 41f7e6ddcb2648da2fd9cbca3d64955983e97bbe (patch) | |
tree | bebb89fabc13a505d1e57add472341e0dbdd1007 /keyboards/keychron/k11_pro/k11_pro.c | |
parent | 40283748598590e461de2f2e1b183750daaf64a6 (diff) | |
parent | 031f5132817f56f3c874be396815b3999349f8a2 (diff) |
Merge pull request #162 from lalalademaxiya1/k11_pro_encoder_fixed
k11 pro encoder fixed
Diffstat (limited to 'keyboards/keychron/k11_pro/k11_pro.c')
-rwxr-xr-x | keyboards/keychron/k11_pro/k11_pro.c | 14 |
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..6ad7649bab 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(ENCODER_ENABLE) +static void encoder_pad_cb(void *param) { encoder_inerrupt_read((uint32_t)param & 0xFF); } #endif @@ -156,16 +156,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 |