Commit 72c9092e authored by 时昊's avatar 时昊

Merge branch 'zhengping' into 'dev'

🐞 fix:下电充电逻辑整改以及增加逻辑括号修改语法错误

See merge request !10
parents cf82bd79 fce23654
......@@ -92,7 +92,7 @@ uint8_t Get_CAN_Num_MBMS_Soc_1_Grid(void)
{
num++;
}
if(num > 10)
if (num > 10)
{
num = 10;
}
......@@ -107,7 +107,7 @@ uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void)
{
num++;
}
if(num > 10)
if (num > 10)
{
num = 10;
}
......@@ -198,6 +198,8 @@ void Gauge_Power_SOC_CHAGING_Display(void)
}
else
{
SOC1_Count = 0;
SOC2_Count = 0;
SEG_SET_EleDial_1SOC(1, Current_1_Grid);
SEG_SET_EleDial_2SOC(1, Current_2_Grid);
}
......@@ -294,7 +296,7 @@ void Data_CumulativeWorkHours_EEPROM_Write(void)
CumulativeWorkHours_Writeback = CurrentData;
}
else if (CurrentData < CumulativeWorkHours_Writeback)
{
{
CumulativeWorkHours_readDiffer = CumulativeWorkHours_Writeback - CurrentData;
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
u32Data[0] = u32Data_read[0] - CumulativeWorkHours_readDiffer;
......@@ -302,15 +304,18 @@ void Data_CumulativeWorkHours_EEPROM_Write(void)
CumulativeWorkHours_Writeback = CurrentData;
}
}
else if(CumulativeWorkHours_Writeback != 0)
else
{
if (CurrentData < CumulativeWorkHours_Writeback)
if (CumulativeWorkHours_Writeback != 0)
{
CumulativeWorkHours_readDiffer = CumulativeWorkHours_Writeback - CurrentData;
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
u32Data[0] = u32Data_read[0] - CumulativeWorkHours_readDiffer;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4);
CumulativeWorkHours_Writeback = CurrentData;
if (CurrentData < CumulativeWorkHours_Writeback)
{
CumulativeWorkHours_readDiffer = CumulativeWorkHours_Writeback - CurrentData;
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
u32Data[0] = u32Data_read[0] - CumulativeWorkHours_readDiffer;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4);
CumulativeWorkHours_Writeback = CurrentData;
}
}
}
}
......@@ -490,7 +495,7 @@ void Gauge_CAN_setup_Service(void)
if (poweroff_time < 3600)
{
Gauge_Power_SOC_CHAGING_Display();
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电)
if ((MBMS_TOTALSigAcc == 0x0) && (MBMS_TOTALSigCharge == 0x1)) // 下电充电)
{
Charge_OFF_Flag = 1;
}
......@@ -504,7 +509,7 @@ void Gauge_CAN_setup_Service(void)
Charge_OFF_Flag = 2;
SEG_SET_EleDial_1SOC(0, 0);
SEG_SET_EleDial_2SOC(0, 0);
if (MBMS_TOTALSigAcc == 0x1 && MBMS_TOTALSigCharge == 0x1) // 上电充电)
if ((MBMS_TOTALSigAcc == 0x1) && (MBMS_TOTALSigCharge == 0x1)) // 上电充电)
{
Charge_OFF_Flag = 0;
poweroff_time = 0;
......@@ -515,20 +520,17 @@ void Gauge_CAN_setup_Service(void)
case CHRG_PLUGIN:
case CHRGEND:
{
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电)
if ((MBMS_TOTALSigAcc == 0x0) && (MBMS_TOTALSigCharge == 0x1)) // 下电充电)
{
Charge_OFF_Flag = 1;
Gauge_Power_SOC_pull_Display();
SOC1_Count = 0;
SOC2_Count = 0;
}
else
else if ((MBMS_TOTALSigAcc == 0x1) && (MBMS_TOTALSigCharge == 0x1))
{
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
SOC1_Count = 0;
SOC2_Count = 0;
}
Gauge_Power_SOC_pull_Display();
SOC1_Count = 0;
SOC2_Count = 0;
poweroff_time = 0;
}
break;
......
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