本帖最后由 yzzly 于 2011-8-23 21:09 编辑
typedef unsigned char Uint08;
typedef unsigned int Uint16;
typedef unsigned long Uint32;
Uint32 TestVar;
Uint08 FlashByteRead(Uint08 *SourceAdr)
{
return(*SourceAdr);
}
Uint16 FlashHarfWordRead(Uint16 *SourceAdr)
{
return(*SourceAdr);
}
Uint32 FlashWordRead(Uint32 *SourceAdr)
{
return(*SourceAdr);// + *(SourceAdr+2));
}
FLASH_ProgramWord(FlashStartAdr+SavePageNum*2048,0x01234567);
TestVar=FlashByteRead((Uint08 *)(FlashStartAdr+SavePageNum*2048)); //TestVar=0x00000067
TestVar=FlashHarfWordRead((Uint16 *)(FlashStartAdr+SavePageNum*2048)); //TestVar=0x01234567,为什么会这样?
TestVar=FlashWordRead((Uint32 *)(FlashStartAdr+SavePageNum*2048)); //TestVar=0x01234567 |