From 1857c7de73a18047e37db3b888736ae52d881df7 Mon Sep 17 00:00:00 2001 From: Sergey Krukovski Date: Mon, 6 Mar 2017 22:14:45 +0100 Subject: [PATCH 1/2] Initialise OSD after GYRO --- src/main/fc/fc_init.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index ecd3f09f9d..9e523c1d44 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -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,18 @@ void init(void) rxInit(); +#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 + #ifdef GPS if (feature(FEATURE_GPS)) { gpsInit(); From ab8da465f0d6b7644f2f44f82a6456cb5c937e6a Mon Sep 17 00:00:00 2001 From: Sergey Krukovski Date: Mon, 6 Mar 2017 23:51:17 +0100 Subject: [PATCH 2/2] Added GYRO/OSD order comment --- src/main/fc/fc_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index 9e523c1d44..dfa25672f1 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -448,6 +448,7 @@ 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