diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-10-16 14:54:23 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-10-16 14:54:23 -0700 |
| commit | 6c7d35c40cb2b498b34befd4dcfc3d6d0bf3208b (patch) | |
| tree | 0247358c56daf5ecaa0165cb3cfeb8f1e7e0abb0 /esp8266 | |
| parent | ef65ee78c544f0996eeb77ae762d2c4c7ed17057 (diff) | |
esp8266: Correct SPI functionality when write_value is provided.
It used to introduce extra clocks to the bus rather than changing the
value output.
This fixes SD cards.
Diffstat (limited to 'esp8266')
| -rw-r--r-- | esp8266/common-hal/busio/SPI.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/esp8266/common-hal/busio/SPI.c b/esp8266/common-hal/busio/SPI.c index b372d0764..fc8dd348f 100644 --- a/esp8266/common-hal/busio/SPI.c +++ b/esp8266/common-hal/busio/SPI.c @@ -174,13 +174,13 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, write_value; for (size_t j = 0; j < count; ++j) { for (size_t k = 0; k < chunk_size; ++k) { - data[i] = spi_transaction(HSPI, 0, 0, 0, 0, 0, 0, 8, long_write_value); + data[i] = spi_transaction(HSPI, 0, 0, 0, 0, 8, long_write_value, 8, 0); ++i; } ets_loop_iter(); } while (i < len) { - data[i] = spi_transaction(HSPI, 0, 0, 0, 0, 0, 0, 8, long_write_value); + data[i] = spi_transaction(HSPI, 0, 0, 0, 0, 8, long_write_value, 8, 0); ++i; } return true; |
