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

cpu/avr8_common: allow to build with !periph_pm #20247

Merged
merged 2 commits into from
Jan 11, 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
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