Parcourir la source

2022-01-19 / Eason Yang
Action
1. Improve: setPresentConnectionTimeout() function. When CCS connection was terminated and CP state change to F.

File
1. Module_LcmControl.c
Action 1

FIRMWARE VERSION: B0.61.XX.XXXX.PX
LCM VERSION: V0.27

8009 il y a 3 ans
Parent
commit
b03968157f

+ 16 - 7
EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c

@@ -2146,17 +2146,26 @@ void setPresentConnectionTimeout(uint8_t gun_index)
 	}
 	else
 	{
-		time = ShmCharger->timeoutSpec.Handshake_Timeout;
-		if(time <= 0)
+		if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A))
 		{
-			strcpy((char*)not_counting, "000");
-			string2ByteArray(not_counting, data);
-			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
+			time = ShmCharger->timeoutSpec.Handshake_Timeout;
+			if(time <= 0)
+			{
+				strcpy((char*)not_counting, "000");
+				string2ByteArray(not_counting, data);
+				lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
+			}
+			else
+			{
+				sprintf((char *)conntectionTimeout, "%03d ", time);
+				string2ByteArray(conntectionTimeout, data);
+				lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
+			}
 		}
 		else
 		{
-			sprintf((char *)conntectionTimeout, "%03d ", time);
-			string2ByteArray(conntectionTimeout, data);
+			strcpy((char*)not_counting, "-----");
+			string2ByteArray(not_counting, data);
 			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
 		}
 	}

+ 2 - 2
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -1537,7 +1537,7 @@ unsigned char Config_AC_MaxCurrent_And_CpPwmDuty(unsigned char fd, unsigned char
 	tx[4] = 0x01;
 	tx[5] = 0x00;
 	tx[6] = Set_Buf->max_current;
-	DEBUG_WARN("Config_AC_MaxCurrent_And_CpPwmDuty...%d\n", Set_Buf->max_current);
+	//DEBUG_WARN("Config_AC_MaxCurrent_And_CpPwmDuty...%d\n", Set_Buf->max_current);
 
 	for(int idx=0;idx<(tx[4] | tx[5]<<8);idx++)
 			chksum ^= tx[6+idx];
@@ -2449,7 +2449,7 @@ int main(void)
 					   (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
 					{
 						DEBUG_INFO("===========================================\n");
-						DEBUG_INFO("==== Normal priority polling : Case 3 =====\n");
+						DEBUG_INFO("===== High priority polling : Case 11 =====\n");
 						DEBUG_INFO("===========================================\n");
 						DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
 						if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)