mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
Resurrect multi-display cycling
This commit is contained in:
parent
3df4a84c1c
commit
5d92b62393
2 changed files with 34 additions and 19 deletions
|
@ -629,6 +629,11 @@ STATIC_UNIT_TESTED uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key)
|
||||||
if (!currentMenu)
|
if (!currentMenu)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
if (key == KEY_MENU) {
|
||||||
|
cmsMenuOpen();
|
||||||
|
return BUTTON_PAUSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (key == KEY_ESC) {
|
if (key == KEY_ESC) {
|
||||||
cmsMenuBack(pDisplay);
|
cmsMenuBack(pDisplay);
|
||||||
return BUTTON_PAUSE;
|
return BUTTON_PAUSE;
|
||||||
|
|
|
@ -378,25 +378,6 @@ void init(void)
|
||||||
|
|
||||||
initBoardAlignment(boardAlignment());
|
initBoardAlignment(boardAlignment());
|
||||||
|
|
||||||
#ifdef CMS
|
|
||||||
cmsInit();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_DASHBOARD
|
|
||||||
if (feature(FEATURE_DASHBOARD)) {
|
|
||||||
dashboardInit();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_RTC6705
|
|
||||||
if (feature(FEATURE_VTX)) {
|
|
||||||
rtc6705_soft_spi_init();
|
|
||||||
current_vtx_channel = vtxConfig()->vtx_channel;
|
|
||||||
rtc6705_soft_spi_set_channel(vtx_freq[current_vtx_channel]);
|
|
||||||
rtc6705_soft_spi_set_rf_power(vtxConfig()->vtx_power);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!sensorsAutodetect()) {
|
if (!sensorsAutodetect()) {
|
||||||
// if gyro was not detected due to whatever reason, we give up now.
|
// if gyro was not detected due to whatever reason, we give up now.
|
||||||
failureMode(FAILURE_MISSING_ACC);
|
failureMode(FAILURE_MISSING_ACC);
|
||||||
|
@ -435,6 +416,26 @@ void init(void)
|
||||||
|
|
||||||
rxInit();
|
rxInit();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* VTX
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef USE_RTC6705
|
||||||
|
if (feature(FEATURE_VTX)) {
|
||||||
|
rtc6705_soft_spi_init();
|
||||||
|
current_vtx_channel = vtxConfig()->vtx_channel;
|
||||||
|
rtc6705_soft_spi_set_channel(vtx_freq[current_vtx_channel]);
|
||||||
|
rtc6705_soft_spi_set_rf_power(vtxConfig()->vtx_power);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CMS, display devices and OSD
|
||||||
|
*/
|
||||||
|
#ifdef CMS
|
||||||
|
cmsInit();
|
||||||
|
#endif
|
||||||
|
|
||||||
displayPort_t *osdDisplayPort = NULL;
|
displayPort_t *osdDisplayPort = NULL;
|
||||||
|
|
||||||
#ifdef OSD
|
#ifdef OSD
|
||||||
|
@ -447,6 +448,7 @@ void init(void)
|
||||||
#elif defined(USE_OSD_OVER_MSP_DISPLAYPORT) // OSD over MSP; not supported (yet)
|
#elif defined(USE_OSD_OVER_MSP_DISPLAYPORT) // OSD over MSP; not supported (yet)
|
||||||
osdDisplayPort = displayPortMspInit();
|
osdDisplayPort = displayPortMspInit();
|
||||||
#endif
|
#endif
|
||||||
|
// osdInit will register with CMS by itself.
|
||||||
osdInit(osdDisplayPort);
|
osdInit(osdDisplayPort);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -457,6 +459,14 @@ void init(void)
|
||||||
cmsDisplayPortRegister(displayPortMspInit());
|
cmsDisplayPortRegister(displayPortMspInit());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_DASHBOARD
|
||||||
|
// Dashbord will register with CMS by itself.
|
||||||
|
if (feature(FEATURE_DASHBOARD)) {
|
||||||
|
dashboardInit();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef GPS
|
#ifdef GPS
|
||||||
if (feature(FEATURE_GPS)) {
|
if (feature(FEATURE_GPS)) {
|
||||||
gpsInit();
|
gpsInit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue