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:
commit
7bfc1814ae
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user