Furi crash and assert functions. More...
#include <m-core.h>
#include "common_defines.h"
Go to the source code of this file.
Macros | |
#define | __FURI_ASSERT_MESSAGE_FLAG (0x01) |
#define | __FURI_CHECK_MESSAGE_FLAG (0x02) |
#define | __furi_crash(message) |
Crash system with message. | |
#define | furi_crash(...) |
Crash system. | |
#define | __furi_halt(message) |
Halt system with message. | |
#define | furi_halt(...) |
Halt system. | |
#define | __furi_check(__e, __m) |
Check condition and crash if check failed. | |
#define | furi_check(...) |
Check condition and crash if failed. | |
#define | __furi_assert(__e, __m) |
Only in debug build: Assert condition and crash if assert failed | |
#define | furi_assert(...) |
Assert condition and crash if failed. | |
#define | furi_break(__e) |
Functions | |
FURI_NORETURN void | __furi_crash_implementation (void) |
Crash system. | |
FURI_NORETURN void | __furi_halt_implementation (void) |
Halt system. | |
Furi crash and assert functions.
The main problem with crashing is that you can't do anything without disturbing registers, and if you disturb registers, you won't be able to see the correct register values in the debugger.
Current solution works around it by passing the message through r12 and doing some magic with registers in crash function. r0-r10 are stored in the ram2 on crash routine start and restored at the end. The only register that is going to be lost is r11.
#define __furi_assert | ( | __e, | |
__m ) |
Only in debug build: Assert condition and crash if assert failed
#define __furi_check | ( | __e, | |
__m ) |
Check condition and crash if check failed.
#define __furi_crash | ( | message | ) |
Crash system with message.
Show message after reboot.
#define __furi_halt | ( | message | ) |
Halt system with message.
#define furi_assert | ( | ... | ) |
Assert condition and crash if failed.
... | condition to check and optional message (const char*) |
#define furi_break | ( | __e | ) |
#define furi_check | ( | ... | ) |
Check condition and crash if failed.
... | condition to check and optional message (const char*) |
#define furi_crash | ( | ... | ) |
Crash system.
... | optional message (const char*) |
#define furi_halt | ( | ... | ) |
Halt system.
... | optional message (const char*) |