标题:
关于AN3275的问题
[打印本页]
作者:
xujicai
时间:
2010-9-24 22:15
标题:
关于AN3275的问题
本帖最后由 xujicai 于 2010-9-24 23:27 编辑
下面的这段代码来自AN3275,作者想擦除Paged Memory of the block 0(except the page 0x3F):
------------------------------------------------------------------------------------------------------------------------------
PPAGE=0x3E;
li16PageAddressPointer=0xBFFF;
li16BootAddressPointer = 0xFFFF;
while(PPAGE>li8Page)
{
if(*(uint8 *)(li16BootAddressPointer) != *(uint8 *)(li16PageAddressPointer))
{
/*
* Erase Paged Memory
*/
gi32FlashAddressH = PPAGE;
for(gi32FlashAddressL=0xBF00;gi32FlashAddressL>=0x8000;gi32FlashAddressL-=0x200){
gi16FlashDataCounter = 1;
if (vfnFlash_Cmd(FErase))
{
vfnSCITxMsg(&gi8aFlashErrorMsg[0]);
return;
}
}
PPAGE--;
li16PageAddressPointer = 0xC000;
li16BootAddressPointer = 0x0000;
}
li16BootAddressPointer--;
li16PageAddressPointer--;
if(li16BootAddressPointer<0xF000){PPAGE = 0x36;}
}
------------------------------------------------------------------------------------------
不过我认为下面的这些代码就足可以了:
----------------------------------------------------------------------------------------------------
PPAGE=0x3E;
while(PPAGE>li8Page)
{
gi32FlashAddressH = PPAGE;
for(gi32FlashAddressL=0xBF00;gi32FlashAddressL>=0x8000;gi32FlashAddressL-=0x200){
gi16FlashDataCounter = 1;
if (vfnFlash_Cmd(FErase))
{
vfnSCITxMsg(&gi8aFlashErrorMsg[0]);
return;
}
}
PPAGE--;
}
---------------------------------------------------------------------------------------------------------------
请教一下,作者多出的那些代码有什么用途呢, thanks!
作者:
venus8654
时间:
2010-9-25 13:48
沙发,顶你一个,让人回答吧
Troy Polamalu Jersey
,
Clay Matthews Jersey
,
Ray Rice Jersey
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0