aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmaple/stm32f2-f4/include/series/stm32.h50
1 files changed, 28 insertions, 22 deletions
diff --git a/libmaple/stm32f2-f4/include/series/stm32.h b/libmaple/stm32f2-f4/include/series/stm32.h
index 180ab30..9549b62 100644
--- a/libmaple/stm32f2-f4/include/series/stm32.h
+++ b/libmaple/stm32f2-f4/include/series/stm32.h
@@ -37,37 +37,43 @@ extern "C" {
#endif
/*
- * Chip configuration
+ * MCU-specific values
*/
-#ifndef STM32_PCLK1
-#define STM32_PCLK1 30000000U
-#endif
-
-#ifndef STM32_PCLK2
-#define STM32_PCLK2 60000000U
-#endif
-
-#ifndef STM32_DELAY_US_MULT
-#define STM32_DELAY_US_MULT 20 /* FIXME: dummy value. */
+#if defined(MCU_STM32F207IC) || defined(MCU_STM32F207IG)
+# define STM32_MCU_SERIES STM32_SERIES_F2
+# define STM32_NR_GPIO_PORTS 9
+# define STM32_TIMER_MASK 0x7FFE /* TIMER1-TIMER14. */
+# define STM32_SRAM_END ((void*)0x20020000)
+#else
+#warning "Unsupported or unspecified STM32F2 MCU."
#endif
/*
- * Series- and MCU-specific values
+ * Series-specific values
*/
-#define STM32_MCU_SERIES STM32_SERIES_F2
-#define STM32_NR_INTERRUPTS 81
-#define STM32_HAVE_FSMC 1
-#define STM32_HAVE_USB 1
-#define STM32_HAVE_DAC 1
+#if STM32_MCU_SERIES == STM32_SERIES_F2
+# define STM32_NR_INTERRUPTS 81
+# define STM32_HAVE_FSMC 1
+# define STM32_HAVE_USB 1
+# define STM32_HAVE_DAC 1
-#if defined(MCU_STM32F207IC) || defined(MCU_STM32F207IG)
-# define STM32_NR_GPIO_PORTS 9
-# define STM32_TIMER_MASK 0x7FFE /* TIMER1-TIMER14. */
-# define STM32_SRAM_END ((void*)0x20020000)
+# ifndef STM32_PCLK1
+# define STM32_PCLK1 30000000U
+# endif
+
+# ifndef STM32_PCLK2
+# define STM32_PCLK2 60000000U
+# endif
+
+# ifndef STM32_DELAY_US_MULT
+# define STM32_DELAY_US_MULT 20 /* FIXME: dummy value. */
+# endif
+#elif STM32_MCU_SERIES == STM32_SERIES_F4
+# error "STM32F4 support is unimplemented"
#else
-#warning "Unsupported or unspecified STM32F2 MCU."
+# error "Invalid STM32 series for this header"
#endif
#ifdef __cplusplus