summaryrefslogtreecommitdiff
path: root/rcc/rcc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rcc/rcc.cpp')
-rw-r--r--rcc/rcc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/rcc/rcc.cpp b/rcc/rcc.cpp
index 25ed29c..794b1ee 100644
--- a/rcc/rcc.cpp
+++ b/rcc/rcc.cpp
@@ -23,10 +23,14 @@ void rcc_init() {
// Set APB1 prescaler to /2.
RCC->CFGR |= 0x400;
-
- // Set ADCCLK prescaler to /6.
+
+ // Set ADCCLK prescaler to /6. => 12MHz is ~sufficient
+#if defined(STM32F1)
RCC->CFGR |= 0x8000;
-
+#else
+ RCC->CFGR2 = (0b10011 << 9) | (0b10011 << 4);
+#endif
+
#elif defined(STM32F4)
// Enable HSE.