@brief Return a static-lifetime name for `c` — zero-cost, no allocation. String literal lives in flash on embedded platforms. Safe to call from any context (ISR, panic handler, before setup() finishes). Backed by `fl::string_view` so the result has no destructor and can be passed by value freely.
| 59 | /// `fl::string_view` so the result has no destructor and can be passed by |
| 60 | /// value freely. |
| 61 | inline fl::string_view resetCauseName(ResetCause c) FL_NOEXCEPT { |
| 62 | switch (c) { |
| 63 | case ResetCause::POWER_ON: return fl::string_view("POWER_ON"); |
| 64 | case ResetCause::BROWNOUT: return fl::string_view("BROWNOUT"); |
| 65 | case ResetCause::EXTERNAL_PIN: return fl::string_view("EXTERNAL_PIN"); |
| 66 | case ResetCause::WATCHDOG: return fl::string_view("WATCHDOG"); |
| 67 | case ResetCause::SOFTWARE: return fl::string_view("SOFTWARE"); |
| 68 | case ResetCause::LOCKUP: return fl::string_view("LOCKUP"); |
| 69 | case ResetCause::DEBUGGER: return fl::string_view("DEBUGGER"); |
| 70 | case ResetCause::PANIC: return fl::string_view("PANIC"); |
| 71 | case ResetCause::UNKNOWN: |
| 72 | default: return fl::string_view("UNKNOWN"); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | /// @brief Detailed reset information bundling the normalized cause with a |
| 77 | /// platform-specific subcause id and the raw cause-register value. |
no test coverage detected