From 901723621c3683cf81b5d79a36be5cd6067ca98d Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 26 Jan 2019 00:50:38 -0800 Subject: [PATCH] fusee: hide non-error logs behind splash screen (closes #328) --- fusee/fusee-secondary/src/lib/log.c | 6 +++++- fusee/fusee-secondary/src/main.c | 6 +++++- fusee/fusee-secondary/src/nxboot.c | 4 ---- fusee/fusee-secondary/src/splash_screen.c | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/fusee/fusee-secondary/src/lib/log.c b/fusee/fusee-secondary/src/lib/log.c index 402121d4d..1bf37d275 100644 --- a/fusee/fusee-secondary/src/lib/log.c +++ b/fusee/fusee-secondary/src/lib/log.c @@ -15,6 +15,7 @@ */ #include "log.h" +#include "../console.h" #include @@ -100,7 +101,10 @@ void print(ScreenLogLevel screen_log_level, const char * fmt, ...) char buf[PRINT_MESSAGE_MAX_LENGTH] = {}; char message[PRINT_MESSAGE_MAX_LENGTH] = {}; - /* TODO: make splash disappear if level > MANDATORY */ + /* Make splash disappear if level is ERROR or WARNING */ + if (screen_log_level < SCREEN_LOG_LEVEL_MANDATORY) { + console_resume(); + } /* make prefix free messages with log_level possible */ if(screen_log_level & SCREEN_LOG_LEVEL_NO_PREFIX) { diff --git a/fusee/fusee-secondary/src/main.c b/fusee/fusee-secondary/src/main.c index 20654509d..97983819e 100644 --- a/fusee/fusee-secondary/src/main.c +++ b/fusee/fusee-secondary/src/main.c @@ -32,6 +32,7 @@ #include "fs_utils.h" #include "nxfs.h" #include "gpt.h" +#include "splash_screen.h" #include "display/video_fb.h" #include "sdmmc/sdmmc.h" #include "lib/log.h" @@ -95,7 +96,7 @@ int main(int argc, void **argv) { /* Initialize the display, console, FS, etc. */ setup_env(); - print(SCREEN_LOG_LEVEL_MANDATORY, u8"Welcome to Atmosphère Fusée Stage 2!\n"); + print(SCREEN_LOG_LEVEL_DEBUG | SCREEN_LOG_LEVEL_NO_PREFIX, u8"Welcome to Atmosphère Fusée Stage 2!\n"); print(SCREEN_LOG_LEVEL_DEBUG, "Stage 2 executing from: %s\n", (const char *)argv[STAGE2_ARGV_PROGRAM_PATH]); /* This will load all remaining binaries off of the SD. */ @@ -105,6 +106,9 @@ int main(int argc, void **argv) { g_do_nxboot = loader_ctx->chainload_entrypoint == 0; if (g_do_nxboot) { + /* Display splash screen. */ + display_splash_screen_bmp(loader_ctx->custom_splash_path, (void *)0xC0000000); + print(SCREEN_LOG_LEVEL_MANDATORY, "Now performing nxboot.\n"); uint32_t boot_memaddr = nxboot_main(); nxboot_finish(boot_memaddr); diff --git a/fusee/fusee-secondary/src/nxboot.c b/fusee/fusee-secondary/src/nxboot.c index 6879d4ec8..18697e75a 100644 --- a/fusee/fusee-secondary/src/nxboot.c +++ b/fusee/fusee-secondary/src/nxboot.c @@ -43,7 +43,6 @@ #include "tsec.h" #include "lp0.h" #include "loader.h" -#include "splash_screen.h" #include "exocfg.h" #include "display/video_fb.h" #include "lib/ini.h" @@ -567,9 +566,6 @@ uint32_t nxboot_main(void) { print(SCREEN_LOG_LEVEL_INFO, "[NXBOOT]: Powering on the CCPLEX...\n"); - /* Display splash screen. */ - display_splash_screen_bmp(loader_ctx->custom_splash_path, (void *)0xC0000000); - /* Unmount everything. */ nxfs_unmount_all(); diff --git a/fusee/fusee-secondary/src/splash_screen.c b/fusee/fusee-secondary/src/splash_screen.c index 37cc63d9d..1e21f252c 100644 --- a/fusee/fusee-secondary/src/splash_screen.c +++ b/fusee/fusee-secondary/src/splash_screen.c @@ -85,6 +85,6 @@ void display_splash_screen_bmp(const char *custom_splash_path, void *fb_address) fatal_error("Invalid splash screen format!\n"); } - /* Display the splash screen for three seconds. */ - udelay(3000000); + /* Display the splash screen for two and a half seconds. */ + udelay(2500000); }