浏览代码

[Added][AW-CCS][main.c]
2022-04-27 / EASON YANG
Action
1. Added: Charging session end if the emergency stop occurs for Bambang customer.

File
1. main.c
Action 1

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

8009 2 年之前
父节点
当前提交
5180338e92
共有 1 个文件被更改,包括 19 次插入2 次删除
  1. 19 2
      EVSE/Projects/AW-CCS/Apps/main.c

+ 19 - 2
EVSE/Projects/AW-CCS/Apps/main.c

@@ -5566,6 +5566,7 @@ int main(void)
 						ShmCharger->gun_info[gun_index].resultAuthorization = DEFAULT_RFID;
 						//if(ShmCharger->isCcsEnable)system("pkill Module_CCS");
 						DB_Check_Record_Buf(localDb, gun_index);
+						ShmCharger->gun_info[gun_index].isEmergencyStopReport = OFF;
 
 						// Default previousData every time
 						previousData[gun_index].primaryMcuCp_Pwn_Duty = 0;
@@ -6663,10 +6664,26 @@ int main(void)
 					else
 					{}
 
+					/*
+					 * 	TODO:
+					 * 	1. Customize emergency stop and report stop transaction then return to idle mode if error recover.
+					 * 	2. Customer: Bambang
+					 */
+					if(((ShmSysConfigAndInfo->SysConfig.ModelName[12] == 'B') && (ShmSysConfigAndInfo->SysConfig.ModelName[13] == 'B')) &&
+					   (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode == ALARM_EMERGENCY_STOP))
+					{
+						if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_TERMINATING)) &&
+							!ShmCharger->gun_info[gun_index].isEmergencyStopReport)
+						{
+							checkStopReason(gun_index);
+							ShmCharger->gun_info[gun_index].isEmergencyStopReport = ON;
+						}
+					}
+
 					if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode == 0) && !ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
 					{
-						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_CHARGING) ||
-						   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_TERMINATING))
+						if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_TERMINATING)) &&
+						   (!ShmCharger->gun_info[gun_index].isEmergencyStopReport))
 						{
 							setChargerMode(gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus);
 						}