具体实现的算法程序如下:
Flag=TRUE;
while(TRUE==Flag)
{
Erase_K9F1G08U_Block(K9F1G08U.HighAddress,K9F1G08U.LowAddress); Flag=Check_K9F1G08U_Block(K9F1G08U.HighAddress/64); if(TRUE==Flag)//is invalid block
{
BadBlockTable[K9F1G08U.HighAddress/512]|=
(1<<(K9F1G08U.HighAddress%8));
K9F1G08U.HighAddress+=64;//Point to Next Block
}
else// is valid block ,record to BadBlockTable
{
BadBlockTable[K9F1G08U.HighAddress/512]&=
~(1<<(K9F1G08U.HighAddress%8));
}
}
for(i=0;i<sizeof(BadBlockTable);i++)
Write_RAM(RAM_BANK_0,K9F1G08U_BAD_BLOCK+i,BadBlockTable);
更多内容,我们的网站:www.supermcu.com
文章评论(0条评论)
登录后参与讨论