PaulStoffregen / OneWire

Library for Dallas/Maxim 1-Wire Chips
http://www.pjrc.com/teensy/td_libs_OneWire.html
579 stars 382 forks source link

Use avr-libc implementation of crc8 #12

Closed tico-tico closed 8 years ago

tico-tico commented 8 years ago

They have a nice implementation of crc8 in assembly language. The result is smaller and (i guess) faster. They have crc16 as well, but i can't understand what you are doing in the code, so i can't propose any changes for crc16.

orgua commented 8 years ago

I have tested the 16-bit Version on an atmega328 @16MHz with 254 bytes payload:

tico-tico commented 8 years ago

You mean you used asm function _crc16_update(uint16_t __crc, uint8_t __data) and you liked it?

orgua commented 8 years ago

indeed, i did. and it returned the right value too. could you imagine?

tico-tico commented 8 years ago

could you imagine?

ah! the magic indeed! https://github.com/PaulStoffregen/OneWire/pull/13