Worked around some of the error checking warnings
This commit is contained in:
parent
fedcb6629d
commit
8ff6642aa7
|
@ -8,9 +8,9 @@ where
|
|||
{
|
||||
let mut buffer = [0u8, 0u8];
|
||||
|
||||
nss_pin.set_low();
|
||||
nss_pin.set_low().map_err(|_| "Unable to set pin low")?;
|
||||
let res = spi.transfer(&mut buffer);
|
||||
nss_pin.set_high();
|
||||
nss_pin.set_high().map_err(|_| "Unable to set pin high")?;
|
||||
|
||||
let raw_result = match res {
|
||||
Ok(value) => (value[0] as u16) << 8 | (value[1] as u16),
|
||||
|
|
Loading…
Reference in New Issue