1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/avr8_common: Clean up cpu_print_last_inscrution()

This commit is contained in:
Marian Buschsieweke 2021-09-30 10:39:21 +02:00
parent 7313a1c28c
commit 417bc949ab
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

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);
}