__no_init uint16 FLASH_CN @0x1040;
void CN_Write(void) { uint16 *pf; pf = (uint16 *)&Flash_CN; WDT_Stop(); __disable_interrupt(); FCTL1 = FWKEY + ERASE; FCTL2= FWKEY | FSSEL_1 | 24; //时钟源选择MCLK,25分频,约320K; FCTL3 = FWKEY; *pf = 0; FCTL1 = FWKEY + WRT; pf[0]= CN; FCTL1 = FWKEY; FCTL3 = FWKEY + LOCK;
WDT_Reset(); __enable_interrupt(); }对FLASH擦写无效,问题出在哪里? |