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) ...@@ -92,7 +92,7 @@ uint8_t Get_CAN_Num_MBMS_Soc_1_Grid(void)
{ {
num++; num++;
} }
if(num > 10) if (num > 10)
{ {
num = 10; num = 10;
} }
...@@ -107,7 +107,7 @@ uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void) ...@@ -107,7 +107,7 @@ uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void)
{ {
num++; num++;
} }
if(num > 10) if (num > 10)
{ {
num = 10; num = 10;
} }
...@@ -198,6 +198,8 @@ void Gauge_Power_SOC_CHAGING_Display(void) ...@@ -198,6 +198,8 @@ void Gauge_Power_SOC_CHAGING_Display(void)
} }
else else
{ {
SOC1_Count = 0;
SOC2_Count = 0;
SEG_SET_EleDial_1SOC(1, Current_1_Grid); SEG_SET_EleDial_1SOC(1, Current_1_Grid);
SEG_SET_EleDial_2SOC(1, Current_2_Grid); SEG_SET_EleDial_2SOC(1, Current_2_Grid);
} }
...@@ -302,7 +304,9 @@ void Data_CumulativeWorkHours_EEPROM_Write(void) ...@@ -302,7 +304,9 @@ void Data_CumulativeWorkHours_EEPROM_Write(void)
CumulativeWorkHours_Writeback = CurrentData; CumulativeWorkHours_Writeback = CurrentData;
} }
} }
else if(CumulativeWorkHours_Writeback != 0) else
{
if (CumulativeWorkHours_Writeback != 0)
{ {
if (CurrentData < CumulativeWorkHours_Writeback) if (CurrentData < CumulativeWorkHours_Writeback)
{ {
...@@ -314,6 +318,7 @@ void Data_CumulativeWorkHours_EEPROM_Write(void) ...@@ -314,6 +318,7 @@ void Data_CumulativeWorkHours_EEPROM_Write(void)
} }
} }
} }
}
} }
void Gauge_Clock_All_Display(void) void Gauge_Clock_All_Display(void)
...@@ -490,7 +495,7 @@ void Gauge_CAN_setup_Service(void) ...@@ -490,7 +495,7 @@ void Gauge_CAN_setup_Service(void)
if (poweroff_time < 3600) if (poweroff_time < 3600)
{ {
Gauge_Power_SOC_CHAGING_Display(); Gauge_Power_SOC_CHAGING_Display();
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电) if ((MBMS_TOTALSigAcc == 0x0) && (MBMS_TOTALSigCharge == 0x1)) // 下电充电)
{ {
Charge_OFF_Flag = 1; Charge_OFF_Flag = 1;
} }
...@@ -504,7 +509,7 @@ void Gauge_CAN_setup_Service(void) ...@@ -504,7 +509,7 @@ void Gauge_CAN_setup_Service(void)
Charge_OFF_Flag = 2; Charge_OFF_Flag = 2;
SEG_SET_EleDial_1SOC(0, 0); SEG_SET_EleDial_1SOC(0, 0);
SEG_SET_EleDial_2SOC(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; Charge_OFF_Flag = 0;
poweroff_time = 0; poweroff_time = 0;
...@@ -515,20 +520,17 @@ void Gauge_CAN_setup_Service(void) ...@@ -515,20 +520,17 @@ void Gauge_CAN_setup_Service(void)
case CHRG_PLUGIN: case CHRG_PLUGIN:
case CHRGEND: case CHRGEND:
{ {
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电) if ((MBMS_TOTALSigAcc == 0x0) && (MBMS_TOTALSigCharge == 0x1)) // 下电充电)
{ {
Charge_OFF_Flag = 1; 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; Charge_OFF_Flag = 0;
}
Gauge_Power_SOC_pull_Display(); Gauge_Power_SOC_pull_Display();
SOC1_Count = 0; SOC1_Count = 0;
SOC2_Count = 0; SOC2_Count = 0;
}
poweroff_time = 0; poweroff_time = 0;
} }
break; 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