Skip to content

Commit aab2e11

Browse files
committed
readadc debugging
1 parent 0568ecb commit aab2e11

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

platform/rpiplatform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ func (s *RaspberryPiPlatform) spiExchangeMultiplex(index string, data []byte) []
198198
if err := s.spiConn.Tx(data, read); err != nil {
199199
slog.Error("spi transaction failed", "error", err)
200200
}
201-
slog.Debug("SPI TX:", "Multiplex:", index, "w:", data, "r:", read)
202201
return read
203202
}
204203

@@ -321,5 +320,6 @@ func (s *RaspberryPiPlatform) sensorDriver() {
321320
func (s *RaspberryPiPlatform) readAdc(multiplex string, channel byte) int {
322321
write := []byte{1, (8 + channel) << 4, 0}
323322
read := s.spiExchangeMultiplex(multiplex, write)
323+
slog.Debug("ReadADC:", "MTPLX:", multiplex, "w:", fmt.Sprintf("%x", write), "r:", fmt.Sprintf("%x", read))
324324
return ((int(read[1]) & 3) << 8) + int(read[2])
325325
}

0 commit comments

Comments
 (0)