mirror of
https://github.com/kidoman/embd
synced 2024-12-22 12:50:19 +01:00
spi: refactoring for err handling
This commit is contained in:
parent
c42a345a60
commit
9206358abe
@ -230,8 +230,7 @@ func (b *spiBus) TransferAndReceiveByte(data byte) (byte, error) {
|
||||
|
||||
d := make([]uint8, 1)
|
||||
d[0] = uint8(data)
|
||||
err := b.TransferAndRecieveData(d)
|
||||
if err != nil {
|
||||
if err := b.TransferAndRecieveData(d); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return d[0], nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user