From 500c855d0009c62824cfda55daa7aa6aa9b94f22 Mon Sep 17 00:00:00 2001 From: occheung Date: Mon, 18 Jan 2021 13:59:39 +0800 Subject: [PATCH] spi: add CS delay to accomodate booster --- src/spi.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spi.rs b/src/spi.rs index 58c064b..7628a0a 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -131,13 +131,17 @@ impl , match self.spi.transfer(&mut buf) { Ok(_) => { // Disable chip select + cortex_m::asm::delay(10_u32); self.nss.set_high(); + cortex_m::asm::delay(4_u32); Ok(buf[2]) }, // TODO: Maybe too naive? Err(_) => { // Disable chip select + cortex_m::asm::delay(10_u32); self.nss.set_high(); + cortex_m::asm::delay(4_u32); Err(SpiPortError::TransferError) } }