MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / crc8

Method crc8

Arduino/libraries/OneWire/OneWire.cpp:525–533  ·  view source on GitHub ↗

Compute a Dallas Semiconductor 8 bit CRC. These show up in the ROM and the registers. (note: this might better be done without to table, it would probably be smaller and certainly fast enough compared to all those delayMicrosecond() calls. But I got confused, so I use this table from the examples.)

Source from the content-addressed store, hash-verified

523// confused, so I use this table from the examples.)
524//
525uint8_t OneWire::crc8(const uint8_t *addr, uint8_t len)
526{
527 uint8_t crc = 0;
528
529 while (len--) {
530 crc = pgm_read_byte(dscrc_table + (crc ^ *addr++));
531 }
532 return crc;
533}
534#else
535//
536// Compute a Dallas Semiconductor 8 bit CRC directly.

Callers 2

validAddressMethod · 0.80
isConnectedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected