Adds quiet boot option to hide menu duing countdown

This commit is contained in:
Martin White
2019-06-04 15:03:51 +01:00
committed by Martin White
parent 6965cf08a7
commit bae754cec2
4 changed files with 27 additions and 3 deletions

View File

@@ -25,7 +25,8 @@ fb_terminal=1 ; 1 - enabled (default), 0 - disabled
; corename - Autoboot first corename_*.rbf found on the SD/USB
; corename_yyyymmdd.rbf - Autoboot first corename_yyyymmdd.rbf found on the SD/USB
;bootcore=lastcore ; uncomment to autoboot a core, as the last loaded core.
bootcore_timeout=10 ; 10-30 timeout before autoboot, comment for autoboot without timeout.
bootcore_timeout=10 ; 5-30 timeout before autoboot, comment for autoboot without timeout.
;bootcore_quiet=1 ; uncomment to initially hide the menu. This will only have any effect if bootcore_timeout is non-zero and bootcore is a named core
; Option to load the custom font. Format is plain bitmap 8x8.
; Supported sizes of font:

View File

@@ -49,7 +49,8 @@ const ini_var_t ini_vars[] = {
{ "RBF_HIDE_DATECODE", (void*)(&(cfg.rbf_hide_datecode)), UINT8, 0, 1, 1 },
{ "MENU_PAL", (void*)(&(cfg.menu_pal)), UINT8, 0, 1, 1 },
{ "BOOTCORE", (void*)(&(cfg.bootcore)), STRING, 0, sizeof(cfg.bootcore) - 1, 1 },
{ "BOOTCORE_TIMEOUT", (void*)(&(cfg.bootcore_timeout)), INT16, 10, 30, 1 },
{ "BOOTCORE_TIMEOUT", (void*)(&(cfg.bootcore_timeout)), INT16, 5, 30, 1 },
{ "BOOTCORE_QUIET", (void*)(&(cfg.bootcore_quiet)), UINT8, 0, 1, 1 },
{ "FONT", (void*)(&(cfg.font)), STRING, 0, sizeof(cfg.font) - 1, 1 },
{ "FB_SIZE", (void*)(&(cfg.fb_size)), UINT8, 1, 4, 1 },
{ "FB_TERMINAL", (void*)(&(cfg.fb_terminal)), UINT8, 0, 1, 1 },

1
cfg.h
View File

@@ -34,6 +34,7 @@ typedef struct {
uint8_t rbf_hide_datecode;
uint8_t menu_pal;
int16_t bootcore_timeout;
uint8_t bootcore_quiet;
uint8_t fb_size;
uint8_t fb_terminal;
char bootcore[256];

View File

@@ -469,7 +469,16 @@ static uint32_t menu_key_get(void)
c2 = c1;
// inject a fake "MENU_KEY" if no menu is visible and the menu key is loaded
if (!user_io_osd_is_visible() && !video_fb_state() && is_menu_core()) c = KEY_F12;
if (!cfg.bootcore_quiet)
{
if (!user_io_osd_is_visible() && !video_fb_state() && is_menu_core()) c = KEY_F12;
}
else
{
// Enable key events in OSD
user_io_osd_key_enable(1);
}
// generate repeat "key-pressed" events
if ((c1 & UPSTROKE) || (!c1))
@@ -805,6 +814,11 @@ void HandleUI(void)
{
cfg.bootcore[0] = '\0';
}
else if (c && cfg.bootcore_quiet)
{
cfg.bootcore_quiet = 0;
menu = true;
}
if (is_menu_core())
{
@@ -4248,6 +4262,13 @@ void HandleUI(void)
OsdWrite(16, "", 1, 0);
OsdWrite(17, str, 1, 0);
OsdWrite(18, "", 1, 0);
// Override and hide OSD but countdown still happens
if (cfg.bootcore_quiet)
{
menustate = MENU_NONE1;
OsdClear();
}
}
}
}