mirror of
https://github.com/kidoman/embd
synced 2024-12-22 21:00:05 +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 := make([]uint8, 1)
|
||||||
d[0] = uint8(data)
|
d[0] = uint8(data)
|
||||||
err := b.TransferAndRecieveData(d)
|
if err := b.TransferAndRecieveData(d); err != nil {
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
return d[0], nil
|
return d[0], nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user