diff --git a/go.mod b/go.mod index 345ad8c..77becf9 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module go-orange go 1.22 -replace periph.io/x/host/v3 v3.8.2 => github.com/didiercrunch/host/v3 v3.8.3-0.20240804013031-ebd0129f1012 +replace periph.io/x/host/v3 v3.8.2 => github.com/didiercrunch/host/v3 v3.8.3-0.20240809141600-6580ef45de14 require ( github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index fe26029..1c25b33 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/didiercrunch/host/v3 v3.8.3-0.20240804013031-ebd0129f1012 h1:+0T8+4VvHmA5ZDVAZMHolXk0jgWBLQl5WufXWyt1Qoc= -github.com/didiercrunch/host/v3 v3.8.3-0.20240804013031-ebd0129f1012/go.mod h1:yFL76AesNHR68PboofSWYaQTKmvPXsQH2Apvp/ls/K4= +github.com/didiercrunch/host/v3 v3.8.3-0.20240809141600-6580ef45de14 h1:N14nlh8xT4J9gy4fwEZCGzn2U63PkRA908DzmK0xsV0= +github.com/didiercrunch/host/v3 v3.8.3-0.20240809141600-6580ef45de14/go.mod h1:yFL76AesNHR68PboofSWYaQTKmvPXsQH2Apvp/ls/K4= github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg= github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/vendor/modules.txt b/vendor/modules.txt index 72e1566..f8a21cf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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 diff --git a/vendor/periph.io/x/host/v3/allwinner/address.go b/vendor/periph.io/x/host/v3/allwinner/address.go index 88db602..3fe6dc7 100644 --- a/vendor/periph.io/x/host/v3/allwinner/address.go +++ b/vendor/periph.io/x/host/v3/allwinner/address.go @@ -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 ( diff --git a/vendor/periph.io/x/host/v3/allwinner/h6.go b/vendor/periph.io/x/host/v3/allwinner/h6.go index 3704841..abe5651 100644 --- a/vendor/periph.io/x/host/v3/allwinner/h6.go +++ b/vendor/periph.io/x/host/v3/allwinner/h6.go @@ -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" diff --git a/vendor/periph.io/x/host/v3/sysfs/gpio.go b/vendor/periph.io/x/host/v3/sysfs/gpio.go index 7e947ad..0999851 100644 --- a/vendor/periph.io/x/host/v3/sysfs/gpio.go +++ b/vendor/periph.io/x/host/v3/sysfs/gpio.go @@ -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 } }