From: Keith Packard Date: Thu, 11 Jan 2024 22:12:34 +0000 (-0700) Subject: altos/stm32f1: Allow PA6 to be left alone in the SPI code X-Git-Tag: 1.9.18~2^2~51 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=a3fd78224f222adc4cec394a2c8f4153d6e8571c altos/stm32f1: Allow PA6 to be left alone in the SPI code This is MISO, which the LCD driver doesn't use. Leave it alone so we can use it for other stuff. Signed-off-by: Keith Packard --- diff --git a/src/stm32f1/ao_spi_stm.c b/src/stm32f1/ao_spi_stm.c index 20c18945..2c2fcd3a 100644 --- a/src/stm32f1/ao_spi_stm.c +++ b/src/stm32f1/ao_spi_stm.c @@ -306,7 +306,9 @@ ao_spi_disable_pin_config(uint8_t spi_pin_config) #if SPI_1_PA5_PA6_PA7 case AO_SPI_1_PA5_PA6_PA7: stm_spi_output_disable(&stm_gpioa, 5, SPI_1_MODE_OUTPUT); +#ifndef SPI_1_PA6_DISABLE stm_spi_input_disable(&stm_gpioa, 6); +#endif stm_spi_output_disable(&stm_gpioa, 7, SPI_1_MODE_OUTPUT); break; #endif @@ -351,7 +353,9 @@ ao_spi_enable_pin_config(uint8_t spi_pin_config) STM_AFIO_MAPR_SPI1_REMAP_PA4_PA5_PA6_PA7, STM_AFIO_MAPR_SPI1_REMAP_MASK); stm_spi_output_enable(&stm_gpioa, 5, SPI_1_MODE_OUTPUT); +#ifndef SPI_1_PA6_DISABLE stm_spi_input_enable(&stm_gpioa, 6); +#endif stm_spi_output_enable(&stm_gpioa, 7, SPI_1_MODE_OUTPUT); break; #endif