New UI merged

This commit is contained in:
Bertrand Songis
2019-08-28 20:50:14 +02:00
parent 1f41076b0e
commit f4f8893ae9
806 changed files with 30836 additions and 11704 deletions
+24 -3
View File
@@ -19,6 +19,9 @@
*/
#include "opentx.h"
#if defined(LIBOPENUI)
#include "mainwindow.h"
#endif
uint8_t currentSpeakerVolume = 255;
uint8_t requiredSpeakerVolume = 255;
@@ -49,11 +52,14 @@ void handleUsbConnection()
usbPluggedIn();
}
}
#if defined(COLORLCD)
#warning "USB popup"
#else
if (!usbStarted() && usbPlugged() && getSelectedUsbMode() == USB_UNSELECTED_MODE) {
if (g_eeGeneral.USBMode == USB_UNSELECTED_MODE && popupMenuItemsCount == 0) {
POPUP_MENU_ADD_ITEM(STR_USB_JOYSTICK);
POPUP_MENU_ADD_ITEM(STR_USB_MASS_STORAGE);
#if defined(DEBUG)
#if defined(USB_SERIAL)
POPUP_MENU_ADD_ITEM(STR_USB_SERIAL);
#endif
POPUP_MENU_START(onUSBConnectMenu);
@@ -62,6 +68,7 @@ void handleUsbConnection()
setSelectedUsbMode(g_eeGeneral.USBMode);
}
}
#endif
if (usbStarted() && !usbPlugged()) {
usbStop();
if (getSelectedUsbMode() == USB_MASS_STORAGE_MODE) {
@@ -249,7 +256,7 @@ void guiMain(event_t evt)
{
bool refreshNeeded = false;
#if defined(LUA)
#if defined(LUA) && !defined(LIBOPENUI)
uint32_t t0 = get_tmr10ms();
static uint32_t lastLuaTime = 0;
uint16_t interval = (lastLuaTime == 0 ? 0 : (t0 - lastLuaTime));
@@ -285,10 +292,13 @@ void guiMain(event_t evt)
if (t0 > maxLuaDuration) {
maxLuaDuration = t0;
}
#else
#elif !defined(LIBOPENUI)
lcdRefreshWait(); // WARNING: make sure no code above this line does any change to the LCD display buffer!
#endif
#if defined(LIBOPENUI)
mainWindow.run();
#else
if (!refreshNeeded) {
DEBUG_TIMER_START(debugTimerMenus);
while (1) {
@@ -360,6 +370,7 @@ void guiMain(event_t evt)
lcdRefresh();
DEBUG_TIMER_STOP(debugTimerLcdRefresh);
}
#endif
}
#elif defined(GUI)
@@ -487,7 +498,9 @@ void perMain()
doLoopCommonActions();
#if !defined(LIBOPENUI)
event_t evt = getEvent(false);
#endif
#if defined(RAMBACKUP)
if (unexpectedShutdown) {
@@ -515,17 +528,25 @@ void perMain()
#if defined(STM32)
if (usbPlugged() && getSelectedUsbMode() == USB_MASS_STORAGE_MODE) {
#if defined(LIBOPENUI)
#warning "TODO USB plugged view"
#else
// disable access to menus
lcdClear();
menuMainView(0);
lcdRefresh();
#endif
return;
}
#endif
#if defined(GUI)
DEBUG_TIMER_START(debugTimerGuiMain);
#if defined(LIBOPENUI)
guiMain(0);
#else
guiMain(evt);
#endif
DEBUG_TIMER_STOP(debugTimerGuiMain);
#endif