|
本帖最后由 浪里白条 于 2014-5-15 19:21 编辑
WriteEEPROM();
ReadEEPROM();
这样可以往EEPROM里写入数据,但是这样,EEPROM死活写不进去数据
ReadEEPROM();
WriteEEPROM();
还有,为什么我每次DEBUG的时候编译器都会把eeprom里的数据擦掉,我该在哪里进行设置?
--------------------------------------------------------------------------------------------------------------------------------
void WriteEEPROM()
{
Error = FLASH1_Write(EEPROM_TDeviceData,&CMGS[8],0x10000000,11);
while (!DataWrittenFlg)
{
FLASH1_Main(EEPROM_TDeviceData);
}
DataWrittenFlg = FALSE;
if (FLASH1_GetOperationStatus(EEPROM_TDeviceData) == LDD_FLASH_FAILED)
;
else
;
}
void ReadEEPROM()
{
Error = FLASH1_Read(EEPROM_TDeviceData,0x10000000,&CMGS[8],11); /* Start reading from the flash memory */
do {
FLASH1_Main(EEPROM_TDeviceData);
OpStatus = FLASH1_GetOperationStatus(EEPROM_TDeviceData);
} while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));
}
------------------------------------------------------------------------------------------- |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|