Browse Source

2020-11-06 / Alston Lin

Actions
1. Modify the charging profile logic
2. Add the protect for escape over load
3. detect the relay feedback
4. reduce log
5. modify the upgrade function
6. debug
Files
1. As follow commit history
Alston 4 years ago
parent
commit
9e57af244b

BIN
EVSE/Projects/DS60-120/Apps/FactoryConfig


+ 2 - 2
EVSE/Projects/DS60-120/Apps/FactoryConfig.c

@@ -113,7 +113,7 @@ int main(int argc,char *argv[])
 	}
 	else
 	{
-		strcpy((char *)SysConfig.ModelName, "DSYE601J0EE2PH");
+		strcpy((char *)SysConfig.ModelName, "DSYE301E00D2PH");
 		strcpy((char *)SysConfig.SerialNumber, "NeedSetupSN");
 	}
 
@@ -137,7 +137,7 @@ int main(int argc,char *argv[])
 	SysConfig.isRFID = 1;
 	//********** Charging **********//
 	SysConfig.MaxChargingEnergy = 0;
-	SysConfig.MaxChargingCurrent = 200;		// 最大可輸出電流 (整樁)
+	//SysConfig.MaxChargingCurrent = 200;		// 最大可輸出電流 (整樁)
 	SysConfig.MaxChargingDuration = 0;
 	SysConfig.AcMaxChargingCurrent = 0;
 	SysConfig.PhaseLossPolicy = 0;

BIN
EVSE/Projects/DS60-120/Apps/Module_EvComm


File diff suppressed because it is too large
+ 695 - 676
EVSE/Projects/DS60-120/Apps/Module_EvComm.c


BIN
EVSE/Projects/DS60-120/Apps/Module_EventLogging


BIN
EVSE/Projects/DS60-120/Apps/Module_InternalComm


+ 73 - 127
EVSE/Projects/DS60-120/Apps/Module_InternalComm.c

@@ -140,6 +140,7 @@ struct timeb 	_ac_endChargingTime;
 unsigned short _setFanSpeed = 0;
 float _beforeChargingTotalEnergy = 0.0;
 byte _checkLedChanged = 3;
+byte relayMatchFlag = 0;
 
 Ver ver;
 PresentInputVoltage inputVoltage;
@@ -316,7 +317,6 @@ void GetFwAndHwVersion_Led()
 		strcpy((char *) ShmLedModuleData->version, ver.Version_FW);
 		// SystemInfo
 		strcpy((char *) ShmSysConfigAndInfo->SysInfo.LedModuleFwRev, ver.Version_FW);
-		PRINTF_FUNC("GetFwAndHwVersion_Led s1 = %s \n", ver.Version_FW);
 		ShmLedModuleData->SelfTest_Comp = YES;
 	}
 	else
@@ -391,7 +391,7 @@ void SetModelName_Relay()
 {
 	if (Config_Model_Name(Uart5Fd, Addr.Relay, ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
 	{
-		PRINTF_FUNC("Set Model name (RB) PASS = %s \n", ShmSysConfigAndInfo->SysConfig.ModelName);
+		//PRINTF_FUNC("Set Model name (RB) PASS = %s \n", ShmSysConfigAndInfo->SysConfig.ModelName);
 	}
 }
 
@@ -436,7 +436,7 @@ void SetModelName_Fan()
 {
 	if (Config_Model_Name(Uart5Fd, Addr.Fan, ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
 	{
-		PRINTF_FUNC("Set Model name (FAN) PASS = %s \n", ShmSysConfigAndInfo->SysConfig.ModelName);
+		//PRINTF_FUNC("Set Model name (FAN) PASS = %s \n", ShmSysConfigAndInfo->SysConfig.ModelName);
 	}
 }
 
@@ -785,7 +785,7 @@ void GetRelayOutputStatus()
 {
 	if (Query_Relay_Output(Uart5Fd, Addr.Relay, &regRelay) == PASS)
 	{
-		regRelay.relay_event.bits.AC_Contactor = ShmSysConfigAndInfo->SysInfo.AcContactorStatus;
+		//regRelay.relay_event.bits.AC_Contactor = ShmSysConfigAndInfo->SysInfo.AcContactorStatus;
 	}
 }
 
@@ -1106,7 +1106,8 @@ void SetK1K2RelayStatus(byte index)
 		}
 	}
 	else if ((_chargingData[index]->SystemStatus >= S_TERMINATING &&
-			_chargingData[index]->SystemStatus <= S_COMPLETE))
+			_chargingData[index]->SystemStatus <= S_COMPLETE) ||
+			_chargingData[index]->SystemStatus == S_ALARM)
 	{
 		if ((_chargingData[index]->PresentChargingCurrent * 10) <= SEFETY_SWITCH_RELAY_CUR)
 		{
@@ -1675,21 +1676,21 @@ bool IsNoneMatchRelayStatus()
 		(regRelay.relay_event.bits.Gun1_Parallel_N != outputRelay.relay_event.bits.Gun1_Parallel_N))
 	{
 		if (regRelay.relay_event.bits.AC_Contactor != outputRelay.relay_event.bits.AC_Contactor)
-			PRINTF_FUNC("AC Contact Relay none match. \n");
+			PRINTF_FUNC("AC Contact Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.AC_Contactor);
 		if (regRelay.relay_event.bits.CCS_Precharge != outputRelay.relay_event.bits.CCS_Precharge)
-			PRINTF_FUNC("CCS Precharge Relay none match. \n");
+			PRINTF_FUNC("CCS Precharge Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.CCS_Precharge);
 		if (regRelay.relay_event.bits.Gun1_P != outputRelay.relay_event.bits.Gun1_P)
-			PRINTF_FUNC("SMR1:D+ Relay none match. \n");
+			PRINTF_FUNC("SMR1:D+ Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.Gun1_P);
 		if (regRelay.relay_event.bits.Gun1_N != outputRelay.relay_event.bits.Gun1_N)
-			PRINTF_FUNC("SMR1:D- Relay none match. \n");
+			PRINTF_FUNC("SMR1:D- Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.Gun1_N);
 		if (regRelay.relay_event.bits.Gun2_P != outputRelay.relay_event.bits.Gun2_P)
-			PRINTF_FUNC("SMR2:D+ Relay none match. \n");
+			PRINTF_FUNC("SMR2:D+ Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.Gun2_P);
 		if (regRelay.relay_event.bits.Gun2_N != outputRelay.relay_event.bits.Gun2_N)
-			PRINTF_FUNC("SMR2:D- Relay none match. \n");
+			PRINTF_FUNC("SMR2:D- Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.Gun2_N);
 		if (regRelay.relay_event.bits.Gun1_Parallel_P != outputRelay.relay_event.bits.Gun1_Parallel_P)
-			PRINTF_FUNC("Parallel:D+ Relay none match. \n");
+			PRINTF_FUNC("Parallel:D+ Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.Gun1_Parallel_P);
 		if (regRelay.relay_event.bits.Gun1_Parallel_N != outputRelay.relay_event.bits.Gun1_Parallel_N)
-			PRINTF_FUNC("Parallel:D- Relay none match. \n");
+			PRINTF_FUNC("Parallel:D- Relay none match, try to switch to %d \n", outputRelay.relay_event.bits.Gun1_Parallel_N);
 
 		result = true;
 	}
@@ -1924,55 +1925,6 @@ void GetPsuTempForFanSpeed()
 
 void GetFanSpeedByFunction()
 {
-//	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
-//			return;
-//
-//		// 風控修改 :
-//		// ******************************************************* //
-//		//
-//		//       當前PSU輸出總 KW       PSU Temp
-//		// 30 x -------------------- x ---------- + 14 x (PSU Temp - 45)
-//		//       當前樁最大功率 KW         45
-//		//
-//		// ******************************************************* //
-//
-//		// 當前樁最大功率 KW : ShmPsuData->SystemAvailablePower
-//		unsigned int _maxPower = ShmPsuData->SystemAvailablePower;
-//		// 當前PSU輸出總 KW & PSU Temp :
-//		unsigned char temp = 0;
-//		float power = 0;
-//
-//		for (byte index = 0; index < ShmPsuData->GroupCount; index++)
-//		{
-//			for (byte count = 0; count < ShmPsuData->PsuGroup[index].GroupPresentPsuQuantity; count++)
-//			{
-//				if (temp < ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp)
-//					temp = ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp;
-//			}
-//			power += (_chargingData[index]->PresentChargingPower * 10);
-//		}
-//
-//		double _pw_rate = 0;
-//		if (_maxPower > 0)
-//			_pw_rate = power / (double)_maxPower;
-//		double _temp_rate = 0;
-//		if (temp > 0)
-//			_temp_rate = (double)temp / 45;
-//		unsigned char _temp_diff = 0;
-//		if (temp > 45)
-//			_temp_diff = temp - 45;
-//
-//		ShmFanModuleData->TestFanSpeed = ((30 * _pw_rate * _temp_rate + 14 * _temp_diff) / 100) * MAX_FAN_SPEED;
-//
-//		if (ShmFanModuleData->TestFanSpeed > MAX_FAN_SPEED)
-//			ShmFanModuleData->TestFanSpeed = MAX_FAN_SPEED;
-//
-//		if (ShmFanModuleData->TestFanSpeed < 0)
-//				ShmFanModuleData->TestFanSpeed = 0;
-
-
-
-
 	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		return;
 
@@ -1998,7 +1950,11 @@ void GetFanSpeedByFunction()
 			if (temp < ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp)
 				temp = ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp;
 		}
-		power += (_chargingData[index]->PresentChargingPower * 10);
+	}
+
+	for (byte gunIndex = 0; gunIndex < gunCount; gunIndex++)
+	{
+		power += (_chargingData[gunIndex]->PresentChargingPower * 10);
 	}
 
 	double _pw_rate = 0;
@@ -2453,7 +2409,7 @@ int main(void)
 	cur_led_color.Connect_2_Green = COLOR_MIN_LV;
 	cur_led_color.Connect_2_Blue = COLOR_MIN_LV;
 
-	//bool printRelayStatus = true;
+	relayMatchFlag = NO;
 	for(;;)
 	{
 		bool isCharging = false;
@@ -2506,7 +2462,7 @@ int main(void)
 
 			// 讀取當前 AC relay 狀態
 			regRelay.relay_event.bits.AC_Contactor = ShmSysConfigAndInfo->SysInfo.AcContactorStatus;
-			//GetRelayOutputStatus();
+			GetRelayOutputStatus();
 
 			for (int i = 0; i < gunCount; i++)
 			{
@@ -2594,74 +2550,64 @@ int main(void)
 			// 搭上/鬆開 Relay
 			if(IsNoneMatchRelayStatus())
 			{
+				relayMatchFlag = NO;
 				if (Config_Relay_Output(Uart5Fd, Addr.Relay, &outputRelay))
 				{
 					//regRelay.relay_event.bits.AC_Contactor = ShmSysConfigAndInfo->SysInfo.AcContactorStatus;
-					regRelay.relay_event.bits.CCS_Precharge = outputRelay.relay_event.bits.CCS_Precharge;
-					regRelay.relay_event.bits.Gun1_P = outputRelay.relay_event.bits.Gun1_P;
-					regRelay.relay_event.bits.Gun1_N = outputRelay.relay_event.bits.Gun1_N;
-					regRelay.relay_event.bits.Gun2_P = outputRelay.relay_event.bits.Gun2_P;
-					regRelay.relay_event.bits.Gun2_N = outputRelay.relay_event.bits.Gun2_N;
-					regRelay.relay_event.bits.Gun1_Parallel_P = outputRelay.relay_event.bits.Gun1_Parallel_P;
-					regRelay.relay_event.bits.Gun1_Parallel_N = outputRelay.relay_event.bits.Gun1_Parallel_N;
-
-					PRINTF_FUNC("Match Relay, AC = %x, g1_p = %x, g1_n = %x, g2_p = %x, g2_n = %x, pre = %x, bri_p = %x, bri_n = %x \n",
-							regRelay.relay_event.bits.AC_Contactor,
-							regRelay.relay_event.bits.Gun1_P,
-							regRelay.relay_event.bits.Gun1_N,
-							regRelay.relay_event.bits.Gun2_P,
-							regRelay.relay_event.bits.Gun2_N,
-							regRelay.relay_event.bits.CCS_Precharge,
-							regRelay.relay_event.bits.Gun1_Parallel_P,
-							regRelay.relay_event.bits.Gun1_Parallel_N);
+//					regRelay.relay_event.bits.CCS_Precharge = outputRelay.relay_event.bits.CCS_Precharge;
+//					regRelay.relay_event.bits.Gun1_P = outputRelay.relay_event.bits.Gun1_P;
+//					regRelay.relay_event.bits.Gun1_N = outputRelay.relay_event.bits.Gun1_N;
+//					regRelay.relay_event.bits.Gun2_P = outputRelay.relay_event.bits.Gun2_P;
+//					regRelay.relay_event.bits.Gun2_N = outputRelay.relay_event.bits.Gun2_N;
+//					regRelay.relay_event.bits.Gun1_Parallel_P = outputRelay.relay_event.bits.Gun1_Parallel_P;
+//					regRelay.relay_event.bits.Gun1_Parallel_N = outputRelay.relay_event.bits.Gun1_Parallel_N;
 				}
 			}
+			else if (relayMatchFlag == NO)
+			{
+				relayMatchFlag = YES;
+				PRINTF_FUNC("======== Relay Status Start========\n");
+				if (regRelay.relay_event.bits.AC_Contactor == YES)
+					PRINTF_FUNC("AC Power : ON \n");
+				else
+					PRINTF_FUNC("AC Power : OFF \n");
 
+				if (regRelay.relay_event.bits.Gun1_P == YES)
+					PRINTF_FUNC("Conn1(+) : ON \n");
+				else
+					PRINTF_FUNC("Conn1(+) : OFF \n");
 
-//			if(IsNoneMatchRelayStatus())
-//			{
-//				if (printRelayStatus)
-//				{
-////					PRINTF_FUNC("Match Relay Target, AC = %x, g1_p = %x, g1_n = %x, g2_p = %x, g2_n = %x, pre = %x, bri_p = %x, bri_n = %x \n",
-////							outputRelay.relay_event.bits.AC_Contactor,
-////							outputRelay.relay_event.bits.Gun1_P,
-////							outputRelay.relay_event.bits.Gun1_N,
-////							outputRelay.relay_event.bits.Gun2_P,
-////							outputRelay.relay_event.bits.Gun2_N,
-////							outputRelay.relay_event.bits.CCS_Precharge,
-////							outputRelay.relay_event.bits.Gun1_Parallel_P,
-////							outputRelay.relay_event.bits.Gun1_Parallel_N);
-//				}
-//				printRelayStatus = false;
-//				if (Config_Relay_Output(Uart5Fd, Addr.Relay, &outputRelay))
-//				{
-//					PRINTF_FUNC("Match Relay Target, AC = %x, g1_p = %x, g1_n = %x, g2_p = %x, g2_n = %x, pre = %x, bri_p = %x, bri_n = %x \n",
-//							outputRelay.relay_event.bits.AC_Contactor,
-//							outputRelay.relay_event.bits.Gun1_P,
-//							outputRelay.relay_event.bits.Gun1_N,
-//							outputRelay.relay_event.bits.Gun2_P,
-//							outputRelay.relay_event.bits.Gun2_N,
-//							outputRelay.relay_event.bits.CCS_Precharge,
-//							outputRelay.relay_event.bits.Gun1_Parallel_P,
-//							outputRelay.relay_event.bits.Gun1_Parallel_N);
-//				}
-//			}
-//			else
-//			{
-//				if (!printRelayStatus)
-//				{
-//					PRINTF_FUNC("Match Relay, AC = %x, g1_p = %x, g1_n = %x, g2_p = %x, g2_n = %x, pre = %x, bri_p = %x, bri_n = %x \n",
-//							regRelay.relay_event.bits.AC_Contactor,
-//							regRelay.relay_event.bits.Gun1_P,
-//							regRelay.relay_event.bits.Gun1_N,
-//							regRelay.relay_event.bits.Gun2_P,
-//							regRelay.relay_event.bits.Gun2_N,
-//							regRelay.relay_event.bits.CCS_Precharge,
-//							regRelay.relay_event.bits.Gun1_Parallel_P,
-//							regRelay.relay_event.bits.Gun1_Parallel_N);
-//				}
-//				printRelayStatus = true;
-//			}
+				if (regRelay.relay_event.bits.Gun1_N == YES)
+					PRINTF_FUNC("Conn1(-) : ON \n");
+				else
+					PRINTF_FUNC("Conn1(-) : OFF \n");
+
+				if (regRelay.relay_event.bits.Gun2_P == YES)
+					PRINTF_FUNC("Conn2(+) : ON \n");
+				else
+					PRINTF_FUNC("Conn2(+) : OFF \n");
+
+				if (regRelay.relay_event.bits.Gun2_N == YES)
+					PRINTF_FUNC("Conn2(-) : ON \n");
+				else
+					PRINTF_FUNC("Conn2(-) : OFF \n");
+
+				if (regRelay.relay_event.bits.CCS_Precharge == YES)
+					PRINTF_FUNC("Precharge : ON \n");
+				else
+					PRINTF_FUNC("Precharge : OFF \n");
+
+				if (regRelay.relay_event.bits.Gun1_Parallel_P == YES)
+					PRINTF_FUNC("Parallel(+) : ON \n");
+				else
+					PRINTF_FUNC("Parallel(+) : OFF \n");
+
+				if (regRelay.relay_event.bits.Gun1_Parallel_N == YES)
+					PRINTF_FUNC("Parallel(-) : ON \n");
+				else
+					PRINTF_FUNC("Parallel(-) : OFF \n");
+				PRINTF_FUNC("======== Relay Status End========\n");
+			}
 		}
 
 		if (ShmFanModuleData->SelfTest_Comp == YES ||
@@ -2670,7 +2616,7 @@ int main(void)
 		{
 			ShmFanModuleData->SelfTest_Comp = YES;
 
-			if (GetTimeoutValue(_priority_time) / 1000 >= 1000)
+			if (GetTimeoutValue(_priority_time) / 1000 >= 1300)
 			{
 				//GetPsuTempForFanSpeed();
 				GetFanSpeedByFunction();

+ 1 - 0
EVSE/Projects/DS60-120/Apps/Module_LcmContro.h

@@ -34,6 +34,7 @@
 #define FAIL				-1
 #define YES					1
 #define NO					0
+#define EQUAL				0
 
 typedef unsigned char 			byte;
 

BIN
EVSE/Projects/DS60-120/Apps/Module_LcmControl


+ 89 - 9
EVSE/Projects/DS60-120/Apps/Module_LcmControl.c

@@ -167,6 +167,15 @@ void ReadMsgFromLcm(byte *msg, byte readLen)
 {
 	read(_port, msg, readLen);
 
+//	5a : CMD_TITLE_1
+//	a5 : CMD_TITLE_2
+//	5
+//	81 : CMD_WRITE
+//	3  : CMD_REGISTER
+//	2  : Data length
+//	0  : High byte
+//	1  : Low byte
+
 	if(*msg == CMD_TITLE_1 && *(msg + 1) == CMD_TITLE_2)
 	{
 		if(*(msg + 3) == CMD_WRITE)
@@ -176,7 +185,10 @@ void ReadMsgFromLcm(byte *msg, byte readLen)
 				case CMD_REGISTER:
 				{
 					// 頁面
-					strcpy((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, moduleName);
+					if(strcmp((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, "") != EQUAL)
+						strcpy((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, moduleName);
+
+					_currentPage = *(msg + 7);
 				}
 				break;
 			}
@@ -253,7 +265,7 @@ void GetCurrentPage()
 	cmd[5] = 0x02;
 
 	WriteCmdToLcm(cmd, ARRAY_SIZE(cmd));
-	usleep(100000);
+	//usleep(10000);
 	ReadMsgFromLcm(msg, ARRAY_SIZE(msg));
 }
 
@@ -401,8 +413,8 @@ void ChangeCurPage()
 	//PRINTF_FUNC("cur = %d, new = %d \n", _currentPage, ShmSysConfigAndInfo->SysInfo.PageIndex);
 	if (_currentPage != ShmSysConfigAndInfo->SysInfo.PageIndex)
 	{
-		_currentPage = ShmSysConfigAndInfo->SysInfo.PageIndex;
-		ChangeToOtherPage(_currentPage);
+		//_currentPage = ShmSysConfigAndInfo->SysInfo.PageIndex;
+		ChangeToOtherPage(ShmSysConfigAndInfo->SysInfo.PageIndex);
 		_everyPageRollChange = 0;
 	}
 }
@@ -588,13 +600,20 @@ void ChangeBattMapAndValue(short page, int soc)
 			else
 				ChangeDisplay2Value(__batt_map, _battery_cap_60);
 		}
-		else if (soc >= 60 && soc < 100)
+		else if (soc >= 60 && soc < 80)
 		{
 			if (_battery_display_ani)
 				ChangeDisplay2Value(__batt_map, _battery_cap_60);
 			else
 				ChangeDisplay2Value(__batt_map, _battery_cap_80);
 		}
+		else if (soc >= 80 && soc < 100)
+		{
+			if (_battery_display_ani)
+				ChangeDisplay2Value(__batt_map, _battery_cap_80);
+			else
+				ChangeDisplay2Value(__batt_map, _battery_cap_100);
+		}
 		else if (soc == 100)
 			ChangeDisplay2Value(__batt_map, _battery_cap_100);
 	}
@@ -1004,6 +1023,15 @@ void InformationShow()
 void ProcessPageInfo()
 {
 	_page_reload = IsPageReloadChk();
+
+	if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE)
+	{
+		ChangeDisplay2Value(__ret_home_btn, _back_home_btn);
+		if (_totalCount >= 2)
+			ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
+		else
+			ChangeDisplay2Value(__sel_gun_btn, _disappear);
+	}
 	switch(_currentPage)
 	{
 		case _LCM_IDLE:
@@ -1047,6 +1075,29 @@ void ProcessPageInfo()
 		case _LCM_WAIT_FOR_PLUG:
 		{
 			FirstPageChanged();
+			if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE)
+			{
+				// 新增隨插即充功能預設在等待插槍頁面在開啟
+				//ChangeDisplay2Value(__ret_home_btn, _disappear);
+				bool isCharging = false;
+				for(byte i = 0; i < _totalCount; i++)
+				{
+					if (_chargingInfoData[i]->SystemStatus == S_IDLE)
+						continue;
+
+					isCharging = true;
+					break;
+				}
+
+				if (isCharging)
+				{
+					ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
+				}
+				else
+				{
+					ChangeDisplay2Value(__sel_gun_btn, _disappear);
+				}
+			}
 		}
 			break;
 		case _LCM_PRE_CHARGE:
@@ -1145,6 +1196,15 @@ void ProcessPageInfo()
 						ChangeDisplay2Value(__gun_type_index + (gunTargetIndex * 2), _actype_dark);
 				}
 			}
+			else
+			{
+				if (_totalCount > 1)
+				{
+					gunTargetIndex = 2;
+					ChangeDisplay2Value(__cmp_gun_type_index + (gunTargetIndex * 2), _disappear);
+					ChangeDisplay2Value(__gun_type_index + (gunTargetIndex * 2), _disappear);
+				}
+			}
 
 			gunTargetIndex = 0;
 			for(byte i = 0; i < _totalCount; i++)
@@ -1402,6 +1462,17 @@ void Initialization()
 		PRINTF_FUNC("LCM Initialization Gun Fail.............\n");
 }
 
+void DefaultIconStatus()
+{
+	for(byte i = 0; i < 3; i++)
+		ChangeDisplay2Value(__gun_type_index + (i * 2), _disappear);
+
+	if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES || _totalCount == 1)
+		ChangeDisplay2Value(__sel_gun_btn, _disappear);
+	else
+		ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
+}
+
 int main(void)
 {
 	if(InitShareMemory() == FAIL)
@@ -1425,10 +1496,18 @@ int main(void)
 	acgunCount = ShmSysConfigAndInfo->SysConfig.AcConnectorCount;
 	Initialization();
 
-	//ChangeToOtherPage(_LCM_COMPLETE);
-	//return 0;
-	for(byte i = 0; i < 3; i++)
-		ChangeDisplay2Value(__gun_type_index + (i * 2), _disappear);
+//	ChangeToOtherPage(_LCM_IDLE);
+//	ChangeDisplay2Value(__conn_status, _connect);
+//	ChangeDisplay2Value(__ethernet_status, _eth_connect);
+//	ChangeDisplay2Value(__wifi_status, _wifi_connect);
+//	ChangeDisplay2Value(__3G4G_status, _3G4G_connect);
+//
+//	ChangeDisplay2Value(__conn_status, _disconnect);
+//	ChangeDisplay2Value(__ethernet_status, _eth_disconnect);
+//	ChangeDisplay2Value(__wifi_status, _wifi_disconnect);
+//	ChangeDisplay2Value(__3G4G_status, _3G4G_disconnect);
+//	return 0;
+	DefaultIconStatus();
 
 	while(_port != -1)
 	{
@@ -1467,6 +1546,7 @@ int main(void)
 			RefreshConnStatus();
 
 			// 換頁處理
+			GetCurrentPage();
 			ChangeCurPage();
 
 			RefreshPageAnimation(_everyPageRollChange);

BIN
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm


+ 4 - 3
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm.c

@@ -255,13 +255,15 @@ void GetFwAndHwVersion()
 {
 	if(Query_FW_Ver(Uart1Fd, Addr.IoExtend, &ver) == PASS)
 	{
-		PRINTF_FUNC("s1 = %s \n", ver.Version_FW);
+		//PRINTF_FUNC("s1 = %s \n", ver.Version_FW);
 		strcpy((char *)ShmPrimaryMcuData->version, ver.Version_FW);
 		strcpy((char *) ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ver.Version_FW);
 	}
 
 	if (Query_HW_Ver(Uart1Fd, Addr.IoExtend, &ver) == PASS)
-		PRINTF_FUNC("s2 = %s \n", ver.Version_HW);
+	{
+		//PRINTF_FUNC("s2 = %s \n", ver.Version_HW);
+	}
 }
 
 void GetInputGpioStatus()
@@ -429,7 +431,6 @@ int main(void)
 		return 0;
 	}
 	Uart1Fd = InitComPort();
-	PRINTF_FUNC("407 Port id = %d \n", Uart1Fd);
 
 	if(Uart1Fd < 0)
 	{

BIN
EVSE/Projects/DS60-120/Apps/Module_PsuComm


+ 85 - 44
EVSE/Projects/DS60-120/Apps/Module_PsuComm.c

@@ -21,6 +21,8 @@
 #define PRE_CHARG_RANGE		50
 #define EQUAL				0
 #define CMD_DELAY_TIME 		25000
+#define LOG_VOL_GAP			50
+#define LOG_CUR_GAP			5
 
 struct SysConfigAndInfo			*ShmSysConfigAndInfo;
 struct StatusCodeData 			*ShmStatusCodeData;
@@ -31,8 +33,7 @@ byte getAvailableCapOffset = 5;
 byte deratingKeepCount = 0;
 byte psuCmdSeq = _PSU_CMD_CAP;
 
-float evseOutVol = 0;
-float evseOutCur = 0;
+float chargingOutputLogInfo[2][4];
 
 void PRINTF_FUNC(char *string, ...);
 
@@ -338,10 +339,10 @@ void GetStatusCallback(byte group, byte SN, byte temp, int alarm)
 		}
 
 		for(byte psuIndex = 0; psuIndex < conn_1_count; psuIndex++)
-			PRINTF_FUNC("Connector 1 - Number = %d \n", connector_1[psuIndex]);
+			PRINTF_FUNC("Connector 1 - PSU Number = %d \n", connector_1[psuIndex]);
 
 		for(byte psuIndex = 0; psuIndex < conn_2_count; psuIndex++)
-			PRINTF_FUNC("Connector 2 - Number = %d \n", connector_2[psuIndex]);
+			PRINTF_FUNC("Connector 2 - PSU Number = %d \n", connector_2[psuIndex]);
 	}
 }
 // no using -- GetOutputAndTempCallback End
@@ -361,8 +362,18 @@ void GetMaxPowerAndCur(unsigned char mode, int ratingCur, int *pow, int *cur)
 	if (ShmPsuData->Work_Step < GET_SYS_CAP)
 		return;
 
-	unsigned short maxCurrent = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
-	unsigned short maxPower = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
+	//unsigned short maxCurrent = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
+	unsigned short maxCurrent = ShmPsuData->SystemAvailableCurrent;
+	//unsigned short maxPower = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
+	unsigned short maxPower = ShmPsuData->SystemAvailablePower;
+
+	if (ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10 != 0 &&
+			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10 < maxCurrent)
+		maxCurrent = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
+
+	if (ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10 != 0 &&
+			ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10 < maxPower)
+		maxPower = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
 
 	if (mode == _MAIN_CHARGING_MODE_AVER)
 	{
@@ -477,8 +488,11 @@ void GetAvailableCapCallback(byte address, short maxVol, short minVol, short max
 
 	//printf("=============== _current ==================== %d \n", _current);
 	//printf("=============== _ratingcurrent ==================== %d \n", _ratingcurrent);
-	ShmPsuData->SystemAvailableCurrent = _current;
-	ShmPsuData->SystemAvailablePower = _power;
+	if (ShmSysConfigAndInfo->SysInfo.BootingStatus == BOOTTING)
+	{
+		ShmPsuData->SystemAvailableCurrent = _current;
+		ShmPsuData->SystemAvailablePower = _power;
+	}
 
 	if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER ||
 			(ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_GET_NEW_CAP &&
@@ -882,7 +896,8 @@ void GetPresentOutputFCallback(byte group, float outVol, float outCur)
 			}
 
 			if ((chargingInfo[group]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[group]->SystemStatus <= S_COMPLETE) ||
-				(chargingInfo[group]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[group]->SystemStatus <= S_CCS_PRECHARGE_ST1))
+					(chargingInfo[group]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[group]->SystemStatus <= S_CCS_PRECHARGE_ST1) ||
+					chargingInfo[group]->SystemStatus == S_ALARM)
 			{
 				float _vol_buf = outputVol;
 				float _cur_buf = outputCur;
@@ -1135,6 +1150,37 @@ int InitShareMemory()
     return result;
 }
 
+//================================================
+// Log function
+//================================================
+void OutputChargingLogFuncion(byte groupIndex)
+{
+	// 列印時機 : 需求改變或輸出電壓與紀錄落差超過 5V 或者輸出電流與紀錄落差超過 0.5A
+	if (chargingOutputLogInfo[groupIndex][_CHARGING_LOG_NEED_VOL] != chargingInfo[groupIndex]->EvBatterytargetVoltage * 10 ||
+			(chargingInfo[groupIndex]->FireChargingVoltage <= chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_VOL] - LOG_VOL_GAP ||
+					chargingInfo[groupIndex]->FireChargingVoltage >= chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_VOL] + LOG_VOL_GAP))
+	{
+		chargingOutputLogInfo[groupIndex][_CHARGING_LOG_NEED_VOL] = chargingInfo[groupIndex]->EvBatterytargetVoltage * 10;
+		chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_VOL] = chargingInfo[groupIndex]->FireChargingVoltage;
+
+		PRINTF_FUNC("Conn %d, EV Req Voltage : %.1f, EVSE Output Voltage = %.1f \n", groupIndex,
+				chargingOutputLogInfo[groupIndex][_CHARGING_LOG_NEED_VOL] / 10,
+				chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_VOL] / 10);
+	}
+
+	if (chargingOutputLogInfo[groupIndex][_CHARGING_LOG_NEED_CUR] != chargingInfo[groupIndex]->EvBatterytargetCurrent * 10 ||
+			(chargingInfo[groupIndex]->PresentChargingCurrent <= chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_CUR] - LOG_CUR_GAP ||
+					chargingInfo[groupIndex]->PresentChargingCurrent >= chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_CUR] + LOG_CUR_GAP))
+	{
+		chargingOutputLogInfo[groupIndex][_CHARGING_LOG_NEED_CUR] = chargingInfo[groupIndex]->EvBatterytargetCurrent * 10;
+		chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_CUR] = chargingInfo[groupIndex]->PresentChargingCurrent;
+
+		PRINTF_FUNC("Conn %d, EV Req Current : %.1f, EVSE Output Current = %.1f \n", groupIndex,
+				chargingOutputLogInfo[groupIndex][_CHARGING_LOG_NEED_CUR] / 10,
+				chargingOutputLogInfo[groupIndex][_CHARGING_LOG_OUTPUT_CUR]);
+	}
+}
+
 //================================================
 // Main process
 //================================================
@@ -1143,12 +1189,15 @@ void InitialPsuData()
 	ShmPsuData->SystemPresentPsuQuantity = 0;
 	ShmPsuData->SystemAvailablePower = 0;
 
-	PRINTF_FUNC("************ psu Group = %d \n", ShmPsuData->GroupCount);
+	PRINTF_FUNC("InitialPsuData : PSU Group = %d \n", ShmPsuData->GroupCount);
 	for (byte _groupCount = 0; _groupCount < ShmPsuData->GroupCount; _groupCount++)
 	{
 		ShmPsuData->PsuGroup[_groupCount].GroupPresentPsuQuantity = 0;
 		ShmPsuData->PsuGroup[_groupCount].GroupAvailablePower = 0;
 		ShmPsuData->PsuGroup[_groupCount].GroupAvailableCurrent = 0;
+
+		chargingInfo[_groupCount]->PresentChargingVoltage = 0;
+		chargingInfo[_groupCount]->PresentChargingCurrent = 0;
 	}
 }
 
@@ -1174,6 +1223,9 @@ void Initialization()
 		ShmPsuData->GroupCount = 1;
 	else
 		ShmPsuData->GroupCount = _gunCount;
+
+	ShmPsuData->SystemAvailableCurrent = 0;
+	ShmPsuData->SystemAvailablePower = 0;
 }
 
 void CheckSmartChargingStep(bool isWaitingAver, bool isCharging, bool canAverageCharging)
@@ -1188,7 +1240,7 @@ void CheckSmartChargingStep(bool isWaitingAver, bool isCharging, bool canAverage
 
 				if (canAverageCharging)
 				{
-					PRINTF_FUNC("=============Smart Charging : _REASSIGNED_GET_NEW_CAP============= Step 2 \n");
+					PRINTF_FUNC("======= Only to get the charging side capacity (Step 2) ======= \n");
 					ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_GET_NEW_CAP;
 				}
 				else
@@ -1210,20 +1262,20 @@ void CheckSmartChargingStep(bool isWaitingAver, bool isCharging, bool canAverage
 		{
 			if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
 			{
-				PRINTF_FUNC("=============Smart Charging : _REASSIGNED_ADJUST_A_TO_M============= Step 12 \n");
+				PRINTF_FUNC("======= To raise voltage of idle module to charing voltage (Step 12) ======= \n");
 				preChargingCur = preChargingTarget = 0;
 				gettimeofday(&_max_time, NULL);
 				ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_ADJUST_A_TO_M;
 			}
 			else
 			{
-				PRINTF_FUNC("=============Smart Charging_1  : _REASSIGNED_COMP============= Step 15 \n");
+				PRINTF_FUNC("======= The Change to maximum charge mode is complete. (Step 15) ======= \n");
 				ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_COMP;
 			}
 		}
 		else
 		{
-			PRINTF_FUNC("=============Smart Charging_2 : _REASSIGNED_COMP============= Step 15 \n");
+			PRINTF_FUNC("======= The Change to maximum charge mode is complete. (Step 15) ======= \n");
 			ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_COMP;
 		}
 	}
@@ -1336,9 +1388,12 @@ int main(void)
 	Initialization();
 	libInitialize = InitialCommunication();
     byte isInitialComp = NO;
-    PRINTF_FUNC("ALTERNATIVE_CONG = %d \n", ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf);
-	//main loop
+    if (ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == YES)
+    {
+    	PRINTF_FUNC("Alter native mode. \n");
+    }
 
+	//main loop
 	while (libInitialize)
 	{
 		// 斷電狀態
@@ -1401,13 +1456,12 @@ int main(void)
 						// 取各群模組數量
 						GetModuleCount(index);
 					}
-					PRINTF_FUNC("== PSU == indexCount = %d, moduleCount = %d, sysCount = %d\n",
+					PRINTF_FUNC("== PSU == Connector Count = %d, moduleCount = %d, sysCount = %d\n",
 							ShmPsuData->GroupCount, moduleCount, ShmPsuData->SystemPresentPsuQuantity);
 
 					// 判斷系統數量與各群數量一致
 					if(moduleCount == ShmPsuData->SystemPresentPsuQuantity && moduleCount > 0)
 					{
-						PRINTF_FUNC("Psu Count = %d \n", moduleCount);
 						if (ShmSysConfigAndInfo->SysInfo.BootingStatus == BOOTTING)
 						{
 							// 電樁在 Booting 的狀態 - 自檢
@@ -1418,8 +1472,6 @@ int main(void)
 						{
 							PRINTF_FUNC("== PSU == _WORK_CHARGING \n");
 							ShmPsuData->Work_Step = _WORK_CHARGING;
-
-							gettimeofday(&_test_time, NULL);
 						}
 					}
 
@@ -1483,6 +1535,7 @@ int main(void)
 					}
 
 					gettimeofday(&_cmdSubPriority_time, NULL);
+					gettimeofday(&_log_time, NULL);
 				}
 			}
 				break;
@@ -1555,22 +1608,10 @@ int main(void)
 							(chargingInfo[groupIndex]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[groupIndex]->SystemStatus <= S_CHARGING && chargingInfo[groupIndex]->Type == _Type_GB) ||
 							(chargingInfo[groupIndex]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[groupIndex]->SystemStatus <= S_CCS_PRECHARGE_ST1))
 					{
-						if (chargingInfo[groupIndex]->FireChargingVoltage > 0 &&
-								evseOutVol != (chargingInfo[groupIndex]->FireChargingVoltage / 10))
-						{
-							evseOutVol = (chargingInfo[groupIndex]->FireChargingVoltage / 10);
-							PRINTF_FUNC("groupIndex = %d, ev need vol = %f, evse output vol = %f \n", groupIndex,
-								(chargingInfo[groupIndex]->EvBatterytargetVoltage * 10),
-								chargingInfo[groupIndex]->FireChargingVoltage);
-						}
-
-						if ((chargingInfo[groupIndex]->PresentChargingCurrent * 10) > 0 &&
-							evseOutCur != (chargingInfo[groupIndex]->PresentChargingCurrent * 10))
+						if (GetTimeoutValue(_log_time) / 1000 > 1000)
 						{
-							evseOutCur = (chargingInfo[groupIndex]->PresentChargingCurrent * 10);
-							PRINTF_FUNC("groupIndex = %d, ev need cur = %f, evse output cur = %f \n", groupIndex,
-								(chargingInfo[groupIndex]->EvBatterytargetCurrent * 10),
-								(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
+							OutputChargingLogFuncion(groupIndex);
+							gettimeofday(&_log_time, NULL);
 						}
 
 						if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
@@ -1608,7 +1649,7 @@ int main(void)
 									{
 										// 車端降載完成
 										PRINTF_FUNC("Index = %d, newEvCurrent = %f \n", groupIndex, (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
-										PRINTF_FUNC("=============Smart Charging : _REASSIGNED_ADJUST_M_TO_A============= Step 3 \n");
+										PRINTF_FUNC("======= Get the charging current req of EV and shutdown the module of stop side (Step 3) ======= \n");
 										ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_ADJUST_M_TO_A;
 										gettimeofday(&_derating_time, NULL);
 										deratingKeepCount = 0;
@@ -1616,7 +1657,7 @@ int main(void)
 									else
 									{
 										deratingKeepCount++;
-										PRINTF_FUNC("** Step 2 ** : Index = %d, EvBatterytargetCurrent = %f, TargetCurrent = %d, Count = %d \n",
+										PRINTF_FUNC("Max To Ava mode (2) : Index = %d, EvBatterytargetCurrent = %f, TargetCurrent = %d, Count = %d \n",
 											groupIndex,
 											(chargingInfo[groupIndex]->EvBatterytargetCurrent * 10),
 											(ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent + DERATING_GAP),
@@ -1630,7 +1671,7 @@ int main(void)
 
 								if (chargingInfo[groupIndex]->AvailableChargingCurrent <= (chargingInfo[groupIndex]->EvBatterytargetCurrent * 10))
 								{
-									PRINTF_FUNC("** _REASSIGNED_ADJUST_M_TO_A ** Gun_%d, PresentChargingCurrent = %f, AvailableChargingCurrent = %f, EvBatterytargetCurrent = %f \n", groupIndex,
+									PRINTF_FUNC("Max To Ava mode (3-1) : Gun_%d, PresentChargingCurrent = %f, AvailableChargingCurrent = %f, EvBatterytargetCurrent = %f \n", groupIndex,
 										(chargingInfo[groupIndex]->PresentChargingCurrent * 10),
 										chargingInfo[groupIndex]->AvailableChargingCurrent,
 										(chargingInfo[groupIndex]->EvBatterytargetCurrent * 10));
@@ -1662,13 +1703,13 @@ int main(void)
 
 								if (isChanged)
 								{
-									PRINTF_FUNC("** _REASSIGNED_ADJUST_M_TO_A To 4** Gun_%d, PresentChargingCurrent = %f, GroupPresentOutputCurrent = %d \n", groupIndex,
+									PRINTF_FUNC("Max To Ava mode (3-2) : Gun_%d, PresentChargingCurrent = %f, GroupPresentOutputCurrent = %d \n", groupIndex,
 										(chargingInfo[groupIndex]->PresentChargingCurrent * 10),
 										ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent);
 
 									// 輸出端與車端要求電流接近
-									PRINTF_FUNC("=============Smart Charging : _REASSIGNED_RELAY_M_TO_A============= Step 4 \n");
-										ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_RELAY_M_TO_A;
+									PRINTF_FUNC("======= disable the Parallel relay (Step 4) ======= \n");
+									ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_RELAY_M_TO_A;
 								}
 								else
 								{
@@ -1820,7 +1861,7 @@ int main(void)
 										if (((chargingInfo[subIndex]->PresentChargingVoltage * 10) < (chargingInfo[groupIndex]->PresentChargingVoltage * 10) - ZERO_VOLTAGE) ||
 												((chargingInfo[subIndex]->PresentChargingVoltage * 10) < (chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) - CHK_VOL_RANGE))
 										{
-											PRINTF_FUNC("** _REASSIGNED_ADJUST_A_TO_M ** Gun_%d, PresentChargingVoltage = %f, PresentChargingVoltage_V = %f, EvBatterytargetVoltage = %f \n", subIndex,
+											PRINTF_FUNC("Ava To Max mode (12) : Gun_%d, PresentChargingVoltage = %f, PresentChargingVoltage_V = %f, EvBatterytargetVoltage = %f \n", subIndex,
 												(chargingInfo[subIndex]->PresentChargingVoltage * 10),
 												((chargingInfo[groupIndex]->PresentChargingVoltage * 10) - ZERO_VOLTAGE),
 												((chargingInfo[groupIndex]->EvBatterytargetVoltage * 10) - CHK_VOL_RANGE));
@@ -1833,7 +1874,7 @@ int main(void)
 								if (balanceVol)
 								{
 									// 閒置端與車端要求電壓接近
-									PRINTF_FUNC("=============Smart Charging : _REASSIGNED_RELAY_A_TO_M============= Step 13 \n");
+									PRINTF_FUNC("======= Enable the Parallel relay (Step 13) ======= \n");
 									ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_RELAY_A_TO_M;
 								}
 								else
@@ -1861,7 +1902,7 @@ int main(void)
 
 								if (idleCurrent >= chargingCurrent - PRE_CHARG_RANGE)
 								{
-									PRINTF_FUNC("=============Smart Charging_0 : _REASSIGNED_COMP============= Step 15 \n");
+									PRINTF_FUNC("======= The Change to maximum charge mode is complete. (Step 15) ======= \n");
 									ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_COMP;
 								}
 								else

+ 9 - 2
EVSE/Projects/DS60-120/Apps/Module_PsuComm.h

@@ -43,8 +43,7 @@ bool isStartOutputSwitch[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 struct timeval _cmdSubPriority_time;
 struct timeval _derating_time;
 struct timeval _max_time;
-
-struct timeval _test_time;
+struct timeval _log_time;
 
 bool isCharging = false;
 bool isWaitingAver = false;
@@ -71,3 +70,11 @@ enum _PSU_CMD_SEQ
 	_PSU_CMD_IVAILIABLE	= 12,
 	_PSU_CMD_TEMP		= 13
 };
+
+enum _CHARGING_LOG_INDEX
+{
+	_CHARGING_LOG_NEED_VOL = 0,
+	_CHARGING_LOG_NEED_CUR = 1,
+	_CHARGING_LOG_OUTPUT_VOL = 2,
+	_CHARGING_LOG_OUTPUT_CUR = 3
+};

BIN
EVSE/Projects/DS60-120/Apps/ReadCmdline


+ 11 - 2
EVSE/Projects/DS60-120/Apps/ReadCmdline.c

@@ -519,7 +519,12 @@ void GetSystemInfo()
 	printf ("SerialNumber = %s \n", ShmSysConfigAndInfo->SysConfig.SerialNumber);
 	printf ("InternetConn = %d \n", ShmSysConfigAndInfo->SysInfo.InternetConn);
 
-	printf ("MaxChargingPower = %d, MaxChargingCurrent = %d \n",
+	printf ("PSU : MaxChargingPower = %d, MaxChargingCurrent = %d \n",
+			ShmPsuData->SystemAvailablePower / 10,
+			ShmPsuData->SystemAvailableCurrent / 10
+			);
+
+	printf ("Config : ChargingPower = %d, ChargingCurrent = %d \n",
 			ShmSysConfigAndInfo->SysConfig.MaxChargingPower,
 			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
 }
@@ -1282,7 +1287,11 @@ int main(void)
 		}
 		else if (strcmp(newString[0], "test") == 0)
 		{
-
+			if (!FindChargingInfoData(1, &_chargingData[0]))
+			{
+				printf ("FindChargingInfoData error\n");
+				continue;
+			}
 		}
 		else if(strcmp(newString[0], "strchg") == 0)
 		{

BIN
EVSE/Projects/DS60-120/Apps/main


File diff suppressed because it is too large
+ 412 - 227
EVSE/Projects/DS60-120/Apps/main.c


+ 1 - 0
EVSE/Projects/DS60-120/Apps/timeout.h

@@ -59,4 +59,5 @@ unsigned short _connectionTimeout;
 // for main
 struct timeval _cmdMainPriority_time;
 struct timeval _toAverage_time;
+unsigned char _ocppProfileChkFlag;
 #endif /* TIMEOUT_H_ */

BIN
EVSE/Projects/DS60-120/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DS60-120/Images/ramdisk.gz


Some files were not shown because too many files changed in this diff