diff --git a/src/Platform.cpp b/src/Platform.cpp index 0106175..0d44e0f 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -142,6 +142,30 @@ Platform::bootSplash() Log.notice(u8" 4: Flash - %d", bootopts.isFlash); #endif + if (bootopts.crashCount > 0) { + Log.warning(u8"Previous crash detected!!!! We're on attempt %d", bootopts.crashCount); + char lastTaskBuf[16]; + strncpy(lastTaskBuf, MainLoop::lastTaskName(), sizeof(lastTaskBuf)); + lastTaskBuf[15] = 0; + Log.error(u8"Crash occurred in task %s", lastTaskBuf); + +#ifdef BOARD_ESP8266 + auto rInfo = ESP.getResetInfoPtr(); + if (Platform::bootopts.resetReason == REASON_EXCEPTION_RST) { + Log.error("Fatal exception (%d):", rInfo->exccause); + } + Log.error("epc1=%X, epc2=%X, epc3=%X, excvaddr=%X, depc=%X", + rInfo->epc1, rInfo->epc2, rInfo->epc3, rInfo->excvaddr, rInfo->depc); +#endif + + strncpy(lastTaskBuf, Renderer::lastFigmentName(), sizeof(lastTaskBuf)); + lastTaskBuf[15] = 0; + Log.error(u8"Last Figment was %s", lastTaskBuf); + } + + Log.trace("Startup reason: %d", bootopts.resetReason); + + Log.trace("Registered tasks:"); auto it = beginTasks(); while (it != endTasks()) { diff --git a/src/main.cpp b/src/main.cpp index e102237..5f42716 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -87,16 +87,6 @@ void setup() { 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[16]; - 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);