diff --git a/core/lib/panic.c b/core/lib/panic.c index ed9dae261fe3..6e6fb5a8cf07 100644 --- a/core/lib/panic.c +++ b/core/lib/panic.c @@ -79,16 +79,18 @@ NORETURN void core_panic(core_panic_t crash_code, const char *message) /* disable watchdog and all possible sources of interrupts */ irq_disable(); panic_arch(); -#ifndef DEVELHELP +#if !defined(DEVELHELP) && defined(MODULE_PERIPH_PM) /* DEVELHELP not set => reboot system */ pm_reboot(); #else /* DEVELHELP set => power off system */ /* or start bootloader */ -#ifdef MODULE_USB_BOARD_RESET +#if defined(MODULE_USB_BOARD_RESET) usb_board_reset_in_bootloader(); -#else +#elif defined(MODULE_PERIPH_PM) pm_off(); +#else + while (1) {} #endif #endif /* DEVELHELP */ diff --git a/cpu/avr8_common/Makefile.dep b/cpu/avr8_common/Makefile.dep index a1a228d518c0..e6a7d7ff4629 100644 --- a/cpu/avr8_common/Makefile.dep +++ b/cpu/avr8_common/Makefile.dep @@ -5,7 +5,7 @@ USEMODULE += avr_libc_extra USEMODULE += avr8_common avr8_common_periph # All avr8 CPUs provide PM -USEMODULE += pm_layered +DEFAULT_MODULE += pm_layered # The AVR-libc provides no thread safe malloc implementation and has no hooks # to inject. Use malloc_thread_safe to link calls to malloc to safe wrappers