We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorry for lack of proper fix and pull request, but so I don't forget this:
diff --git a/spi/spi.go b/spi/spi.go index 3eca73e..69d165d 100644 --- a/spi/spi.go +++ b/spi/spi.go @@ -109,10 +109,12 @@ func (d *Device) Sync() error { return d.f.Sync() } +var used *payload + // Do does a duplex transmission to write to the SPI device and read // len(buf) numbers of bytes. func (d *Device) Do(buf []byte, delay time.Duration) error { - p := payload{ + p := &payload{ tx: uint64(uintptr(unsafe.Pointer(&buf[0]))), rx: uint64(uintptr(unsafe.Pointer(&buf[0]))), length: uint32(len(buf)), @@ -120,7 +122,8 @@ func (d *Device) Do(buf []byte, delay time.Duration) error { delay: uint16(delay.Nanoseconds() / 1000), bitsPerWord: d.bitsPerWord, } - return d.ioctl(msgArg(1), uintptr(unsafe.Pointer(&p))) + used = p // force escape + return d.ioctl(msgArg(1), uintptr(unsafe.Pointer(p))) } // Close closes the SPI device and releases related resources.
Totally the wrong way to fix it. I was lazy and impatient.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sorry for lack of proper fix and pull request, but so I don't forget this:
Totally the wrong way to fix it. I was lazy and impatient.
The text was updated successfully, but these errors were encountered: