Fix (bad) CMS device registration order
This commit is contained in:
parent
3408d9d613
commit
d2fe67aa45
|
@ -427,10 +427,6 @@ void init(void)
|
||||||
mspFcInit();
|
mspFcInit();
|
||||||
mspSerialInit();
|
mspSerialInit();
|
||||||
|
|
||||||
#if defined(USE_MSP_DISPLAYPORT) && defined(CMS)
|
|
||||||
cmsDisplayPortRegister(displayPortMspInit());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_CLI
|
#ifdef USE_CLI
|
||||||
cliInit(serialConfig());
|
cliInit(serialConfig());
|
||||||
#endif
|
#endif
|
||||||
|
@ -439,19 +435,30 @@ void init(void)
|
||||||
|
|
||||||
rxInit();
|
rxInit();
|
||||||
|
|
||||||
|
displayPort_t *osdDisplayPort = NULL;
|
||||||
|
|
||||||
#ifdef OSD
|
#ifdef OSD
|
||||||
//The OSD need to be initialised after GYRO to avoid GYRO initialisation failure on some targets
|
//The OSD need to be initialised after GYRO to avoid GYRO initialisation failure on some targets
|
||||||
|
|
||||||
if (feature(FEATURE_OSD)) {
|
if (feature(FEATURE_OSD)) {
|
||||||
#if defined(USE_MAX7456)
|
#if defined(USE_MAX7456)
|
||||||
// if there is a max7456 chip for the OSD then use it, otherwise use MSP
|
// 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)
|
#elif defined(USE_MSP_DISPLAYPORT)
|
||||||
displayPort_t *osdDisplayPort = displayPortMspInit();
|
osdDisplayPort = displayPortMspInit();
|
||||||
#endif
|
#endif
|
||||||
osdInit(osdDisplayPort);
|
osdInit(osdDisplayPort);
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
#ifdef GPS
|
||||||
if (feature(FEATURE_GPS)) {
|
if (feature(FEATURE_GPS)) {
|
||||||
gpsInit();
|
gpsInit();
|
||||||
|
|
Loading…
Reference in New Issue