1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Merge pull request #2582 from softsr/fc_init_order

Initialise OSD after GYRO
This commit is contained in:
Nathan 2017-03-06 23:58:48 -08:00 committed by GitHub
commit b9363d0d37

View file

@ -405,18 +405,6 @@ void init(void)
}
#endif
#ifdef OSD
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());
#elif defined(USE_MSP_DISPLAYPORT)
displayPort_t *osdDisplayPort = displayPortMspInit();
#endif
osdInit(osdDisplayPort);
}
#endif
if (!sensorsAutodetect()) {
// if gyro was not detected due to whatever reason, we give up now.
failureMode(FAILURE_MISSING_ACC);
@ -459,6 +447,19 @@ void init(void)
rxInit();
#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());
#elif defined(USE_MSP_DISPLAYPORT)
displayPort_t *osdDisplayPort = displayPortMspInit();
#endif
osdInit(osdDisplayPort);
}
#endif
#ifdef GPS
if (feature(FEATURE_GPS)) {
gpsInit();