1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Merge pull request #10229 from etracer65/msp_displayport_fix

Remove unnecessary drawScreen() calls for MSP displayPort OSD
This commit is contained in:
Michael Keller 2020-10-04 16:08:11 +13:00
parent d99048056d
commit f12df8c69b

View file

@ -1036,9 +1036,19 @@ void osdUpdate(timeUs_t currentTimeUs)
osdRefresh(currentTimeUs);
showVisualBeeper = false;
} else {
// rest of time redraw screen 10 chars per idle so it doesn't lock the main idle
bool doDrawScreen = true;
#if defined(USE_CMS) && defined(USE_MSP_DISPLAYPORT) && defined(USE_OSD_OVER_MSP_DISPLAYPORT)
// For the MSP displayPort device only do the drawScreen once per
// logical OSD cycle as there is no output buffering needing to be flushed.
if (osdDisplayPortDeviceType == OSD_DISPLAYPORT_DEVICE_MSP) {
doDrawScreen = (counter % DRAW_FREQ_DENOM == 1);
}
#endif
// Redraw a portion of the chars per idle to spread out the load and SPI bus utilization
if (doDrawScreen) {
displayDrawScreen(osdDisplayPort);
}
}
++counter;
}