Skip to content

Commit

Permalink
updated onewire interface
Browse files Browse the repository at this point in the history
  • Loading branch information
HattoriHanzo031 committed Oct 2, 2024
1 parent 8bad7a7 commit 5d3715f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ds18b20/ds18b20.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type OneWireDevice interface {
Write(uint8)
Read() uint8
Select([]uint8) error
Сrc8([]uint8, int) uint8
Сrc8([]uint8) uint8
}

// Device wraps a connection to an 1-Wire devices.
Expand Down Expand Up @@ -69,7 +69,7 @@ func (d Device) ReadTemperatureRaw(romid []uint8) ([]uint8, error) {
for i := 0; i < 9; i++ {
spb[i] = d.owd.Read()
}
if d.owd.Сrc8(spb, 8) != spb[8] {
if d.owd.Сrc8(spb) != 0 {
return nil, errReadTemperature
}
return spb[:2:2], nil
Expand Down

0 comments on commit 5d3715f

Please sign in to comment.