MCPcopy Create free account
hub / github.com/FastLED/FastLED / resetCauseName

Function resetCauseName

src/fl/wdt/watchdog.h:61–74  ·  view source on GitHub ↗

@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.

Source from the content-addressed store, hash-verified

59/// `fl::string_view` so the result has no destructor and can be passed by
60/// value freely.
61inline 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.

Callers 2

causeNameMethod · 0.85
watchdog.cppFile · 0.85

Calls 1

string_viewClass · 0.50

Tested by

no test coverage detected