aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-12-08 09:00:47 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-12-08 09:00:47 -0500
commit39a04eac5f18a2ae121de14d621a24c6a90d88f7 (patch)
treef76a6e1fa2fe8630c1395380ffbf6dbc17b75ea4 /src
parent6bbfc869a13209612591f9077a32d398bc8981b1 (diff)
downloadkutter-39a04eac5f18a2ae121de14d621a24c6a90d88f7.tar.gz
kutter-39a04eac5f18a2ae121de14d621a24c6a90d88f7.tar.xz
kutter-39a04eac5f18a2ae121de14d621a24c6a90d88f7.zip
stm32: Only use the HSI48 clock when doing "usb clock recovery"
The HSI48 clock on the stm32f042 isn't as accurate as the main HSI clock. So, only use the HSI48 clock when using USB to synchronize that clock. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/stm32/stm32f0.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stm32/stm32f0.c b/src/stm32/stm32f0.c
index a6d5e069..3b4d35d4 100644
--- a/src/stm32/stm32f0.c
+++ b/src/stm32/stm32f0.c
@@ -211,7 +211,8 @@ armcm_main(void)
FLASH->ACR = (1 << FLASH_ACR_LATENCY_Pos) | FLASH_ACR_PRFTBE;
// Configure main clock
- if (CONFIG_MACH_STM32F042 && CONFIG_STM32_CLOCK_REF_INTERNAL)
+ if (CONFIG_MACH_STM32F042 && CONFIG_STM32_CLOCK_REF_INTERNAL
+ && CONFIG_USBSERIAL)
hsi48_setup();
else
pll_setup();