Skip to content

Commit

Permalink
Merge pull request #20790 from benpicco/log_panic
Browse files Browse the repository at this point in the history
core/panic: don't use LOG_ functions in panic handler
  • Loading branch information
Teufelchen1 authored Jul 17, 2024
2 parents 06a19bd + 3237ed9 commit 388a7d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions core/lib/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/

#include <stdio.h>
#include "kernel_defines.h"
#include "cpu.h"
#include "irq.h"
#include "panic.h"
#include "periph/pm.h"
#include "log.h"

#if defined(DEVELHELP) && defined(MODULE_PS)
#include "ps.h"
Expand Down Expand Up @@ -64,16 +64,16 @@ NORETURN void core_panic(core_panic_t crash_code, const char *message)

/* 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);
printf("*** RIOT kernel panic:\n%s\n\n", message);
#ifdef DEVELHELP
#ifdef MODULE_PS
ps();
LOG_ERROR("\n");
printf("\n");
#endif

LOG_ERROR("*** halted.\n\n");
printf("*** halted.\n\n");
#else
LOG_ERROR("*** rebooting...\n\n");
printf("*** rebooting...\n\n");
#endif
}
/* disable watchdog and all possible sources of interrupts */
Expand Down
4 changes: 2 additions & 2 deletions cpu/cortexm_common/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* @author Toon Stegen <toon.stegen@altran.com>
*/

#include <stdio.h>
#include "cpu.h"
#include "log.h"

#ifdef DEVELHELP
static void print_ipsr(void)
Expand All @@ -31,7 +31,7 @@ static void print_ipsr(void)
if (ipsr) {
/* if you get here, you might have forgotten to implement the isr
* for the printed interrupt number */
LOG_ERROR("Inside isr %d\n", ((int)ipsr) - 16);
printf("Inside isr %d\n", ((int)ipsr) - 16);
}
}
#endif
Expand Down

0 comments on commit 388a7d4

Please sign in to comment.