Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
QMK Bot 2022-11-13 15:50:33 +00:00
commit 4a92f3fc6a

View File

@ -291,18 +291,18 @@ static void rotate_90(const uint8_t *src, uint8_t *dest) {
} }
void oled_render(void) { void oled_render(void) {
if (!oled_initialized) {
return;
}
// Do we have work to do? // Do we have work to do?
oled_dirty &= OLED_ALL_BLOCKS_MASK; oled_dirty &= OLED_ALL_BLOCKS_MASK;
if (!oled_dirty || oled_scrolling) { if (!oled_dirty || !oled_initialized || oled_scrolling) {
return; return;
} }
// Find first dirty block // Turn on display if it is off
oled_on();
uint8_t update_start = 0; uint8_t update_start = 0;
while (oled_dirty) { // render all dirty blocks
// Find next dirty block
while (!(oled_dirty & ((OLED_BLOCK_TYPE)1 << update_start))) { while (!(oled_dirty & ((OLED_BLOCK_TYPE)1 << update_start))) {
++update_start; ++update_start;
} }
@ -345,11 +345,9 @@ void oled_render(void) {
} }
} }
// Turn on display if it is off // Clear dirty flag of just rendered block
oled_on();
// Clear dirty flag
oled_dirty &= ~((OLED_BLOCK_TYPE)1 << update_start); oled_dirty &= ~((OLED_BLOCK_TYPE)1 << update_start);
}
} }
void oled_set_cursor(uint8_t col, uint8_t line) { void oled_set_cursor(uint8_t col, uint8_t line) {