diff options
Diffstat (limited to 'keyboards')
-rwxr-xr-x | keyboards/keychron/k11_pro/k11_pro.c | 6 | ||||
-rwxr-xr-x | keyboards/keychron/q8_pro/halconf.h | 5 | ||||
-rwxr-xr-x | keyboards/keychron/q8_pro/q8_pro.c | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/keyboards/keychron/k11_pro/k11_pro.c b/keyboards/keychron/k11_pro/k11_pro.c index 3c02df0c4f..6ad7649bab 100755 --- a/keyboards/keychron/k11_pro/k11_pro.c +++ b/keyboards/keychron/k11_pro/k11_pro.c @@ -135,7 +135,7 @@ 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); } @@ -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 power_on_indicator_timer_buffer = sync_timer_read32() | 1; diff --git a/keyboards/keychron/q8_pro/halconf.h b/keyboards/keychron/q8_pro/halconf.h index 8d8e138e4e..35209171cc 100755 --- a/keyboards/keychron/q8_pro/halconf.h +++ b/keyboards/keychron/q8_pro/halconf.h @@ -20,8 +20,11 @@ #define HAL_USE_I2C TRUE -#ifdef KC_BLUETOOTH_ENABLE +#if defined(ENCODER_ENBALE) || defined(KC_BLUETOOTH_ENABLE) # define PAL_USE_CALLBACKS TRUE +#endif + +#ifdef KC_BLUETOOTH_ENABLE # define HAL_USE_SERIAL TRUE # define HAL_USE_RTC TRUE #endif diff --git a/keyboards/keychron/q8_pro/q8_pro.c b/keyboards/keychron/q8_pro/q8_pro.c index 14bb965a82..aa0426149a 100755 --- a/keyboards/keychron/q8_pro/q8_pro.c +++ b/keyboards/keychron/q8_pro/q8_pro.c @@ -134,7 +134,7 @@ 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); } @@ -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(); |