Skip to content

Commit

Permalink
In split keyboards fix connection issue when slave and OLED are conne…
Browse files Browse the repository at this point in the history
…cted via I2C. Fix qmk#9335
  • Loading branch information
osenchenko committed Jan 2, 2021
1 parent 2e9d091 commit 3ee639e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tmk_core/common/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3ee639e

Please sign in to comment.