altos/stmf0: Complain if the SPI configuration isn't complete
[fw/altos] / src / stmf0 / ao_spi_stm.c
index 0448ad8c375407167b1eeff93e04597a6dd07f75..5e76d6c3946c31ff534a6006b76d3987d7908bbf 100644 (file)
@@ -536,12 +536,18 @@ void
 ao_spi_init(void)
 {
 #if HAS_SPI_1
+#ifndef SPI_1_PA5_PA6_PA7
+#error SPI_1_PA5_PA6_PA7 undefined
+#endif
 # if SPI_1_PA5_PA6_PA7
        stm_rcc.ahbenr |= (1 << STM_RCC_AHBENR_IOPAEN);
        stm_ospeedr_set(&stm_gpioa, 5, SPI_1_OSPEEDR);
        stm_ospeedr_set(&stm_gpioa, 6, SPI_1_OSPEEDR);
        stm_ospeedr_set(&stm_gpioa, 7, SPI_1_OSPEEDR);
 # endif
+# ifndef SPI_1_PB3_PB4_PB5
+# error SPI_1_PB3_PB4_PB5 undefined
+# endif
 # if SPI_1_PB3_PB4_PB5
        stm_rcc.ahbenr |= (1 << STM_RCC_AHBENR_IOPBEN);
        stm_ospeedr_set(&stm_gpiob, 3, SPI_1_OSPEEDR);