void TMR1_IRQHandler(void)
{
_TIMER_CLEAR_CMP_INT_FLAG(TIMER1);
dataflash_test();
}
void dataflash_test(void)
{
uint32_t u32data;
uint32_t u32Pattern = 0x5A5A5A5A;
SYS_UnlockReg();
_FMC_ENABLE_ISP();
FMC_Erase(FMC_EEPROM_BASE);
FMC_Write(FMC_EEPROM_BASE,u32Pattern);
u32data = FMC_Read(FMC_EEPROM_BASE);
if(u32data != u32Pattern)
{
LED1 = 0;
}
_FMC_DISABLE_ISP();
SYS_LockReg();
}
500ms一个中断,已经超过1w次了,不知道是不是代码有问题 |