Use default 8 MHz clock, disable PLL

Reducing the frequency to one sixth increases flickering somewhat, but
it's not too bad. More importantly, the current draw (at 5 V) at the
lowest brightness settings (all LEDs white) is reduced from 13 mA to
about 3 mA.
This commit is contained in:
fruchti 2020-07-16 16:17:35 +02:00
parent 8c3bc4222c
commit 19a78f2527
3 changed files with 2 additions and 16 deletions

View file

@ -3,20 +3,6 @@
void SystemInit(void)
{
// Activate HSI and wait for it to be ready
RCC->CR = RCC_CR_HSION;
while(!(RCC->CR & RCC_CR_HSIRDY));
// Set PLL to x12 (-> 48MHz system clock)
RCC->CFGR = RCC_CFGR_PLLMUL_3 | RCC_CFGR_PLLMUL_1;
// Activate PLL and wait
RCC->CR |= RCC_CR_PLLON;
while(!(RCC->CR & RCC_CR_PLLRDY));
// Select PLL as clock source
RCC->CFGR = RCC_CFGR_PLLMUL_3 | RCC_CFGR_PLLMUL_1 | RCC_CFGR_SW_1;
// Disable all interrupts
RCC->CIR = 0x00000000;
}