milesburton / Arduino-Temperature-Control-Library

Arduino Temperature Library
https://www.milesburton.com/w/index.php/Dallas_Temperature_Control_Library
969 stars 487 forks source link

Replace DS ROM magic numbers by constants #158

Closed RobTillaart closed 4 years ago

RobTillaart commented 4 years ago

minor issue

Every DS has a 8 byte address {DSROM] that consist of a Family code, a serial number and a CRC. In the code of the library there are (at least) 6 spots that use magic numbers as indices to address individual bytes of the address. Propose to use more informative constants like:

#define DSROM_FAMILY_CODE  0
#define DSROM_CRC  7