diff options
Diffstat (limited to 'drivers/oled')
-rw-r--r-- | drivers/oled/oled_driver.c | 8 | ||||
-rw-r--r-- | drivers/oled/oled_driver.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c index 92c64399e..6c1238cd6 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/>. | |||
24 | 24 | ||
25 | #include "progmem.h" | 25 | #include "progmem.h" |
26 | 26 | ||
27 | #include "keyboard.h" | ||
28 | |||
27 | // Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf | 29 | // Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf |
28 | // for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf | 30 | // for SH1106: https://www.velleman.eu/downloads/29/infosheets/sh1106_datasheet.pdf |
29 | 31 | ||
@@ -152,6 +154,12 @@ static void InvertCharacter(uint8_t *cursor) { | |||
152 | } | 154 | } |
153 | 155 | ||
154 | bool oled_init(uint8_t rotation) { | 156 | bool oled_init(uint8_t rotation) { |
157 | #if defined(USE_I2C) && defined(SPLIT_KEYBOARD) | ||
158 | if (!is_keyboard_master()) { | ||
159 | return true; | ||
160 | } | ||
161 | #endif | ||
162 | |||
155 | oled_rotation = oled_init_user(rotation); | 163 | oled_rotation = oled_init_user(rotation); |
156 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { | 164 | if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) { |
157 | oled_rotation_width = OLED_DISPLAY_WIDTH; | 165 | oled_rotation_width = OLED_DISPLAY_WIDTH; |
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h index 72ab21247..00896f01c 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/>. | |||
158 | # define OLED_I2C_TIMEOUT 100 | 158 | # define OLED_I2C_TIMEOUT 100 |
159 | #endif | 159 | #endif |
160 | 160 | ||
161 | #if !defined(OLED_UPDATE_INTERVAL) && defined(SPLIT_KEYBOARD) | ||
162 | # define OLED_UPDATE_INTERVAL 50 | ||
163 | #endif | ||
164 | |||
161 | typedef struct __attribute__((__packed__)) { | 165 | typedef struct __attribute__((__packed__)) { |
162 | uint8_t *current_element; | 166 | uint8_t *current_element; |
163 | uint16_t remaining_element_count; | 167 | uint16_t remaining_element_count; |