fix 303, now works with usb

This commit is contained in:
2017-12-17 01:18:05 +01:00
parent f15b907f5d
commit 9e45f4e6ec
3 changed files with 24 additions and 18 deletions
+4 -1
View File
@@ -43,7 +43,10 @@ void DebugUart_PreInit(void)
#elif GEX_PLAT_F103_BLUEPILL
LL_USART_SetBaudRate(USART2, SystemCoreClock/2, 115200); // This is not great, let's hope it's like this on all platforms...
#elif GEX_PLAT_F303_DISCOVERY
LL_USART_SetBaudRate(USART2, SystemCoreClock/2, LL_USART_OVERSAMPLING_16, 115200); // FIXME better way to determine frequency?
LL_USART_SetBaudRate(USART2,
LL_RCC_GetUSARTClockFreq(LL_RCC_USART2_CLKSOURCE),
LL_USART_OVERSAMPLING_16,
115200);
LL_GPIO_SetAFPin_0_7(GPIOA, LL_GPIO_PIN_2, LL_GPIO_AF_7); // uart2 is AF7 here
#else
#error "BAD PLATFORM!"