| 88 | } |
| 89 | |
| 90 | void checkPanic() { |
| 91 | if (isRebootFromPanic()) { |
| 92 | auto panicInfo = getPanicInfo(true); |
| 93 | auto file = Storage.open("/crash_report.txt", O_WRITE | O_CREAT | O_TRUNC); |
| 94 | if (file) { |
| 95 | file.write(panicInfo.c_str(), panicInfo.size()); |
| 96 | file.close(); |
| 97 | LOG_INF("SYS", "Dumped panic info to SD card"); |
| 98 | } else { |
| 99 | LOG_ERR("SYS", "Failed to open crash_report.txt for writing"); |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | void clearPanic() { |
| 105 | panicMessage[0] = '\0'; |
no test coverage detected