소스 검색

[Improve][AW-CCS][main.c]
2022-03-17 / Eason Yang
Action
1.Improve : Socket e mode charging logic.

File
1. main.c
Action 1

FIRMWARE VERSION: B0.61.XX.XXXX.PX

8009 3 년 전
부모
커밋
2a4b059d80
1개의 변경된 파일47개의 추가작업 그리고 1개의 파일을 삭제
  1. 47 1
      EVSE/Projects/AW-CCS/Apps/main.c

+ 47 - 1
EVSE/Projects/AW-CCS/Apps/main.c

@@ -6304,6 +6304,13 @@ int main(void)
 								{
 									setRelay(gun_index, OFF);
 								}
+								else if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE)
+								{
+									setRelay(gun_index, OFF);
+								}
+								else
+								{}
+							
 								setChargerMode(gun_index, SYS_MODE_TERMINATING);
 								DEBUG_INFO("Connector-%d charging duration(%d) already over max duration(%d) in second.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration, (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60));
 							}
@@ -6318,6 +6325,13 @@ int main(void)
 								{
 									setRelay(gun_index, OFF);
 								}
+								else if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE)
+								{
+									setRelay(gun_index, OFF);
+								}
+								else
+								{}
+
 								setChargerMode(gun_index, SYS_MODE_TERMINATING);
 								DEBUG_INFO("Connector-%d charging energy(%.2f) already over max energy(%.2f) in KWH.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy, ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy));
 							}
@@ -6336,6 +6350,15 @@ int main(void)
 									if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)
 										setRelay(gun_index, ON);
 								}
+								else if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE)
+								{
+									if(ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn == ON)
+										setRelay(gun_index, ON);
+									else
+										setRelay(gun_index, OFF);
+								}
+								else
+								{}
 							}
 						}
 						else
@@ -6355,6 +6378,13 @@ int main(void)
 									{
 										setRelay(gun_index, OFF);
 									}
+									else if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE)
+									{
+										setRelay(gun_index, OFF);
+									}
+									else
+									{}
+
 									setChargerMode(gun_index, SYS_MODE_TERMINATING);
 									DEBUG_INFO("Connector-%d charging duration(%d) already over off-line max duration(%d) in second.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration, (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60));
 								}
@@ -6369,6 +6399,13 @@ int main(void)
 									{
 										setRelay(gun_index, OFF);
 									}
+									else if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE)
+									{
+										setRelay(gun_index, OFF);
+									}
+									else
+									{}
+
 									setChargerMode(gun_index, SYS_MODE_TERMINATING);
 									DEBUG_INFO("Connector-%d charging energy(%.2f) already over off-line max energy(%.2f) in KWH.\n", gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy, ((float)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy));
 								}
@@ -6387,6 +6424,15 @@ int main(void)
 										if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)
 											setRelay(gun_index, ON);
 									}
+									else if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE)
+									{
+										if(ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn == ON)
+											setRelay(gun_index, ON);
+										else
+											setRelay(gun_index, OFF);
+									}
+									else
+									{}
 								}
 							}
 							else
@@ -6533,7 +6579,7 @@ int main(void)
 						   !(ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy >= ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy))) &&
 						   !(!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy != OFF_POLICY_NOCHARGE) && ((ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration > 0) ? (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration >= (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration*60)) : (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration >= (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration*60)))) &&
 						   !(!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy != OFF_POLICY_NOCHARGE) && ((ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy > 0) ? (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy >= ((float)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy)) : (ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy > 0) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy >= ((float)ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy)))) &&
-						   (((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC) && (ShmCharger->gun_info[gun_index].acCcsInfo.EVChargeProgress == HLC_START_MODE)) || (ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_BS))
+						   (((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC) && (ShmCharger->gun_info[gun_index].acCcsInfo.EVChargeProgress == HLC_START_MODE)) || (ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_BS) || (ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE))
 						  )
 						{
 							sleep(1);