Commit 2bd3900f authored by 郑萍's avatar 郑萍

🐞 fix:累计时间存储逻辑以及零件版本号修改

parent d2c69af1
......@@ -233,31 +233,19 @@ uint8_t Get_Clockonetime_lenth(void)
}
uint16_t EEPROM_Write_Time = 0;
uint8_t EEPROM_Cumulativee_clean = 0;
void Data_CumulativeWorkHours_EEPROM_Write(void)
{
uint32_t u32Data[1] = {0};
uint32_t eeprom_back[1] = {0};
if (Common_Get_IG_Sts() == COMMON_POWER_ON && Charge_OFF_Flag == 0)
{
u32Data[0] = Get_CAN_Num_MMCU_AccumulatedWorkHours();
if (u32Data[0] > 0XFFFA && EEPROM_Cumulativee_clean == 0)
if (++EEPROM_Write_Time > 6000) // 一分钟存一次
{
EEPROM_Cumulativee_clean = 1;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)eeprom_back, 4);
u32Data[0] = 0;
EEPROM_Write_Time = 0;
}
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)eeprom_back, 4);
if (EEPROM_Write_Time == 0)
{
if (u32Data[0] >= eeprom_back[0])
{
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4);
}
}
if (++EEPROM_Write_Time > 6000) // 一分钟存一次
{
EEPROM_Write_Time = 0;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4);
}
}
else
......@@ -316,7 +304,7 @@ void Clear_Bu98(void)
void Gauge_Service(void)
{
uint8_t i = 0;
if (Common_Get_IG_Sts() == COMMON_POWER_ON )
if (Common_Get_IG_Sts() == COMMON_POWER_ON)
{
if (Get_CAN_Power_State() != PKEY_ON)
{
......
......@@ -27,8 +27,8 @@ extern void UDS_Service_Response(uint8_t si, uint8_t RspType, uint16_t A_TA_type
/*诊断使用, 判断App一致性, 禁止修改(内部版本号除外)*/
extern const ProjectInfoStruct ProjectInfo __attribute__((section(".ARM.__at_0x00007800"))) =
{
"RMR42E", // 豪进232
"RYB-1",
"RMR42E", // 润通RMR42E
"RMR42E-60",
"BAT32A139KK64FB", // 中微芯片
{
"CAN_STD",
......
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