1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Further fix CMS displayPort registration

1. Avoid OSD over MSP_DISPLAYPORT case (not ready yet).
2. osdInit to take care NULL displayPortToUse.
This commit is contained in:
jflyper 2017-04-02 01:26:49 +09:00
parent d2fe67aa45
commit e186a2d709
2 changed files with 7 additions and 6 deletions

View file

@ -444,18 +444,16 @@ void init(void)
#if defined(USE_MAX7456)
// if there is a max7456 chip for the OSD then use it, otherwise use MSP
osdDisplayPort = max7456DisplayPortInit(vcdProfile());
#elif defined(USE_MSP_DISPLAYPORT)
#elif defined(USE_OSD_OVER_MSP_DISPLAYPORT) // OSD over MSP; not supported (yet)
osdDisplayPort = displayPortMspInit();
#endif
osdInit(osdDisplayPort);
}
#endif
#if defined(USE_MSP_DISPLAYPORT) && defined(CMS)
// If BFOSD is active, then register it as CMS device, else register MSP.
if (osdDisplayPort)
cmsDisplayPortRegister(osdDisplayPort);
else
#if defined(CMS) && defined(USE_MSP_DISPLAYPORT)
// If BFOSD is not active, then register as register MSP_DISPLAYPORT.
if (!osdDisplayPort)
cmsDisplayPortRegister(displayPortMspInit());
#endif

View file

@ -582,6 +582,9 @@ static void osdDrawLogo(int x, int y)
void osdInit(displayPort_t *osdDisplayPortToUse)
{
if (!osdDisplayPortToUse)
return;
BUILD_BUG_ON(OSD_POS_MAX != OSD_POS(31,31));
osdDisplayPort = osdDisplayPortToUse;