1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 03:20:00 +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)
{
// By default mark the element as rendered in case it's in the off blink state
activeElement.rendered = true;
if (!osdElementDrawFunction[item]) {
// Element has no drawing function
return true;
@ -2148,7 +2151,6 @@ static bool osdDrawSingleElement(displayPort_t *osdDisplayPort, uint8_t item)
activeElement.buff = elementBuff;
activeElement.osdDisplayPort = osdDisplayPort;
activeElement.drawElement = true;
activeElement.rendered = true;
activeElement.attr = DISPLAYPORT_SEVERITY_NORMAL;
// Call the element drawing function
@ -2272,14 +2274,13 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort)
// Only advance to the next element if rendering is complete
if (osdDrawSingleElement(osdDisplayPort, item)) {
// If rendering is complete then advance to the next element
if (activeElement.rendered) {
// Prepare to render the background of the next element
backgroundRendered = false;
if (++activeElementNumber >= activeOsdElementCount) {
activeElementNumber = 0;
return false;
}
// Prepare to render the background of the next element
backgroundRendered = false;
if (++activeElementNumber >= activeOsdElementCount) {
activeElementNumber = 0;
return false;
}
}