updated dependencies

This commit is contained in:
didier committed 2024-08-09 10:16:42 -04:00
1 parent 27326eb1cb
commit 010b70b6fc
6 files changed
+16 -7

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ periph.io/x/conn/v3/pin
periph.io/x/conn/v3/pin/pinreg
periph.io/x/conn/v3/spi
periph.io/x/conn/v3/spi/spireg
# periph.io/x/host/v3 v3.8.2 => github.com/didiercrunch/host/v3 v3.8.3-0.20240804013031-ebd0129f1012
# periph.io/x/host/v3 v3.8.2 => github.com/didiercrunch/host/v3 v3.8.3-0.20240809141600-6580ef45de14
## explicit; go 1.20
periph.io/x/host/v3
periph.io/x/host/v3/allwinner
+4
View File
@@ -1,3 +1,7 @@
// Copyright 2024 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package allwinner
import (
+3 -3
View File
@@ -1,14 +1,14 @@
// Copyright 2022 The Periph Authors. All rights reserved.
// Copyright 2024 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// This file contains pin mapping information that is specific to the Allwinner
// H5 model.
// H6 model.
package allwinner
import (
_ "embed"
//_ "embed"
"encoding/json"
"periph.io/x/conn/v3/pin"
"periph.io/x/host/v3/sysfs"
+5
View File
@@ -223,6 +223,7 @@ func (p *Pin) Read() gpio.Level {
// WaitForEdge implements gpio.PinIn.
func (p *Pin) WaitForEdge(timeout time.Duration) bool {
// Run lockless, as the normal use is to call in a busy loop.
fmt.Println("Waiting for hedge")
var ms int
if timeout == -1 {
ms = -1
@@ -232,10 +233,13 @@ func (p *Pin) WaitForEdge(timeout time.Duration) bool {
start := time.Now()
for {
if nr, err := p.event.Wait(ms); err != nil {
fmt.Printf("Received an error %s\n", err)
return false
} else if nr == 1 {
// TODO(maruel): According to pigpio, the correct way to consume the
// interrupt is to call Seek().
fmt.Printf("Received a value %d\n", nr)
return true
}
// A signal occurred.
@@ -243,6 +247,7 @@ func (p *Pin) WaitForEdge(timeout time.Duration) bool {
ms = int((timeout - time.Since(start)) / time.Millisecond)
}
if ms <= 0 {
fmt.Println("Timed out! return false")
return false
}
}