rework #4
@ -28,7 +28,7 @@ static volatile struct FLASH* regs = (struct FLASH*)FLASH_BASE_ADDRESS;
|
|||||||
void flash_configure(enum FlashPreset preset)
|
void flash_configure(enum FlashPreset preset)
|
||||||
{
|
{
|
||||||
//restore default configuration
|
//restore default configuration
|
||||||
regs->ACR.word &= !0x3f;
|
regs->ACR.word &= ~0x3f;
|
||||||
regs->ACR.word |= 0x30;
|
regs->ACR.word |= 0x30;
|
||||||
|
|
||||||
//apply new configuration
|
//apply new configuration
|
||||||
|
|||||||
@ -94,7 +94,7 @@ static void apply_default_preset(void)
|
|||||||
while (regs->CR.HSIRDY != 0x1);
|
while (regs->CR.HSIRDY != 0x1);
|
||||||
|
|
||||||
//set HSI as main clock source and disable prescalers
|
//set HSI as main clock source and disable prescalers
|
||||||
regs->CFGR.word &= !0x077fff3;
|
regs->CFGR.word &= ~0x077fff3;
|
||||||
|
|
||||||
//disable all options
|
//disable all options
|
||||||
regs->CR.HSITRIM = 0x10;
|
regs->CR.HSITRIM = 0x10;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user