WriteDataFlash(DATA_FLASH_ADDR_Offset, DataBuffer, 90);
重新写入90个字节后,执行读取数据,还是之前的数据,感觉没有写进去。
部分程序:
if(HIDKey[0] == 1) HIDKey[0] = 0xAA;DataBuffer[0] = 0xAA;
if(HIDKey1[0] == 2) HIDKey1[0] = 0xAA;DataBuffer[9] = 0xAA;
if(HIDKey2[0] == 3) HIDKey2[0] = 0xAA;DataBuffer[18] = 0xAA;
if(HIDKey3[0] == 4) HIDKey3[0] = 0xAA;DataBuffer[27] = 0xAA;
if(HIDKey4[0] == 5) HIDKey4[0] = 0xAA;DataBuffer[36] = 0xAA;
if(HIDKey5[0] == 6) HIDKey5[0] = 0xAA;DataBuffer[45] = 0xAA;
if(HIDKey6[0] == 7) HIDKey6[0] = 0xAA;DataBuffer[54] = 0xAA;
if(HIDKey7[0] == 8) HIDKey7[0] = 0xAA;DataBuffer[63] = 0xAA;
if(HIDKey8[0] == 9) HIDKey8[0] = 0xAA;DataBuffer[72] = 0xAA;
if(HIDKey9[0] == 10) HIDKey9[0] = 0xAA;DataBuffer[81] = 0xAA;
i = 10;
while(i--){
// status = EraseDataFlash(DATA_FLASH_ADDR);
// if(status != 0) continue;
#if DE_PRINTF
printf("write ..\n");
#endif
WriteDataFlash(DATA_FLASH_ADDR_Offset, DataBuffer, 90);
break;