platform: move some startup state reporting from main to platform
This commit is contained in:
parent
d592810b3b
commit
e9f63e718c
@ -142,6 +142,30 @@ Platform::bootSplash()
|
|||||||
Log.notice(u8" 4: Flash - %d", bootopts.isFlash);
|
Log.notice(u8" 4: Flash - %d", bootopts.isFlash);
|
||||||
#endif
|
#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:");
|
Log.trace("Registered tasks:");
|
||||||
auto it = beginTasks();
|
auto it = beginTasks();
|
||||||
while (it != endTasks()) {
|
while (it != endTasks()) {
|
||||||
|
10
src/main.cpp
10
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"🐞 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());
|
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)");
|
Log.notice(u8"Setting timezone to +2 (CEST)");
|
||||||
Platform::setTimezone(+2);
|
Platform::setTimezone(+2);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user