feat: Splash screen delay opt for colorlcd, startup sound disable opt (#3451)

* Enable startup splash screen duration for color LCD radios.
Add option to disable startup sound.
Add Companion support for changes.

* Add translation string for Hebrew language file.

* Fix rebase.

* chore: Add T20

* Update translations.

* Update translations.

* Update translations.

* Update translations.

* Right justify radio setup controls.

* Use longer translations for all radios.

* Enable splash screen timeout for NV14/EL18.

* Suspend watchdog timer to prevent EM if long splash display time selected.

* Simplify SPLASH_TIMEOUT code.

* Use WDG_RESET instead of watchdogSuspend.

---------

Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
philmoz
2023-07-30 11:58:28 +10:00
committed by GitHub
co-authored by Phil Mitchell Peter Feerick
parent ca025e849f
commit 9e7a331fa6
40 changed files with 996 additions and 875 deletions
+44 -2
View File
@@ -25,6 +25,8 @@
#include "tasks.h"
#include "tasks/mixer_task.h"
#include "watchdog_driver.h"
RTOS_TASK_HANDLE menusTaskId;
RTOS_DEFINE_STACK(menusTaskId, menusStack, MENUS_STACK_SIZE);
@@ -46,7 +48,11 @@ TASK_FUNCTION(menusTask)
#endif
#if defined(SPLASH) && !defined(STARTUP_ANIMATION)
tmr10ms_t splashStartTime = 0;
bool waitSplash = false;
if (!UNEXPECTED_SHUTDOWN()) {
splashStartTime = get_tmr10ms();
waitSplash = true;
drawSplash();
TRACE("drawSplash() completed");
}
@@ -58,6 +64,44 @@ TASK_FUNCTION(menusTask)
opentxInit();
#if defined(SPLASH) && !defined(STARTUP_ANIMATION)
if (waitSplash){
extern bool inactivityCheckInputs();
extern void checkSpeakerVolume();
#if defined(SIMU)
// Simulator - inputsMoved() returns true immediately without this!
RTOS_WAIT_TICKS(30);
#endif
splashStartTime += SPLASH_TIMEOUT;
while (splashStartTime > get_tmr10ms()) {
WDG_RESET();
checkSpeakerVolume();
checkBacklight();
RTOS_WAIT_TICKS(10);
auto evt = getEvent();
if (evt || inactivityCheckInputs()) {
if (evt)
killEvents(evt);
break;
}
#if defined(SIMU)
// Allow simulator to exit if closed while splash showing
uint32_t pwr_check = pwrCheck();
if (pwr_check == e_power_off) {
break;
}
#endif
}
// Reset timer so special/global functions set to !1x don't get triggered
START_SILENCE_PERIOD();
}
#endif
mixerTaskInit();
#if defined(PWR_BUTTON_PRESS)
while (true) {
uint32_t pwr_check = pwrCheck();
@@ -111,8 +155,6 @@ void tasksStart()
cliStart();
#endif
mixerTaskInit();
RTOS_CREATE_TASK(menusTaskId, menusTask, "menus", menusStack,
MENUS_STACK_SIZE, MENUS_TASK_PRIO);