1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

By default mark OSD element as rendered in case it's in the off blink state (#14188) (#14189)

* By default render OSD element in a single cycle

* Use return value of osdDrawSingleElement and double check activeElement.rendered
This commit is contained in:
Steve Evans 2025-01-21 20:42:42 +00:00 committed by GitHub
parent 899ce6731d
commit 1aa71452fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2128,6 +2128,9 @@ void osdAddActiveElements(void)
static bool osdDrawSingleElement(displayPort_t *osdDisplayPort, uint8_t item) static bool osdDrawSingleElement(displayPort_t *osdDisplayPort, uint8_t item)
{ {
// By default mark the element as rendered in case it's in the off blink state
activeElement.rendered = true;
if (!osdElementDrawFunction[item]) { if (!osdElementDrawFunction[item]) {
// Element has no drawing function // Element has no drawing function
return true; return true;
@ -2148,7 +2151,6 @@ static bool osdDrawSingleElement(displayPort_t *osdDisplayPort, uint8_t item)
activeElement.buff = elementBuff; activeElement.buff = elementBuff;
activeElement.osdDisplayPort = osdDisplayPort; activeElement.osdDisplayPort = osdDisplayPort;
activeElement.drawElement = true; activeElement.drawElement = true;
activeElement.rendered = true;
activeElement.attr = DISPLAYPORT_SEVERITY_NORMAL; activeElement.attr = DISPLAYPORT_SEVERITY_NORMAL;
// Call the element drawing function // Call the element drawing function
@ -2272,7 +2274,7 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort)
// Only advance to the next element if rendering is complete // Only advance to the next element if rendering is complete
if (osdDrawSingleElement(osdDisplayPort, item)) { if (osdDrawSingleElement(osdDisplayPort, item)) {
// If rendering is complete then advance to the next element // If rendering is complete then advance to the next element
if (activeElement.rendered) {
// Prepare to render the background of the next element // Prepare to render the background of the next element
backgroundRendered = false; backgroundRendered = false;
@ -2281,7 +2283,6 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort)
return false; return false;
} }
} }
}
return true; return true;
} }