feat: show crash reason on boot (#1453)
## Summary If the system reboots from crash, display the reason and tell user to include `crash_report.txt` file. To test this, simply add an `assert(false)` somewhere inside the code.  --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? **NO**
This commit is contained in:
+7
-5
@@ -253,7 +253,6 @@ void setup() {
|
||||
}
|
||||
|
||||
HalSystem::checkPanic();
|
||||
HalSystem::clearPanic(); // TODO: move this to an activity when we have one to display the panic info
|
||||
|
||||
SETTINGS.loadFromFile();
|
||||
I18N.loadSettings();
|
||||
@@ -290,10 +289,13 @@ void setup() {
|
||||
APP_STATE.loadFromFile();
|
||||
RECENT_BOOKS.loadFromFile();
|
||||
|
||||
// Boot to home screen if no book is open, last sleep was not from reader, back button is held, or reader activity
|
||||
// crashed (indicated by readerActivityLoadCount > 0)
|
||||
if (APP_STATE.openEpubPath.empty() || !APP_STATE.lastSleepFromReader ||
|
||||
mappedInputManager.isPressed(MappedInputManager::Button::Back) || APP_STATE.readerActivityLoadCount > 0) {
|
||||
if (HalSystem::isRebootFromPanic()) {
|
||||
// If we rebooted from a panic, go to crash report screen to show the panic info
|
||||
activityManager.goToCrashReport();
|
||||
} else if (APP_STATE.openEpubPath.empty() || !APP_STATE.lastSleepFromReader ||
|
||||
mappedInputManager.isPressed(MappedInputManager::Button::Back) || APP_STATE.readerActivityLoadCount > 0) {
|
||||
// Boot to home screen if no book is open, last sleep was not from reader, back button is held, or reader activity
|
||||
// crashed (indicated by readerActivityLoadCount > 0)
|
||||
activityManager.goHome();
|
||||
} else {
|
||||
// Clear app state to avoid getting into a boot loop if the epub doesn't load
|
||||
|
||||
Reference in New Issue
Block a user