fix(color): play startup 'hello' audio before Lua widgets (#7096)
This commit is contained in:
+11
-3
@@ -54,11 +54,13 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
|
#include "layout.h"
|
||||||
#include "radio_calibration.h"
|
#include "radio_calibration.h"
|
||||||
#include "view_text.h"
|
|
||||||
#include "theme_manager.h"
|
|
||||||
#include "switch_warn_dialog.h"
|
|
||||||
#include "startup_shutdown.h"
|
#include "startup_shutdown.h"
|
||||||
|
#include "switch_warn_dialog.h"
|
||||||
|
#include "theme_manager.h"
|
||||||
|
#include "view_main.h"
|
||||||
|
#include "view_text.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CROSSFIRE)
|
#if defined(CROSSFIRE)
|
||||||
@@ -1197,6 +1199,8 @@ void edgeTxResume()
|
|||||||
//TODO: needs to go into storageReadAll()
|
//TODO: needs to go into storageReadAll()
|
||||||
TRACE("reloading theme");
|
TRACE("reloading theme");
|
||||||
ThemePersistance::instance()->loadDefaultTheme();
|
ThemePersistance::instance()->loadDefaultTheme();
|
||||||
|
LayoutFactory::loadCustomScreens();
|
||||||
|
ViewMain::instance()->show();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
referenceSystemAudioFiles();
|
referenceSystemAudioFiles();
|
||||||
@@ -1568,6 +1572,10 @@ void edgeTxInit()
|
|||||||
}
|
}
|
||||||
#endif // defined(GUI)
|
#endif // defined(GUI)
|
||||||
|
|
||||||
|
#if defined(COLORLCD)
|
||||||
|
LayoutFactory::loadCustomScreens();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(BLUETOOTH_PROBE)
|
#if defined(BLUETOOTH_PROBE)
|
||||||
extern volatile uint8_t btChipPresent;
|
extern volatile uint8_t btChipPresent;
|
||||||
auto oldBtMode = g_eeGeneral.bluetoothMode;
|
auto oldBtMode = g_eeGeneral.bluetoothMode;
|
||||||
|
|||||||
@@ -182,8 +182,6 @@ if(USBJ_EX)
|
|||||||
add_gui_src(model/model_usbjoystick.cpp)
|
add_gui_src(model/model_usbjoystick.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SRC ${SRC} storage/modelslist.cpp)
|
|
||||||
|
|
||||||
option(UI_PERF_MONITOR "Draw frame rate and CPU usage" OFF)
|
option(UI_PERF_MONITOR "Draw frame rate and CPU usage" OFF)
|
||||||
if(UI_PERF_MONITOR)
|
if(UI_PERF_MONITOR)
|
||||||
add_definitions(-DUI_PERF_MONITOR)
|
add_definitions(-DUI_PERF_MONITOR)
|
||||||
|
|||||||
@@ -368,6 +368,10 @@ class ModelsPageBody : public Window
|
|||||||
loadModel(g_eeGeneral.currModelFilename, true);
|
loadModel(g_eeGeneral.currModelFilename, true);
|
||||||
modelslist.setCurrentModel(model);
|
modelslist.setCurrentModel(model);
|
||||||
|
|
||||||
|
// Main view layout
|
||||||
|
LayoutFactory::deleteCustomScreens();
|
||||||
|
LayoutFactory::loadCustomScreens();
|
||||||
|
|
||||||
storageDirty(EE_GENERAL);
|
storageDirty(EE_GENERAL);
|
||||||
storageCheck(true);
|
storageCheck(true);
|
||||||
}
|
}
|
||||||
@@ -622,7 +626,8 @@ void ModelLabelsWindow::newModel()
|
|||||||
snprintf(path, LEN_BUFFER, "%s/%s", TEMPLATES_PATH, folder.c_str());
|
snprintf(path, LEN_BUFFER, "%s/%s", TEMPLATES_PATH, folder.c_str());
|
||||||
|
|
||||||
// Read model template
|
// Read model template
|
||||||
loadModelTemplate((name + YAML_EXT).c_str(), path);
|
LayoutFactory::deleteCustomScreens(true);
|
||||||
|
loadModel((name + YAML_EXT).c_str(), false, path);
|
||||||
storageFlushCurrentModel();
|
storageFlushCurrentModel();
|
||||||
storageCheck(true);
|
storageCheck(true);
|
||||||
|
|
||||||
@@ -638,6 +643,9 @@ void ModelLabelsWindow::newModel()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Main view layout
|
||||||
|
LayoutFactory::loadCustomScreens();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ void applyDefaultTemplate()
|
|||||||
|
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
g_model.resetScreenData();
|
g_model.resetScreenData();
|
||||||
|
LayoutFactory::deleteCustomScreens(true);
|
||||||
LayoutFactory::loadDefaultLayout();
|
LayoutFactory::loadDefaultLayout();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -166,22 +166,19 @@ const char * createModel()
|
|||||||
storageDirty(EE_GENERAL);
|
storageDirty(EE_GENERAL);
|
||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
storageCheck(true);
|
storageCheck(true);
|
||||||
#if defined(COLORLCD)
|
|
||||||
// Default layout loaded when setting model defaults - neeed to remove it.
|
|
||||||
LayoutFactory::deleteCustomScreens(true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
postModelLoad(false);
|
postModelLoad(false);
|
||||||
|
|
||||||
return g_eeGeneral.currModelFilename;
|
return g_eeGeneral.currModelFilename;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* loadModel(char* filename, bool alarms)
|
const char* loadModel(const char* filename, bool alarms, const char* filePath)
|
||||||
{
|
{
|
||||||
preModelLoad();
|
preModelLoad();
|
||||||
|
|
||||||
const char* error = readModel(filename, (uint8_t*)&g_model, sizeof(g_model));
|
const char* error = readModel(filename, (uint8_t*)&g_model, sizeof(g_model), filePath);
|
||||||
if (error) {
|
if (error) {
|
||||||
TRACE("loadModel error=%s", error);
|
TRACE("loadModel error=%s", error);
|
||||||
|
|
||||||
@@ -191,32 +188,10 @@ const char* loadModel(char* filename, bool alarms)
|
|||||||
applyDefaultTemplate();
|
applyDefaultTemplate();
|
||||||
|
|
||||||
storageCheck(true);
|
storageCheck(true);
|
||||||
postModelLoad(false);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
postModelLoad(alarms);
|
postModelLoad(error ? false : alarms);
|
||||||
return nullptr;
|
return error;
|
||||||
}
|
|
||||||
|
|
||||||
const char* loadModelTemplate(const char* fileName, const char* filePath)
|
|
||||||
{
|
|
||||||
preModelLoad();
|
|
||||||
// Assuming that the template is located in current working directory
|
|
||||||
const char* error = readModel(fileName, (uint8_t*)&g_model, sizeof(g_model), filePath);
|
|
||||||
if (error) {
|
|
||||||
TRACE("loadModel error=%s", error);
|
|
||||||
// just get some clean memory state in "g_model" so the mixer can run safely
|
|
||||||
memset(&g_model, 0, sizeof(g_model));
|
|
||||||
applyDefaultTemplate();
|
|
||||||
|
|
||||||
storageCheck(true);
|
|
||||||
postModelLoad(false);
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
postModelLoad(false);
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void storageReadAll()
|
void storageReadAll()
|
||||||
@@ -288,4 +263,3 @@ void checkModelIdUnique(uint8_t index, uint8_t module)
|
|||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ const char* writeFileYaml(const char* path, const YamlNode* root_node, uint8_t*
|
|||||||
void getModelPath(char * path, const char * filename, const char* pathName = MODELS_PATH);
|
void getModelPath(char * path, const char * filename, const char* pathName = MODELS_PATH);
|
||||||
|
|
||||||
const char * readModel(const char * filename, uint8_t * buffer, uint32_t size, const char* pathName = MODELS_PATH);
|
const char * readModel(const char * filename, uint8_t * buffer, uint32_t size, const char* pathName = MODELS_PATH);
|
||||||
const char * loadModel(char * filename, bool alarms=true);
|
const char * loadModel(const char * filename, bool alarms = true, const char* filePath = MODELS_PATH);
|
||||||
const char * loadModelTemplate(const char* fileName, const char* filePath);
|
|
||||||
const char * createModel();
|
const char * createModel();
|
||||||
const char * writeModel();
|
const char * writeModel();
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,6 @@ void preModelLoad()
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopTrainer();
|
stopTrainer();
|
||||||
#if defined(COLORLCD)
|
|
||||||
LayoutFactory::deleteCustomScreens(true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (needDelay) {
|
if (needDelay) {
|
||||||
sleep_ms(200);
|
sleep_ms(200);
|
||||||
@@ -305,10 +302,7 @@ if(g_model.rssiSource) {
|
|||||||
|
|
||||||
referenceModelAudioFiles();
|
referenceModelAudioFiles();
|
||||||
|
|
||||||
#if defined(COLORLCD)
|
#if !defined(COLORLCD)
|
||||||
LayoutFactory::loadCustomScreens();
|
|
||||||
ViewMain::instance()->show(true);
|
|
||||||
#else
|
|
||||||
LOAD_MODEL_BITMAP();
|
LOAD_MODEL_BITMAP();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ endif()
|
|||||||
add_definitions(
|
add_definitions(
|
||||||
-DSTM32H750XBTx -DSTM32H750xx
|
-DSTM32H750XBTx -DSTM32H750xx
|
||||||
-DSDRAM -DCCMRAM
|
-DSDRAM -DCCMRAM
|
||||||
-DCOLORLCD -DLIBOPENUI
|
|
||||||
-DHARDWARE_TOUCH -DHARDWARE_KEYS -DSOFTWARE_KEYBOARD
|
-DHARDWARE_TOUCH -DHARDWARE_KEYS -DSOFTWARE_KEYBOARD
|
||||||
-DWS2812_MAX_LEDS=26
|
-DWS2812_MAX_LEDS=26
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user