From 263fc54d03495c3863f353283842b2dd2734f3d6 Mon Sep 17 00:00:00 2001 From: bkleiner Date: Sun, 12 Jan 2025 01:55:41 +0100 Subject: [PATCH] osd: add rolling refresh for hd systems --- src/driver/osd/osd.c | 12 ++++++++++++ src/driver/osd/osd.h | 1 + src/osd/render.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/src/driver/osd/osd.c b/src/driver/osd/osd.c index 55d8815ff..d63c0c136 100644 --- a/src/driver/osd/osd.c +++ b/src/driver/osd/osd.c @@ -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; diff --git a/src/driver/osd/osd.h b/src/driver/osd/osd.h index f95f00efb..ff995bda4 100644 --- a/src/driver/osd/osd.h +++ b/src/driver/osd/osd.h @@ -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(); diff --git a/src/osd/render.c b/src/osd/render.c index dc6a04bf1..08cfc71a1 100644 --- a/src/osd/render.c +++ b/src/osd/render.c @@ -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;