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