summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/spi_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/spi_dev.c')
-rw-r--r--fw/fe310/eos/spi_dev.c9
1 files changed, 6 insertions, 3 deletions
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();