From 61182a8ef0a16db7b5854abb9e4791bb3abd500e Mon Sep 17 00:00:00 2001 From: occheung Date: Mon, 18 Jan 2021 14:13:05 +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) } }