1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #16917 from maribu/cpu/avr8_common/cleanup

cpu/avr8_common: Clean up cpu_print_last_inscrution()
This commit is contained in:
Marian Buschsieweke 2021-09-30 13:29:01 +02:00 committed by GitHub
commit 7bfc1814ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,13 +180,14 @@ static inline void __attribute__((always_inline)) cpu_print_last_instruction(voi
uint8_t lo; uint8_t lo;
uint16_t ptr; uint16_t ptr;
__asm__ volatile ("in __tmp_reg__, __SP_H__ \n\t" __asm__ volatile (
"mov %0, __tmp_reg__ \n\t" "in %[hi], __SP_H__ \n\t"
: "=g" (hi)); "in %[lo], __SP_L__ \n\t"
: [hi] "=r"(hi),
__asm__ volatile ("in __tmp_reg__, __SP_L__ \n\t" [lo] "=r"(lo)
"mov %0, __tmp_reg__ \n\t" : /* no inputs */
: "=g" (lo)); : /* no clobbers */
);
ptr = hi << 8 | lo; ptr = hi << 8 | lo;
printf("Stack Pointer: 0x%04x\n", ptr); printf("Stack Pointer: 0x%04x\n", ptr);
} }