Skip to content

Commit

Permalink
osd: add rolling refresh for hd systems
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Jan 12, 2025
1 parent d62b68b commit 263fc54
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/driver/osd/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ void osd_clear() {
;
}

void osd_mark_row_dirty() {
static uint8_t row = 0;

const uint16_t offset = row * cols;
for (uint32_t i = 0; i < cols; i++) {
display[offset + i].dirty = display[offset + i].val != ' ';
}
display_dirty = display_row_dirty[row] = true;

row = (row + 1) % rows;
}

uint8_t osd_clear_async() {
static uint8_t state = 0;

Expand Down
1 change: 1 addition & 0 deletions src/driver/osd/osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ bool osd_is_ready();
bool osd_update();

void osd_clear();
void osd_mark_row_dirty();
uint8_t osd_clear_async();

void osd_display_refresh();
Expand Down
2 changes: 2 additions & 0 deletions src/osd/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ static void osd_display_regular() {
// display warning if we can not detect a camera
osd_start(OSD_ATTR_BLINK, 7, 7);
osd_write_str("NO CAMERA SIGNAL");
} else if (osd_system == OSD_SYS_HD) {
osd_mark_row_dirty();
}
osd_state.element = 0;
break;
Expand Down

0 comments on commit 263fc54

Please sign in to comment.