|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Assert and panic for embedded firmware. More...
Assert and panic for embedded firmware.
Provides SBL_ASSERT(cond) and SBL_PANIC(msg) macros that output diagnostic info and halt the processor.
The output sink is SBL_FAULT_OUTPUT, a type with static void write(const char*). The default writes nothing: the fault still halts, silently, and needs no hardware. An app that wants the message defines SBL_FAULT_OUTPUT before including this header; the polling UART sink is sbl::uart::FaultOutput in <sbl/hw/hal/uart/log_output.hpp>. Fault handlers run with interrupts off, so the sink must write by polling. For HardFault register dumps, also include <sbl/system/fault.hpp>.
Usage:
Configuration:
Definition in file assert.hpp.
Go to the source code of this file.
Namespaces | |
| namespace | sbl |
| Root namespace for all Sound Byte Libs code. | |
| namespace | sbl::system |
| The system layer: execution levels, the control critical section, ring buffers, assertions and the fault handler, profiling, and the port contracts. | |
| namespace | sbl::system::fault |
| Assertions, panic and the HardFault handler. | |
Macros | |
| #define | SBL_FAULT_OUTPUT sbl::system::fault::detail::NullFaultOutput |
| #define | SBL_PANIC(msg) sbl::system::fault::panic("PANIC: " msg, __FILE__, __LINE__) |
| #define | SBL_ASSERT_ENABLED 1 |
| #define | SBL_ASSERT(cond) ((void)0) |
Functions | |
| void | sbl::system::fault::panic (const char *msg, const char *file, int line) |
| Halt with a diagnostic message. Does not return. | |
| #define SBL_FAULT_OUTPUT sbl::system::fault::detail::NullFaultOutput |
Definition at line 54 of file assert.hpp.
| #define SBL_PANIC | ( | msg | ) | sbl::system::fault::panic("PANIC: " msg, __FILE__, __LINE__) |
Definition at line 83 of file assert.hpp.
| #define SBL_ASSERT_ENABLED 1 |
Definition at line 86 of file assert.hpp.
| #define SBL_ASSERT | ( | cond | ) | ((void)0) |
Definition at line 97 of file assert.hpp.