From 5d3715fb81f14b6f0f7cc83300108a732fc61aff Mon Sep 17 00:00:00 2001 From: HattoriHanzo031 Date: Wed, 2 Oct 2024 18:13:19 +0200 Subject: [PATCH] updated onewire interface --- ds18b20/ds18b20.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ds18b20/ds18b20.go b/ds18b20/ds18b20.go index 3553661b7..ccbb9fdba 100644 --- a/ds18b20/ds18b20.go +++ b/ds18b20/ds18b20.go @@ -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. @@ -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