42#ifndef SBL_FAULT_OUTPUT
45 #if SBL_LOG_HW_DEFAULTS_AVAILABLE
46 #define SBL_FAULT_OUTPUT sbl::log::UartFaultOutput
51 static void write(
const char*) {}
54 #define SBL_FAULT_OUTPUT sbl::fault::detail::NullFaultOutput
68[[noreturn]]
inline void panic(
const char* msg,
const char* file,
int line) {
69 __asm
volatile(
"cpsid i");
72 sbl::log::format(buf,
sizeof(buf),
"\r\n!!! %s\r\n at %s:%d\r\n", msg, file, line);
73 SBL_FAULT_OUTPUT::write(buf);
76 __asm
volatile(
"bkpt #0");
86#define SBL_PANIC(msg) sbl::fault::panic("PANIC: " msg, __FILE__, __LINE__)
88#ifndef SBL_ASSERT_ENABLED
89 #define SBL_ASSERT_ENABLED 1
93 #define SBL_ASSERT(cond) \
96 sbl::fault::panic("ASSERT FAILED: " #cond, __FILE__, __LINE__); \
100 #define SBL_ASSERT(cond) ((void)0)
Default logger output sink and timestamp provider.
void panic(const char *msg, const char *file, int line)
Halt with a diagnostic message. Does not return.
int format(char *buf, size_t size, const char *fmt,...)
Format a string into a buffer (snprintf-style)
static void write(const char *)