]> git.tdb.fi Git - model-railway-devices.git/commitdiff
Fix an inline asm constraint
authorMikko Rasa <tdb@tdb.fi>
Mon, 13 May 2013 17:47:59 +0000 (20:47 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 13 May 2013 17:47:59 +0000 (20:47 +0300)
The sbiw instruction is limited to certain word-capable registers, and the
compiler needs to be informed that such a register is needed.

common/delay.h

index 725d22b5b41fe6ce6bcf00eff5373ae847b533e3..9b8137601c0d187fdf0dd515a6592df16f40c93e 100644 (file)
@@ -16,7 +16,7 @@ static inline void __attribute__((always_inline)) delay_loop16(uint16_t count)
        __asm__ volatile (
                "1: sbiw %0, 1" "\n\t"
                "brne 1b"
-               : "=r" (count)
+               : "=w" (count)
                : "0" (count)
        );
 }