1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00

Merge pull request #2787 from jflyper/bfdev-fix-cms-registration-order

Fix CMS invocation failure
This commit is contained in:
Michael Keller 2017-04-01 16:44:25 +13:00 committed by GitHub
commit d74f7aed50

View file

@ -427,10 +427,6 @@ void init(void)
mspFcInit();
mspSerialInit();
#if defined(USE_MSP_DISPLAYPORT) && defined(CMS)
cmsDisplayPortRegister(displayPortMspInit());
#endif
#ifdef USE_CLI
cliInit(serialConfig());
#endif
@ -439,19 +435,30 @@ void init(void)
rxInit();
displayPort_t *osdDisplayPort = NULL;
#ifdef OSD
//The OSD need to be initialised after GYRO to avoid GYRO initialisation failure on some targets
if (feature(FEATURE_OSD)) {
#if defined(USE_MAX7456)
// if there is a max7456 chip for the OSD then use it, otherwise use MSP
displayPort_t *osdDisplayPort = max7456DisplayPortInit(vcdProfile());
osdDisplayPort = max7456DisplayPortInit(vcdProfile());
#elif defined(USE_MSP_DISPLAYPORT)
displayPort_t *osdDisplayPort = displayPortMspInit();
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
cmsDisplayPortRegister(displayPortMspInit());
#endif
#ifdef GPS
if (feature(FEATURE_GPS)) {
gpsInit();