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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fw/fe310/eos/spi_dev.c b/fw/fe310/eos/spi_dev.c
index 4daa137..09a4a83 100644
--- a/fw/fe310/eos/spi_dev.c
+++ b/fw/fe310/eos/spi_dev.c
@@ -26,12 +26,13 @@ void eos_spi_dev_init(uint8_t wakeup_cause) {
for (i=0; i<EOS_SPI_MAX_DEV; i++) {
spi_div[i] = spi_cfg[i].div;
- if (spi_cfg[i].csid == SPI_CSID_NONE) {
+ if (spi_cfg[i].cspin != SPI_CSPIN_NONE) {
+ GPIO_REG(GPIO_OUTPUT_VAL) |= (1 << spi_cfg[i].cspin);
+
GPIO_REG(GPIO_INPUT_EN) &= ~(1 << spi_cfg[i].cspin);
GPIO_REG(GPIO_OUTPUT_EN) |= (1 << spi_cfg[i].cspin);
GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << spi_cfg[i].cspin);
GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << spi_cfg[i].cspin);
- GPIO_REG(GPIO_OUTPUT_VAL) |= (1 << spi_cfg[i].cspin);
}
}
}