altos/stm32f1: Allow PA6 to be left alone in the SPI code
authorKeith Packard <keithp@keithp.com>
Thu, 11 Jan 2024 22:12:34 +0000 (15:12 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 1 Feb 2024 01:50:19 +0000 (17:50 -0800)
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 <keithp@keithp.com>
src/stm32f1/ao_spi_stm.c

index 20c189457440204436f25f6ee2e333cca71faa36..2c2fcd3a3b7bac8ff51ba6889a439c2ae8e36f5c 100644 (file)
@@ -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