Skip to content

Commit

Permalink
make panic loop back to breakpoint FWIW, and remove spurious header (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham authored Nov 21, 2024
1 parent f3459a4 commit 31c1be5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/rp2_common/pico_platform_panic/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <sys/cdefs.h>
#include <unistd.h>
#include "pico.h"
#include "pico/platform/panic.h"

#if LIB_PICO_PRINTF_PICO
#include "pico/printf.h"
Expand Down Expand Up @@ -38,17 +37,17 @@ void __attribute__((naked, noreturn)) __printflike(1, 0) panic(__unused const ch
#if !PICO_PANIC_FUNCTION_EMPTY
"jal " __XSTRING(PICO_PANIC_FUNCTION) "\n"
#endif
"ebreak\n"
"1: j 1b\n"
"1: ebreak\n"
"j 1b\n"

#else

"push {lr}\n"
#if !PICO_PANIC_FUNCTION_EMPTY
"bl " __XSTRING(PICO_PANIC_FUNCTION) "\n"
#endif
"bkpt #0\n"
"1: b 1b\n" // loop for ever as we are no return
"1: bkpt #0\n"
"b 1b\n" // loop for ever as we are no return

#endif
:
Expand Down

0 comments on commit 31c1be5

Please sign in to comment.