From 35a1b60068d8efadf3beb31b71c9022a5856bdd9 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 30 Sep 2021 15:25:21 +0200 Subject: [PATCH] cpu/{atxmega,atmega_common}: fix invalid use of PSTR() core_panic() doesn't expect the message to be in program memory, but in data memory. Bad things will happen on AVR when the address is interpreted as being in data address space, but the allocation is done in program address space. --- cpu/atmega_common/atmega_cpu.c | 5 +---- cpu/atxmega/atxmega_cpu.c | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cpu/atmega_common/atmega_cpu.c b/cpu/atmega_common/atmega_cpu.c index c9a5968473..52d93bf4c5 100644 --- a/cpu/atmega_common/atmega_cpu.c +++ b/cpu/atmega_common/atmega_cpu.c @@ -26,8 +26,6 @@ * @} */ -#include - #include "board.h" #include "cpu.h" #include "panic.h" @@ -100,8 +98,7 @@ ISR(BADISR_vect) LED_PANIC; #endif - core_panic(PANIC_GENERAL_ERROR, PSTR("FATAL ERROR: BADISR_vect called, unprocessed Interrupt.\n" - "STOP Execution.\n")); + core_panic(PANIC_GENERAL_ERROR, "BADISR"); } #if defined(CPU_ATMEGA128RFA1) || defined (CPU_ATMEGA256RFR2) diff --git a/cpu/atxmega/atxmega_cpu.c b/cpu/atxmega/atxmega_cpu.c index c6eba0c71d..82b60e5b14 100644 --- a/cpu/atxmega/atxmega_cpu.c +++ b/cpu/atxmega/atxmega_cpu.c @@ -18,8 +18,6 @@ * @} */ -#include - #include "cpu.h" #include "cpu_clock.h" #include "cpu_pm.h" @@ -121,7 +119,5 @@ ISR(BADISR_vect) LED_PANIC; #endif - core_panic(PANIC_GENERAL_ERROR, - PSTR("FATAL ERROR: BADISR_vect called, unprocessed Interrupt.\n" - "STOP Execution.\n")); + core_panic(PANIC_GENERAL_ERROR, "BADISR"); }