mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-24 20:32:58 +00:00
Fix oled_render to render all dirty blocks. (#18887)
This commit is contained in:
parent
81bf60a636
commit
4c1d8a0eb3
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user