You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using empty parameter for spi.TX, previous TXD/RXD.MAXCNT values are not reseted and causes weird operations depending what was done before. Fixing is easy and tested to work with nRF52833.
File machine_nrf52xxx.go, line 291 and forward:
if len(r) != 0 {
spi.Bus.RXD.PTR.Set(uint32(uintptr(unsafe.Pointer(&r[0]))))
n := uint32(len(r))
if n > 255 {
n = 255
}
spi.Bus.RXD.MAXCNT.Set(n)
r = r[n:]
}
if len(w) != 0 {
spi.Bus.TXD.PTR.Set(uint32(uintptr(unsafe.Pointer(&w[0]))))
n := uint32(len(w))
if n > 255 {
n = 255
}
spi.Bus.TXD.MAXCNT.Set(n)
w = w[n:]
}
Change to:
if len(r) != 0 {
spi.Bus.RXD.PTR.Set(uint32(uintptr(unsafe.Pointer(&r[0]))))
n := uint32(len(r))
if n > 255 {
n = 255
}
spi.Bus.RXD.MAXCNT.Set(n)
r = r[n:]
} else {
spi.Bus.RXD.MAXCNT.Set(0)
}
if len(w) != 0 {
spi.Bus.TXD.PTR.Set(uint32(uintptr(unsafe.Pointer(&w[0]))))
n := uint32(len(w))
if n > 255 {
n = 255
}
spi.Bus.TXD.MAXCNT.Set(n)
w = w[n:]
} else {
spi.Bus.TXD.MAXCNT.Set(0)
}
The text was updated successfully, but these errors were encountered:
When using empty parameter for spi.TX, previous TXD/RXD.MAXCNT values are not reseted and causes weird operations depending what was done before. Fixing is easy and tested to work with nRF52833.
File machine_nrf52xxx.go, line 291 and forward:
Change to:
The text was updated successfully, but these errors were encountered: