Skip to content

Commit

Permalink
Merge pull request #20247 from benpicco/cpu/avr8-pm_layered
Browse files Browse the repository at this point in the history
cpu/avr8_common: allow to build with !periph_pm
  • Loading branch information
benpicco authored Jan 11, 2024
2 parents 0c80553 + ce36ca5 commit 47b5eeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core/lib/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion cpu/avr8_common/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 47b5eeb

Please sign in to comment.