PaulStoffregen / OneWire

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

reset() API uses 0 for multiple purposes #79

Open nomis opened 4 years ago

nomis commented 4 years ago
    // Perform a 1-Wire reset cycle. Returns 1 if a device responds
    // with a presence pulse.  Returns 0 if there is no device or the
    // bus is shorted or otherwise held low for more than 250uS
    uint8_t reset(void);

Having two different meanings for 0 is not helpful and requires modifying the code to find out which of the two outcomes has occurred.