1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Better initialization, according to #6286

This commit is contained in:
Andi Kanzler 2018-07-06 15:59:20 +02:00
parent a63beb5239
commit 0b01718869
4 changed files with 10 additions and 5 deletions

View file

@ -112,7 +112,6 @@
#include "io/beeper.h" #include "io/beeper.h"
#include "io/displayport_max7456.h" #include "io/displayport_max7456.h"
#include "io/displayport_srxl.h" #include "io/displayport_srxl.h"
#include "io/displayport_hott.h"
#include "io/displayport_crsf.h" #include "io/displayport_crsf.h"
#include "io/serial.h" #include "io/serial.h"
#include "io/flashfs.h" #include "io/flashfs.h"
@ -608,10 +607,6 @@ void init(void)
cmsDisplayPortRegister(displayPortCrsfInit()); cmsDisplayPortRegister(displayPortCrsfInit());
#endif #endif
#if defined (USE_HOTT_TEXTMODE) && defined (USE_CMS)
cmsDisplayPortRegister(displayPortHottInit());
#endif
#ifdef USE_GPS #ifdef USE_GPS
if (feature(FEATURE_GPS)) { if (feature(FEATURE_GPS)) {
gpsInit(); gpsInit();

View file

@ -141,6 +141,11 @@ displayPort_t *displayPortHottInit()
return &hottDisplayPort; return &hottDisplayPort;
} }
void hottDisplayportRegister()
{
cmsDisplayPortRegister(displayPortHottInit());
}
void hottCmsOpen() void hottCmsOpen()
{ {
if (!cmsInMenu) { if (!cmsInMenu) {

View file

@ -21,5 +21,6 @@
displayPort_t *displayPortHottInit(); displayPort_t *displayPortHottInit();
displayPort_t hottDisplayPort; displayPort_t hottDisplayPort;
void hottDisplayportRegister();
void hottCmsOpen(); void hottCmsOpen();
void hottSetCmsKey(uint8_t hottKey, bool esc); void hottSetCmsKey(uint8_t hottKey, bool esc);

View file

@ -342,6 +342,10 @@ void initHoTTTelemetry(void)
portConfig = findSerialPortConfig(FUNCTION_TELEMETRY_HOTT); portConfig = findSerialPortConfig(FUNCTION_TELEMETRY_HOTT);
hottPortSharing = determinePortSharing(portConfig, FUNCTION_TELEMETRY_HOTT); hottPortSharing = determinePortSharing(portConfig, FUNCTION_TELEMETRY_HOTT);
#if defined (USE_HOTT_TEXTMODE) && defined (USE_CMS)
hottDisplayportRegister();
#endif
initialiseMessages(); initialiseMessages();
} }