forked from renet/ENC424J600
spi: add CS delay to accomodate booster
This commit is contained in:
parent
2ca717c94f
commit
61182a8ef0
|
@ -131,13 +131,17 @@ impl <SPI: Transfer<u8>,
|
||||||
match self.spi.transfer(&mut buf) {
|
match self.spi.transfer(&mut buf) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
// Disable chip select
|
// Disable chip select
|
||||||
|
cortex_m::asm::delay(10_u32);
|
||||||
self.nss.set_high();
|
self.nss.set_high();
|
||||||
|
cortex_m::asm::delay(4_u32);
|
||||||
Ok(buf[2])
|
Ok(buf[2])
|
||||||
},
|
},
|
||||||
// TODO: Maybe too naive?
|
// TODO: Maybe too naive?
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
// Disable chip select
|
// Disable chip select
|
||||||
|
cortex_m::asm::delay(10_u32);
|
||||||
self.nss.set_high();
|
self.nss.set_high();
|
||||||
|
cortex_m::asm::delay(4_u32);
|
||||||
Err(SpiPortError::TransferError)
|
Err(SpiPortError::TransferError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue