*(FlashStart + 0x5555) = 0xAA;
*(FlashStart + 0x2AAA) = 0x55;
*(FlashStart + 0x5555) = 0x80;
*(FlashStart + 0x5555) = 0xAA;
*(FlashStart + 0x2AAA) = 0x55;
*(FlashStart + SectorSize * SectorNum) = 0x30;
i = 0;
timeOut = 0;
while(i<5)
{
Data = *(FlashStart + SectorSize * (SectorNum + 1) -1);
if (Data == 0xFFFF)
{
i++;
}
else
{
i=0;
}
if ( ++TimeOut>0x1000000)
{
return (TimeOutErr);
}
}
for (i=0;i<SectorSize;i++)
{
Data = *(FlashStart + SectorSize * SectorNum +i);
if (Data !=0xFFFF)
{
return (EraseErr);
}
}
这是外部flash扇区擦除函数,求大神给我讲讲具体的意思,谢谢
一周热门 更多>