From 9c8f5a5e8f11e4a5012d55b96afae290242b8fdd Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 7 Dec 2021 20:14:23 +0100 Subject: fixed eve, spi start/stop interface --- fw/fe310/eos/spi_dev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fw/fe310/eos/spi_dev.c') diff --git a/fw/fe310/eos/spi_dev.c b/fw/fe310/eos/spi_dev.c index 54b337a..2d3d8f5 100644 --- a/fw/fe310/eos/spi_dev.c +++ b/fw/fe310/eos/spi_dev.c @@ -40,7 +40,6 @@ int eos_spi_dev_init(uint8_t wakeup_cause) { } int eos_spi_select(unsigned char dev) { - if (dev == EOS_SPI_DEV_NET) return EOS_ERR; if (spi_lock) return EOS_ERR_BUSY; if (spi_dev == EOS_SPI_DEV_NET) { @@ -50,14 +49,18 @@ int eos_spi_select(unsigned char dev) { } spi_dev = dev; - eos_spi_start(spi_div[dev], spi_cfg[dev].csid, spi_cfg[dev].cspin, spi_cfg[dev].evt); + if (dev == EOS_SPI_DEV_NET) { + eos_net_start(); + } else { + eos_spi_start(spi_div[dev], spi_cfg[dev].csid, spi_cfg[dev].cspin, spi_cfg[dev].evt); + } return EOS_OK; } int eos_spi_deselect(void) { - if (spi_dev == EOS_SPI_DEV_NET) return EOS_ERR; if (spi_lock) return EOS_ERR_BUSY; + if (spi_dev == EOS_SPI_DEV_NET) return EOS_ERR; eos_spi_stop(); -- cgit v1.2.3