MCPcopy Index your code
hub / github.com/crosspoint-reader/crosspoint-reader / begin

Function begin

lib/hal/HalSystem.cpp:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71namespace HalSystem {
72
73void begin() {
74 // This is mostly for the first boot, we need to initialize the panic info and logs to empty state
75 // If we reboot from a panic state, we want to keep the panic info until we successfully dump it to the SD card, use
76 // `clearPanic()` to clear it after dumping
77 if (!isRebootFromPanic()) {
78 clearPanic();
79 } else {
80 // Panic reboot: preserve logs and panic info, but clamp logHead in case the
81 // panic occurred before begin() ever ran (e.g. in a static constructor).
82 // If logHead was out of range, logMessages is also garbage — clear it so
83 // getLastLogs() does not dump corrupt data into the crash report.
84 if (sanitizeLogHead()) {
85 clearLastLogs();
86 }
87 }
88}
89
90void checkPanic() {
91 if (isRebootFromPanic()) {

Callers 3

sortFileListFunction · 0.85
setupFunction · 0.85
onEnterMethod · 0.85

Calls 4

isRebootFromPanicFunction · 0.85
clearPanicFunction · 0.85
sanitizeLogHeadFunction · 0.85
clearLastLogsFunction · 0.85

Tested by

no test coverage detected