From bbf47bcf1957faaca5803c6b1ec70d4554db23f8 Mon Sep 17 00:00:00 2001 From: Michael Jakob Date: Fri, 23 Dec 2016 09:22:21 +0100 Subject: [PATCH] Fix IO allocation for SPI CS pin on F7 targets --- src/main/drivers/bus_spi_hal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/drivers/bus_spi_hal.c b/src/main/drivers/bus_spi_hal.c index f58c74243..7d86d279a 100644 --- a/src/main/drivers/bus_spi_hal.c +++ b/src/main/drivers/bus_spi_hal.c @@ -155,6 +155,7 @@ void spiInitDevice(SPIDevice device) IOConfigGPIOAF(IOGetByTag(spi->mosi), SPI_IO_AF_CFG, spi->af); if (spi->nss) { + IOInit(IOGetByTag(spi->nss), OWNER_SPI_CS, RESOURCE_INDEX(device)); IOConfigGPIOAF(IOGetByTag(spi->nss), SPI_IO_CS_CFG, spi->af); } #endif @@ -164,6 +165,7 @@ void spiInitDevice(SPIDevice device) IOConfigGPIO(IOGetByTag(spi->mosi), SPI_IO_AF_MOSI_CFG); if (spi->nss) { + IOInit(IOGetByTag(spi->nss), OWNER_SPI_CS, RESOURCE_INDEX(device)); IOConfigGPIO(IOGetByTag(spi->nss), SPI_IO_CS_CFG); } #endif