DavidAntliff / esp32-ds18b20

ESP32-compatible C library for Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer.
MIT License
100 stars 32 forks source link

Refactor `ds18b20_read_temp` to use `_read_scratchpad` #5

Closed DavidAntliff closed 4 years ago

DavidAntliff commented 5 years ago

https://github.com/DavidAntliff/esp32-ds18b20/blob/359cf918e3f641159283b5ae96cd939df28ef6e6/ds18b20.c#L434

Unnecessary use of a magic number (9) - instead consider using _read_scratchpad() and refactoring to support CRC checking.