board: move softspi input read before high flank

This commit is contained in:
Astro 2019-09-08 00:44:40 +02:00
parent f7af12adf5
commit baab9b2d3f

View File

@ -54,10 +54,10 @@ impl<SCK: OutputPin, MOSI: OutputPin, MISO: InputPin> SoftSpi<SCK, MOSI, MISO> {
} }
State::Transfer { clock_phase: true, State::Transfer { clock_phase: true,
mask, output, mut input } => { mask, output, mut input } => {
let _ = self.sck.set_high();
if self.miso.is_high().unwrap_or(false) { if self.miso.is_high().unwrap_or(false) {
input |= mask; input |= mask;
} }
let _ = self.sck.set_high();
if mask != 1 { if mask != 1 {
self.state = State::Transfer { self.state = State::Transfer {