From e43de81bf8c58029521fd8eaeaa9c2b7cd638244 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 15 May 2015 12:00:01 +0200 Subject: ucoo/hal/spi: sample MISO before toggling clock MISO is supposed to have been latched on opposed clock edge, but some devices do it on the same clock edge to increase maximum clock frequency. --- ucoo/hal/spi/spi_soft.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ucoo/hal') diff --git a/ucoo/hal/spi/spi_soft.cc b/ucoo/hal/spi/spi_soft.cc index 3bcc0d5..93409a2 100644 --- a/ucoo/hal/spi/spi_soft.cc +++ b/ucoo/hal/spi/spi_soft.cc @@ -85,9 +85,9 @@ SpiSoftMaster::send_and_recv (char tx) mosi_.set (tx & i); delay_ns (half_period_ns_); // Sample stage. - sck_.toggle (); if (miso_.get ()) rx |= i; + sck_.toggle (); delay_ns (half_period_ns_); // SCK toggle for next setup stage. if (!cpha_) -- cgit v1.2.3