From a3fd78224f222adc4cec394a2c8f4153d6e8571c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 11 Jan 2024 15:12:34 -0700 Subject: [PATCH] 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 --- src/stm32f1/ao_spi_stm.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.30.2