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.)
| 523 | // confused, so I use this table from the examples.) |
| 524 | // |
| 525 | uint8_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. |
no outgoing calls
no test coverage detected