/×因为如果擦除完成读出来就全部都是FF,否则读命令就会被NOR FLASH忽略,读出来的仍然是
擦除命令0x30,两次比对读出来的第三位和第四为是否都为1×/
/* wait until flash is ready */
while(1)
{
unsigned short i;
i = *((
volatile unsigned short* *)addr) & 0x40;
if(i != (*((volatile unsigned short*)addr) & 0x40))
continue;
if((*((
volatile unsigned short**)addr)) & 0x80)
break;
}
printf ("ok.\n");
} else { /* it was protected */
阅读(947) | 评论(0) | 转发(0) |