#pragma once #include #include #include "key_value_store.h" namespace roro::crash_report { // First thing at boot: remembers which version runs, and after a crash restart, which version // crashed (the one that ran last time, even if a Rollback has switched slots since). Returns how // many starts in a row ended in a crash, for Safe Mode. int noteBoot(KeyValueStore& store); // The device has been up long enough: the crash streak is over. void noteStable(KeyValueStore& store); // The last crash: which firmware, why, and the task, PC and backtrace from the core dump in flash. // Decode the backtrace on the PC with scripts/decode_backtrace.sh . void print(Print& out, KeyValueStore& store); // One line for a Notification after a crash restart, e.g. "Restarted after a crash in loopTask". std::string headline(); // Forgets the core dump, so the next crash's is the one kept. bool erase(); } // namespace roro::crash_report