From 337ec2bd007a55d6e97896ef36395c0d25c98b88 Mon Sep 17 00:00:00 2001 From: Tom Lanser Date: Wed, 15 Feb 2023 19:46:12 +0000 Subject: [PATCH] Updated dependencies and build constraints (#6) --- dht.go | 2 +- dhtNotWindows.go | 7 ++++--- dhtWindows.go | 1 + globals.go | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dht.go b/dht.go index 5390597..2071b64 100644 --- a/dht.go +++ b/dht.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "periph.io/x/periph/host" + "periph.io/x/host/v3" ) // HostInit calls periph.io host.Init(). This needs to be done before DHT can be used. diff --git a/dhtNotWindows.go b/dhtNotWindows.go index 62c03bb..e0c465b 100644 --- a/dhtNotWindows.go +++ b/dhtNotWindows.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package dht @@ -8,8 +9,8 @@ import ( "strings" "time" - "periph.io/x/periph/conn/gpio" - "periph.io/x/periph/conn/gpio/gpioreg" + "periph.io/x/conn/v3/gpio" + "periph.io/x/conn/v3/gpio/gpioreg" ) // NewDHT to create a new DHT struct. @@ -142,7 +143,7 @@ func (dht *DHT) readBits() ([]int, error) { if durations[i] > 70*time.Microsecond { return nil, fmt.Errorf("missing some readings - low level duration too long: %v", durations[i]) } - // low should not be shorter then 35 microseconds + // low should not be shorter than 35 microseconds if durations[i] < 35*time.Microsecond { return nil, fmt.Errorf("missing some readings - low level duration too short: %v", durations[i]) } diff --git a/dhtWindows.go b/dhtWindows.go index 28bd333..538e9a7 100644 --- a/dhtWindows.go +++ b/dhtWindows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package dht diff --git a/globals.go b/globals.go index 57b8b70..fb91b30 100644 --- a/globals.go +++ b/globals.go @@ -3,7 +3,7 @@ package dht import ( "time" - "periph.io/x/periph/conn/gpio" + "periph.io/x/conn/v3/gpio" ) // TemperatureUnit is the temperature unit wanted, either Celsius or Fahrenheit