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