From ccb58082a27d636cde70e40261e374b2fb1d34b2 Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Sun, 19 Feb 2023 18:46:43 +0100 Subject: [PATCH] main: tweak log levels, add crash info --- src/main.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 73fa4ee..6bf50bd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,13 +84,23 @@ void setup() { // Turn on, Platform::preSetup(); Log.notice(u8"🐛 Booting Renderbug!"); - Log.notice(u8"🐞 I am built for %d LEDs running on %dmA", HardwareConfig::MAX_LED_NUM, PSU_MILLIAMPS); + Log.notice(u8"🐞 I am built for %d LEDs on pin %d", HardwareConfig::MAX_LED_NUM, RENDERBUG_LED_PIN); Log.notice(u8"📡 Platform %s version %s", Platform::name(), Platform::version()); + if (Platform::bootopts.crashCount > 0) { + Log.warning(u8"Previous crash detected!!!! We're on attempt %d", Platform::bootopts.crashCount); + char lastTaskBuf[15]; + strncpy(lastTaskBuf, MainLoop::lastTaskName(), sizeof(lastTaskBuf)); + lastTaskBuf[15] = 0; + Log.error(u8"Crash occurred in task %s", lastTaskBuf); + } + + Log.trace("Startup reason: %d", Platform::bootopts.resetReason); + Log.notice(u8"Setting timezone to +2 (CEST)"); Platform::setTimezone(+2); - Log.notice(u8"Setting up platform..."); + Log.trace(u8"Setting up platform..."); Platform::setup(); Platform::bootSplash(); @@ -100,7 +110,7 @@ void setup() { // Tune in, if (Platform::bootopts.isSafeMode) { - Log.notice(u8"⚠️ Starting Figment in safe mode!!!"); + Log.error(u8"⚠️ Starting Figment in safe mode!!!"); runner = &SafeMode::safeModeApp; FastLED.showColor(CRGB(5, 0, 0)); FastLED.show(); @@ -108,7 +118,7 @@ void setup() { Log.notice(u8"🌌 Starting Figment..."); if (Platform::bootopts.isSetup) { - Log.notice(u8"🔧 Booting up into setup profile!!!"); + Log.warning(u8"🔧 Booting up into setup profile!!!"); Static::instance()->overrideProfile("setup"); }