aboutsummaryrefslogtreecommitdiff
path: root/drivers/oled/oled_driver.c
diff options
context:
space:
mode:
authorRyan Caltabiano <rcalt2vt@gmail.com>2019-04-16 18:36:55 -0500
committerskullydazed <skullydazed@users.noreply.github.com>2019-04-20 08:05:10 -0700
commitdd3a813f871b911012da55a499955307c309a7a5 (patch)
tree80df58d039a9b20283057809925a2351121135d5 /drivers/oled/oled_driver.c
parent0a645225b9c863a106921185a6c2e0c340f10694 (diff)
downloadqmk_firmware-dd3a813f871b911012da55a499955307c309a7a5.tar.gz
qmk_firmware-dd3a813f871b911012da55a499955307c309a7a5.zip
Reducing size of data send in one frame & update Zen rev2 oled usage
Diffstat (limited to 'drivers/oled/oled_driver.c')
-rw-r--r--drivers/oled/oled_driver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c
index aa025d7a4..96ea58ccb 100644
--- a/drivers/oled/oled_driver.c
+++ b/drivers/oled/oled_driver.c
@@ -203,7 +203,7 @@ bool oled_init(uint8_t rotation) {
203} 203}
204 204
205__attribute__((weak)) 205__attribute__((weak))
206uint8_t oled_init_user(uint8_t rotation) { 206oled_rotation_t oled_init_user(oled_rotation_t rotation) {
207 return rotation; 207 return rotation;
208} 208}
209 209
@@ -384,7 +384,10 @@ void oled_write_char(const char data, bool invert) {
384 384
385 // Dirty check 385 // Dirty check
386 if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) { 386 if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) {
387 oled_dirty |= (1 << ((oled_cursor - &oled_buffer[0]) / OLED_BLOCK_SIZE)); 387 uint16_t index = oled_cursor - &oled_buffer[0];
388 oled_dirty |= (1 << (index / OLED_BLOCK_SIZE));
389 // Edgecase check if the written data spans the 2 chunks
390 oled_dirty |= (1 << ((index + OLED_FONT_WIDTH) / OLED_BLOCK_SIZE));
388 } 391 }
389 392
390 // Finally move to the next char 393 // Finally move to the next char