1
0
Fork 0
forked from forks/qmk_firmware

Fix connection issue in split keyboards when slave and OLED display are connected via I2C, fix #9335 (#11487)

* In split keyboards fix connection issue when slave and OLED are connected via I2C. Fix #9335

* Revert "In split keyboards fix connection issue when slave and OLED are connected via I2C. Fix #9335"

This reverts commit 3ee639e1f3.

* In split keyboards fix connection issue when slave and OLED are connected via I2C. Fix #9335

* Update drivers/oled/oled_driver.c

Co-authored-by: Drashna Jaelre <drashna@live.com>

Co-authored-by: osenchenko <osechenko@chiefmate.io>
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
Oleg Senchenko 2021-03-25 15:42:25 +03:00 committed by GitHub
parent e2b652d95f
commit b05565f368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "progmem.h" #include "progmem.h"
#include "keyboard.h"
// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf // Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
// for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf // for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf
@ -152,6 +154,10 @@ static void InvertCharacter(uint8_t *cursor) {
} }
bool oled_init(uint8_t rotation) { bool oled_init(uint8_t rotation) {
#if defined(USE_I2C) && defined(SPLIT_KEYBOARD)
if (!is_keyboard_master()) { return true; }
#endif
oled_rotation = oled_init_user(rotation); oled_rotation = oled_init_user(rotation);
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
oled_rotation_width = OLED_DISPLAY_WIDTH; oled_rotation_width = OLED_DISPLAY_WIDTH;