stm32f3: rcc: consistent masks for pll multiplier

All other masks consistently used a separate mask/shift define, bring the pll
multiplier function in line, and use the same form as other functions.
This commit is contained in:
Karl Palsson
2015-10-22 22:35:48 +00:00
parent 129a874cf8
commit 4d7694b454
2 changed files with 6 additions and 3 deletions

View File

@@ -368,8 +368,11 @@ void rcc_set_hpre(uint32_t hpre)
void rcc_set_pll_multiplier(uint32_t pll)
{
RCC_CFGR = (~RCC_CFGR_PLLMUL_MASK & RCC_CFGR) |
(pll << RCC_CFGR_PLLMUL_SHIFT);
uint32_t reg32;
reg32 = RCC_CFGR;
reg32 &= ~(RCC_CFGR_PLLMUL_MASK << RCC_CFGR_PLLMUL_SHIFT);
RCC_CFGR = (reg32 | (pll << RCC_CFGR_PLLMUL_SHIFT));
}