Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/panic: make reboot on panic configurable #20630

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/lib/include/panic.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
extern "C" {
#endif

/**
* @brief Automatically reboot the system on panic()
*
* By default this is on when @ref DEVELHELP is disabled.
*/
#ifndef CONFIG_CORE_REBOOT_ON_PANIC
#ifdef DEVELHELP
#define CONFIG_CORE_REBOOT_ON_PANIC (0)
#else
#define CONFIG_CORE_REBOOT_ON_PANIC (1)
#endif
#endif

/**
* @brief Definition of available panic modes
*/
Expand Down
2 changes: 1 addition & 1 deletion core/lib/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ NORETURN void core_panic(core_panic_t crash_code, const char *message)
/* disable watchdog and all possible sources of interrupts */
irq_disable();
panic_arch();
#if !defined(DEVELHELP) && defined(MODULE_PERIPH_PM)
#if CONFIG_CORE_REBOOT_ON_PANIC && defined(MODULE_PERIPH_PM)
/* DEVELHELP not set => reboot system */
pm_reboot();
#else
Expand Down
Loading