1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #14913 from OTAkeys/pr/panic_cb

core/panic: callback app during panic
This commit is contained in:
Kaspar Schleiser 2020-09-01 10:50:02 +02:00 committed by GitHub
commit 55c63f400e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,9 +48,11 @@ const char assert_crash_message[] = "FAILED ASSERTION.";
/* flag preventing "recursive crash printing loop" */
static int crashed = 0;
void __attribute__((weak)) panic_arch(void)
void __attribute__((weak)) panic_arch(void) {}
void __attribute__((weak)) panic_app(core_panic_t crash_code, const char *message)
{
return;
(void)crash_code;
(void)message;
}
/* WARNING: this function NEVER returns! */
@ -68,6 +70,8 @@ NORETURN void core_panic(core_panic_t crash_code, const char *message)
cpu_print_last_instruction();
}
#endif
/* Call back app in case it wants to store some context */
panic_app(crash_code, message);
LOG_ERROR("*** RIOT kernel panic:\n%s\n\n", message);
#ifdef DEVELHELP
#ifdef MODULE_PS