Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e2b48221
Commit
e2b48221
authored
Sep 08, 2016
by
Krzysztof Blazewicz
Browse files
stmhal/hal/rcc: reapply HAL commit
c568a2b4
for f4
parent
4f7c5fa6
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/hal/f4/src/stm32f4xx_hal_rcc.c
View file @
e2b48221
...
...
@@ -893,7 +893,12 @@ __weak uint32_t HAL_RCC_GetSysClockFreq(void)
if
(
__HAL_RCC_GET_PLL_OSCSOURCE
()
!=
RCC_PLLSOURCE_HSI
)
{
/* HSE used as PLL clock source */
pllvco
=
((
HSE_VALUE
/
pllm
)
*
((
RCC
->
PLLCFGR
&
RCC_PLLCFGR_PLLN
)
>>
POSITION_VAL
(
RCC_PLLCFGR_PLLN
)));
//pllvco = ((HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN)));
// dpgeorge: Adjust the way the arithmetic is done so it retains
// precision for the case that pllm doesn't evenly divide HSE_VALUE.
// Must be sure not to overflow, so divide by 4 first. HSE_VALUE
// should be a multiple of 4 (being a multiple of 100 is enough).
pllvco
=
((
HSE_VALUE
/
4
)
*
((
RCC
->
PLLCFGR
&
RCC_PLLCFGR_PLLN
)
>>
POSITION_VAL
(
RCC_PLLCFGR_PLLN
)))
/
pllm
*
4
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment