aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32g4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32/stm32g4.c')
-rw-r--r--src/stm32/stm32g4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stm32/stm32g4.c b/src/stm32/stm32g4.c
index 5255cb19..6d6d1c0d 100644
--- a/src/stm32/stm32g4.c
+++ b/src/stm32/stm32g4.c
@@ -12,7 +12,7 @@
#include "internal.h" // enable_pclock
#include "sched.h" // sched_main
-#define FREQ_PERIPH_DIV 1
+#define FREQ_PERIPH_DIV 2
#define FREQ_PERIPH (CONFIG_CLOCK_FREQ / FREQ_PERIPH_DIV)
// Map a peripheral address to its enable bits
@@ -142,7 +142,7 @@ clock_setup(void)
RCC->PLLCFGR |= RCC_PLLCFGR_PLLREN;
// Switch system clock to PLL
- RCC->CFGR = RCC_CFGR_HPRE_DIV1 | RCC_CFGR_PPRE1_DIV1 | RCC_CFGR_PPRE2_DIV1
+ RCC->CFGR = RCC_CFGR_HPRE_DIV1 | RCC_CFGR_PPRE1_DIV2 | RCC_CFGR_PPRE2_DIV2
| RCC_CFGR_SW_PLL;
while ((RCC->CFGR & RCC_CFGR_SWS_Msk) != RCC_CFGR_SWS_PLL)
;