Explorar el Código

2020-06-17 /Edward Lien

Actions:
1.Bugs fixed 180 secs timeout returned to idle when gun was not plugged.

Files:
1. As follow commit history

Image version: D0.20.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Edward Lien hace 4 años
padre
commit
feb49b0c35

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

@@ -1296,7 +1296,7 @@ unsigned char Config_AC_MCU_LEGACY_REQUEST(unsigned char fd, unsigned char targe
 	tx[0] = 0xaa;
 	tx[1] = 0x00;
 	tx[2] = targetAddr;
-	tx[3] = CMD_CONFIG_MCU_MODE;
+	tx[3] = CMD_CONFIG_LEGACY_REQUEST;
 	tx[4] = 0x02;
 	tx[5] = 0x00;
 	tx[6] = Set_Buf->isLegacyRequest;

+ 1 - 1
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.h

@@ -44,7 +44,7 @@ enum MESSAGE_COMMAND
 	CMD_CONFIG_RTC = 0x87,
 	CMD_CONFIG_AC_LED = 0x88,
 	CMD_CONFIG_CURRENT_LINIT = 0x89,
-	CMD_CONFIG_MCU_MODE = 0x8A,
+	CMD_CONFIG_LEGACY_REQUEST = 0x8A,
 	CMD_CONFIG_MCU_RESET_REQUEST = 0x8C,
 	CMD_CONFIG_MCU_SET_BREATHE_LED_TIMING = 0x8D,
 	CMD_CONFIG_MCU_SET_LED_BRIGHTNESS = 0x8E,

+ 23 - 14
EVSE/Projects/AW-CCS/Apps/main.c

@@ -1186,7 +1186,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.19.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "D0.20.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -2642,17 +2642,7 @@ int main(void)
 							case HANDSHAKE_BS_MODE:
 								if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)
 									setRelay(gun_index,ON);
-								if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > ShmCharger->timeoutSpec.Present_Timeout_Spec)
-								{
-									setLedMotion(gun_index, LED_ACTION_HANDSHAKE_FAIL);
-
-									if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > (ShmCharger->timeoutSpec.Present_Timeout_Spec+5000))
-									{
-										DEBUG_INFO("Handshaking timeout...\r\n");
-										setChargerMode(gun_index, SYS_MODE_IDLE);
-									}
-								}
-								else if((ShmCharger->gun_info[gun_index].primaryMcuState.relay_state == ON))
+								if((ShmCharger->gun_info[gun_index].primaryMcuState.relay_state == ON))
 								{
 									ShmCharger->gun_info[ShmOCPP16Data->UnlockConnector[gun_index].ConnectorId-1].isUnlockerConnetor = OFF;
 									ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = 0;
@@ -2741,9 +2731,9 @@ int main(void)
 						ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = 1;	
 						ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;	
 						
-//#ifdef	CCS_SIMULATION_DATA				
+#ifdef	CCS_SIMULATION_DATA				
 						ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty = CCS_PWM_DUTY_100;						
-//#endif	//CCS_SIMULATION_DATA
+#endif	//CCS_SIMULATION_DATA
 					}
 
 					// Use RFID card to stop handshaking
@@ -2767,6 +2757,25 @@ int main(void)
 						ShmCharger->gun_info[gun_index].rfidReq = OFF;
 					}
 					
+					if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > ShmCharger->timeoutSpec.Present_Timeout_Spec)
+					{
+						setLedMotion(gun_index, LED_ACTION_HANDSHAKE_FAIL);
+
+						if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > (ShmCharger->timeoutSpec.Present_Timeout_Spec+5000))
+						{
+							DEBUG_INFO("Handshaking timeout...\r\n");
+							
+							//Cancel CCS task negotiating
+							ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;	
+							ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = 1;	
+							ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;	
+						
+#ifdef	CCS_SIMULATION_DATA				
+							ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty = CCS_PWM_DUTY_100;						
+#endif	//CCS_SIMULATION_DATA
+						}
+					}		
+					
 					if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty != CCS_PWM_DUTY_5)
 					{
 						ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;

BIN
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/AW-CCS/Images/ramdisk.gz


BIN
EVSE/rootfs/root/Module_PhBackend