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

Function getPanicInfo

lib/hal/HalSystem.cpp:112–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112std::string getPanicInfo(bool full) {
113 if (!full) {
114 return panicMessage;
115 } else {
116 std::string info;
117
118 info += "CrossPoint version: " CROSSPOINT_VERSION;
119 info += "\n\nPanic reason: " + std::string(panicMessage);
120 info += "\n\nLast logs:\n" + getLastLogs();
121 info += "\n\nStack memory:\n";
122
123 auto toHex = [](uint32_t value) {
124 char buffer[9];
125 snprintf(buffer, sizeof(buffer), "%08X", value);
126 return std::string(buffer);
127 };
128 for (size_t i = 0; i < MAX_PANIC_STACK_DEPTH; i++) {
129 if (panicStack[i].sp == 0) {
130 break;
131 }
132 info += "0x" + toHex(panicStack[i].sp) + ": ";
133 for (size_t j = 0; j < 8; j++) {
134 info += "0x" + toHex(panicStack[i].spp[j]) + " ";
135 }
136 info += "\n";
137 }
138
139 return info;
140 }
141}
142
143bool isRebootFromPanic() {
144 const auto resetReason = esp_reset_reason();

Callers 2

checkPanicFunction · 0.85
onEnterMethod · 0.85

Calls 1

getLastLogsFunction · 0.85

Tested by

no test coverage detected