Skip to content

Commit

Permalink
sysfs: fix Tx() to always set KeepCS
Browse files Browse the repository at this point in the history
This was an error to not set it. This was broken by 6c72da6, which was a while
ago. :(

Fixes google#222
  • Loading branch information
maruel committed Oct 28, 2018
1 parent b353903 commit a851c85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions host/sysfs/spi.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func newSPI(busNumber, chipSelect int) (*SPI, error) {
f: f,
busNumber: busNumber,
chipSelect: chipSelect,
p: [2]spi.Packet{{KeepCS: true}, {KeepCS: true}},
},
}, nil
}
Expand Down Expand Up @@ -500,6 +501,9 @@ func spiIOCTx(l int) uint {
}

// spiIOCTransfer is spi_ioc_transfer in linux/spi/spidev.h.
//
// Also documented as struct spi_transfer at
// https://www.kernel.org/doc/html/latest/driver-api/spi.html
type spiIOCTransfer struct {
tx uint64 // Pointer to byte slice
rx uint64 // Pointer to byte slice
Expand Down

0 comments on commit a851c85

Please sign in to comment.