Commit f1180d72 authored by 陈家乐's avatar 陈家乐

🐞 fix:保养问题,小计清零时传入长度为32字节,实际只写入一次16字节,导致下次调用写EE时,跳过前16字节。判断写EE返回值,写入完整数据

parent 012b8d05
......@@ -7,6 +7,8 @@ uint8_t DataTripBuf[Data_MEM_Block_Trip * EM_TRIP_MAX];
Mileage_t g_WriteMileage;
Mileage_t g_ReadMileage;
uint8_t odo_writeState;
uint8_t odoclr_writeState;
uint8_t trip_writeState;
uint8_t odo_readState;
uint32_t Milleage_InitFlag = 0U;
/******************************************************************************
......@@ -203,11 +205,19 @@ uint32_t Data_User_EEPROM_Read(uint16_t u16BlockID, uint32_t u32Data[], uint16_t
break;
case EM_ODO_BLOCK:
eeprom_WriteRecord(EEPROM_BLOCK_01, (uint8_t *)u32Data, u16Len * 4);
odoclr_writeState = eeprom_WriteRecord(EEPROM_BLOCK_01, (uint8_t *)u32Data, u16Len * 4);
while(odoclr_writeState == WRITING)
{
odoclr_writeState = eeprom_WriteRecord(EEPROM_BLOCK_01, (uint8_t *)u32Data, u16Len * 4);
}
break;
case EM_TRIP_BLOCK:
eeprom_WriteRecord(EEPROM_BLOCK_03, (uint8_t *)u32Data, u16Len * 4);
trip_writeState = eeprom_WriteRecord(EEPROM_BLOCK_03, (uint8_t *)u32Data, u16Len * 4);
while(trip_writeState == WRITING)
{
trip_writeState = eeprom_WriteRecord(EEPROM_BLOCK_03, (uint8_t *)u32Data, u16Len * 4);
}
break;
// case EM_Maintenance_BLOCK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment