Hello,
Please consider the following patch. I believe that saving bit 0 of
the __crc register into T is unnecessary, as the LSR instruction will
automatically save the same bit into C.
Regards,
--
Krzysztof Kościuszkiewicz
Skype: dr.vee, Gadu: 111851, Jabber: [EMAIL PROTECTED]
"Simplicity is the ultimate sophistication" -- Leonardo da Vinci
diff -Naur -U 8 avr-libc-1.6.4/include/util/crc16.h avr-libc-1.6.4.new/include/util/crc16.h
--- avr-libc-1.6.4/include/util/crc16.h 2007-01-23 15:32:48.000000000 +0000
+++ avr-libc-1.6.4.new/include/util/crc16.h 2008-11-17 22:21:56.000000000 +0000
@@ -317,19 +317,18 @@
static __inline__ uint8_t
_crc_ibutton_update(uint8_t __crc, uint8_t __data)
{
uint8_t __i, __pattern;
__asm__ __volatile__ (
" eor %0, %4" "\n\t"
" ldi %1, 8" "\n\t"
" ldi %2, 0x8C" "\n\t"
- "1: bst %0, 0" "\n\t"
- " lsr %0" "\n\t"
- " brtc 2f" "\n\t"
+ "1: lsr %0" "\n\t"
+ " brcc 2f" "\n\t"
" eor %0, %2" "\n\t"
"2: dec %1" "\n\t"
" brne 1b" "\n\t"
: "=r" (__crc), "=d" (__i), "=d" (__pattern)
: "0" (__crc), "r" (__data));
return __crc;
}
_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev