1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +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;
uint16_t ptr;
__asm__ volatile ("in __tmp_reg__, __SP_H__ \n\t"
"mov %0, __tmp_reg__ \n\t"
: "=g" (hi));
__asm__ volatile ("in __tmp_reg__, __SP_L__ \n\t"
"mov %0, __tmp_reg__ \n\t"
: "=g" (lo));
__asm__ volatile (
"in %[hi], __SP_H__ \n\t"
"in %[lo], __SP_L__ \n\t"
: [hi] "=r"(hi),
[lo] "=r"(lo)
: /* no inputs */
: /* no clobbers */
);
ptr = hi << 8 | lo;
printf("Stack Pointer: 0x%04x\n", ptr);
}