summaryrefslogtreecommitdiff
path: root/drivers/oled
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oled')
-rw-r--r--drivers/oled/oled_driver.c8
-rw-r--r--drivers/oled/oled_driver.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c
index 92c64399e2..6c1238cd6f 100644
--- a/drivers/oled/oled_driver.c
+++ b/drivers/oled/oled_driver.c
@@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "progmem.h"
+#include "keyboard.h"
+
// 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
@@ -152,6 +154,12 @@ static void InvertCharacter(uint8_t *cursor) {
}
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);
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
oled_rotation_width = OLED_DISPLAY_WIDTH;
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index 72ab21247d..00896f01c2 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -158,6 +158,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define OLED_I2C_TIMEOUT 100
#endif
+#if !defined(OLED_UPDATE_INTERVAL) && defined(SPLIT_KEYBOARD)
+# define OLED_UPDATE_INTERVAL 50
+#endif
+
typedef struct __attribute__((__packed__)) {
uint8_t *current_element;
uint16_t remaining_element_count;