Ver Fonte

[Improve][AW-Regular][main.c]
2022-09-01 / EASON YANG
Action:
1. Improve: Prevent secondary charging.

File:
1. main.c
Action 1

FIRMWARE VERSION: V0.71.XX.XXXX.PX

8009 há 2 anos atrás
pai
commit
5b79e5fccc
1 ficheiros alterados com 8 adições e 1 exclusões
  1. 8 1
      EVSE/Projects/AW-Regular/Apps/main.c

+ 8 - 1
EVSE/Projects/AW-Regular/Apps/main.c

@@ -4930,7 +4930,7 @@ int main(void)
 					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
 					{
 						ShmCharger->gun_info[gun_index].isGunUnpluggedBefore = YES;
-						DEBUG_INFO("The connector was unplugged under charging mode.\n");
+						DEBUG_INFO("The connector was unplugged under CHARGING.\n");
 					}
 
 					if((ShmCharger->gun_info[gun_index].isGunUnpluggedBefore == YES) ||
@@ -5221,6 +5221,13 @@ int main(void)
 						ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedDuration = DiffTimeb(startChargingTime[gun_index], endChargingTime[gun_index])/1000;
 					//}
 
+					// If unplug the connector during a session, the system must stop charging and stop session.
+					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
+					{
+						ShmCharger->gun_info[gun_index].isGunUnpluggedBefore = YES;
+						DEBUG_INFO("The connector was unplugged under TERMINATING.\n");
+					}
+
 					// End authorize pass
 					if(((ShmCharger->gun_info[gun_index].rfidReq == ON) && isMatchStartUser(gun_index)) ||
 					   (ShmCharger->gun_info[gun_index].isAuthPassEnd) ||