From 3ee639e1f35fb0fe257fc3ba1095124e039af7d7 Mon Sep 17 00:00:00 2001 From: osenchenko Date: Sat, 2 Jan 2021 22:12:29 +0300 Subject: [PATCH] In split keyboards fix connection issue when slave and OLED are connected via I2C. Fix #9335 --- tmk_core/common/keyboard.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 8c7bdc8b55f0..9e169252a39f 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -263,8 +263,14 @@ void keyboard_init(void) { qwiic_init(); #endif #ifdef OLED_DRIVER_ENABLE +#if defined(SPLIT_KEYBOARD) && defined(USE_I2C) + if (is_keyboard_master()) { + oled_init(OLED_ROTATION_0); + } +#else oled_init(OLED_ROTATION_0); #endif +#endif #ifdef PS2_MOUSE_ENABLE ps2_mouse_init(); #endif @@ -404,12 +410,22 @@ void keyboard_task(void) { #endif #ifdef OLED_DRIVER_ENABLE +#if defined(SPLIT_KEYBOARD) && defined(USE_I2C) + if (is_keyboard_master()) { + oled_task(); + #ifndef OLED_DISABLE_TIMEOUT + // Wake up oled if user is using those fabulous keys! + if (ret) oled_on(); + #endif + } +#else oled_task(); # ifndef OLED_DISABLE_TIMEOUT // Wake up oled if user is using those fabulous keys! if (ret) oled_on(); # endif #endif +#endif #ifdef MOUSEKEY_ENABLE // mousekey repeat & acceleration