mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
FURI_TRACE (useful furi_check() crashes) --nobuild
This commit is contained in:
@@ -136,10 +136,12 @@ FURI_NORETURN void __furi_crash() {
|
||||
|
||||
if(__furi_check_message == NULL) {
|
||||
__furi_check_message = "Fatal Error";
|
||||
#ifndef __FURI_TRACE
|
||||
} else if(__furi_check_message == (void*)__FURI_ASSERT_MESSAGE_FLAG) {
|
||||
__furi_check_message = "furi_assert failed";
|
||||
} else if(__furi_check_message == (void*)__FURI_CHECK_MESSAGE_FLAG) {
|
||||
__furi_check_message = "furi_check failed";
|
||||
#endif
|
||||
}
|
||||
|
||||
furi_hal_console_puts("\r\n\033[0;31m[CRASH]");
|
||||
|
||||
@@ -23,9 +23,16 @@ extern "C" {
|
||||
#define FURI_NORETURN noreturn
|
||||
#endif
|
||||
|
||||
#define __FURI_TRACE
|
||||
|
||||
// Flags instead of pointers will save ~4 bytes on furi_assert and furi_check calls.
|
||||
#ifndef __FURI_TRACE
|
||||
#define __FURI_ASSERT_MESSAGE_FLAG (0x01)
|
||||
#define __FURI_CHECK_MESSAGE_FLAG (0x02)
|
||||
#else
|
||||
#define __FURI_ASSERT_MESSAGE_FLAG __FILE__
|
||||
#define __FURI_CHECK_MESSAGE_FLAG __FILE__
|
||||
#endif
|
||||
|
||||
/** Crash system */
|
||||
FURI_NORETURN void __furi_crash();
|
||||
|
||||
Reference in New Issue
Block a user