Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit a851c85

Browse files
committed
sysfs: fix Tx() to always set KeepCS
This was an error to not set it. This was broken by 6c72da6, which was a while ago. :( Fixes #222
1 parent b353903 commit a851c85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

host/sysfs/spi.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ func newSPI(busNumber, chipSelect int) (*SPI, error) {
183183
f: f,
184184
busNumber: busNumber,
185185
chipSelect: chipSelect,
186+
p: [2]spi.Packet{{KeepCS: true}, {KeepCS: true}},
186187
},
187188
}, nil
188189
}
@@ -500,6 +501,9 @@ func spiIOCTx(l int) uint {
500501
}
501502

502503
// spiIOCTransfer is spi_ioc_transfer in linux/spi/spidev.h.
504+
//
505+
// Also documented as struct spi_transfer at
506+
// https://www.kernel.org/doc/html/latest/driver-api/spi.html
503507
type spiIOCTransfer struct {
504508
tx uint64 // Pointer to byte slice
505509
rx uint64 // Pointer to byte slice

0 commit comments

Comments
 (0)