fix(color): play startup 'hello' audio before Lua widgets (#7096)

This commit is contained in:
philmoz
2026-02-18 16:52:24 +10:00
committed by GitHub
parent 0df8d8650f
commit 2e609d8223
8 changed files with 28 additions and 47 deletions
+11 -3
View File
@@ -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;
-2
View File
@@ -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();
});
}
+1
View File
@@ -149,6 +149,7 @@ void applyDefaultTemplate()
#if defined(COLORLCD)
g_model.resetScreenData();
LayoutFactory::deleteCustomScreens(true);
LayoutFactory::loadDefaultLayout();
#endif
+5 -31
View File
@@ -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
+1 -2
View File
@@ -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();
+1 -7
View File
@@ -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
)