diff options
Diffstat (limited to 'drivers/oled/oled_driver.c')
| -rw-r--r-- | drivers/oled/oled_driver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c index 082115d53..8e5ed5f07 100644 --- a/drivers/oled/oled_driver.c +++ b/drivers/oled/oled_driver.c | |||
| @@ -115,7 +115,7 @@ bool oled_initialized = false; | |||
| 115 | bool oled_active = false; | 115 | bool oled_active = false; |
| 116 | bool oled_scrolling = false; | 116 | bool oled_scrolling = false; |
| 117 | uint8_t oled_brightness = OLED_BRIGHTNESS; | 117 | uint8_t oled_brightness = OLED_BRIGHTNESS; |
| 118 | uint8_t oled_rotation = 0; | 118 | oled_rotation_t oled_rotation = 0; |
| 119 | uint8_t oled_rotation_width = 0; | 119 | uint8_t oled_rotation_width = 0; |
| 120 | uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values | 120 | uint8_t oled_scroll_speed = 0; // this holds the speed after being remapped to ssd1306 internal values |
| 121 | uint8_t oled_scroll_start = 0; | 121 | uint8_t oled_scroll_start = 0; |
| @@ -158,7 +158,7 @@ static void InvertCharacter(uint8_t *cursor) { | |||
| 158 | } | 158 | } |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | bool oled_init(uint8_t rotation) { | 161 | bool oled_init(oled_rotation_t rotation) { |
| 162 | #if defined(USE_I2C) && defined(SPLIT_KEYBOARD) | 162 | #if defined(USE_I2C) && defined(SPLIT_KEYBOARD) |
| 163 | if (!is_keyboard_master()) { | 163 | if (!is_keyboard_master()) { |
| 164 | return true; | 164 | return true; |
| @@ -491,8 +491,9 @@ void oled_write_raw(const char *data, uint16_t size) { | |||
| 491 | uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; | 491 | uint16_t cursor_start_index = oled_cursor - &oled_buffer[0]; |
| 492 | if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; | 492 | if ((size + cursor_start_index) > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE - cursor_start_index; |
| 493 | for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { | 493 | for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) { |
| 494 | if (oled_buffer[i] == data[i]) continue; | 494 | uint8_t c = *data++; |
| 495 | oled_buffer[i] = data[i]; | 495 | if (oled_buffer[i] == c) continue; |
| 496 | oled_buffer[i] = c; | ||
| 496 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); | 497 | oled_dirty |= ((OLED_BLOCK_TYPE)1 << (i / OLED_BLOCK_SIZE)); |
| 497 | } | 498 | } |
| 498 | } | 499 | } |
