mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core/panic: make reboot on panic configurable
This commit is contained in:
parent
70c70e2afc
commit
9e0a32e011
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user