skip FLASH_ function to reduce dependency

This commit is contained in:
hathach
2024-07-10 22:58:00 +07:00
parent c1175b7013
commit e251493a16

View File

@@ -111,9 +111,12 @@ void SystemInit (void)
{ {
// Enable Flash enhance read mode for full 224KB // Enable Flash enhance read mode for full 224KB
#if defined(CH32_FLASH_ENHANCE_READ_MODE) && CH32_FLASH_ENHANCE_READ_MODE == 1 #if defined(CH32_FLASH_ENHANCE_READ_MODE) && CH32_FLASH_ENHANCE_READ_MODE == 1
FLASH_Unlock_Fast(); FLASH->KEYR = 0x45670123; // FLASH_Unlock_Fast();
FLASH->CTLR |= (1 << 24); FLASH->KEYR = 0xCDEF89AB;
FLASH_Lock_Fast();
FLASH->CTLR |= (1 << 24); // Enhanced Read Mode
FLASH->CTLR |= (1 << 15); // FLASH_Lock_Fast();
#endif #endif
RCC->CTLR |= (uint32_t)0x00000001; RCC->CTLR |= (uint32_t)0x00000001;