void Flash_Init(void) { // 调整flash与时钟速率之间的关系 FLASH-》ACR |= FLASH_ACR_LATENCY; } void Flash_Unlock(void) { // FLASH-》CR 的第7位为解锁的标志位或者上锁的操作位 while(FLASH-》CR & FLASH_CR_LOCK) { FLASH-》KEYR = FLASH_FKEY1; FLASH-》KEYR = FLASH_FKEY2; } } void Flash_Lock(void) { FLASH-》CR |= FLASH_CR_LOCK