|
@@ -972,7 +972,6 @@ int main(void)
|
|
|
ShmDispenser->gun_info.isDoEvReadyOnce = OFF;
|
|
|
ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;
|
|
|
ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
- if(ShmDispenser->isCcsEnable)system("pkill Module_CCS");
|
|
|
}
|
|
|
|
|
|
if(ShmDispenser->gun_info.legacyRequest.isLegacyRequest)
|
|
@@ -1000,16 +999,6 @@ int main(void)
|
|
|
if(isModeChange())
|
|
|
{}
|
|
|
|
|
|
- if(ShmDispenser->isCcsEnable)
|
|
|
- {
|
|
|
- ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_CP_STATE_F;
|
|
|
- ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
- sleep(4);
|
|
|
- ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;
|
|
|
- ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
- system("/root/Module_CCS &");
|
|
|
- }
|
|
|
-
|
|
|
setChargerMode(SYS_MODE_PREPARING);
|
|
|
|
|
|
break;
|
|
@@ -1047,6 +1036,7 @@ int main(void)
|
|
|
ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_5;
|
|
|
ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
ShmDispenser->gun_info.ccsHandshakeState = HANDSHAKE_DUTY_5_CHECK;
|
|
|
+ DEBUG_INFO("ccsHandshakeState = HANDSHAKE_DUTY_5_CHECK\n");
|
|
|
}
|
|
|
break;
|
|
|
case HANDSHAKE_DUTY_5_CHECK:
|
|
@@ -1056,6 +1046,7 @@ int main(void)
|
|
|
refreshStartTimer(&startTime[TMR_IDX_BS_HLC_HANDSHAKE]);
|
|
|
DEBUG_INFO("HLC slac handshake start.\n");
|
|
|
ShmDispenser->gun_info.ccsHandshakeState = HANDSHAKE_CCS;
|
|
|
+ DEBUG_INFO("ccsHandshakeState = HANDSHAKE_CCS\n");
|
|
|
}
|
|
|
break;
|
|
|
case HANDSHAKE_CCS:
|
|
@@ -1065,6 +1056,24 @@ int main(void)
|
|
|
ShmDispenser->gun_info.acCcsInfo.ChargingPermission = OFF;
|
|
|
ShmDispenser->gun_info.acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
|
DEBUG_INFO("HLC %d secs slac handshake timeout.\n", TIMEOUT_SPEC_BS_HLC_HANDSHAKE);
|
|
|
+
|
|
|
+ if(ShmDispenser->isCcsEnable)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("TIMEOUT_SPEC_BS_HLC_HANDSHAKE.\n");
|
|
|
+ ShmDispenser->gun_info.acCcsInfo.ChargingPermission = OFF;
|
|
|
+ ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_CP_STATE_F;
|
|
|
+ ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
+ ShmDispenser->gun_info.ccsHandshakeState = HANDSHAKE_CP_STATE_E;
|
|
|
+ ShmDispenser->gun_info.chargingMode = CHARGING_MODE_BS;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ShmDispenser->gun_info.acCcsInfo.ChargingPermission = OFF;
|
|
|
+ ShmDispenser->gun_info.acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
|
+ DEBUG_INFO("BS/HLC %d secs handshake timeout.\n", TIMEOUT_SPEC_BS_HLC_HANDSHAKE);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if((ShmDispenser->gun_info.acCcsInfo.ChargingPermission == OFF) && (ShmDispenser->gun_info.acCcsInfo.CpSetPWMDuty != CCS_PWM_DUTY_5))
|
|
@@ -1077,12 +1086,38 @@ int main(void)
|
|
|
}
|
|
|
|
|
|
//CCS status check
|
|
|
- if((16 < ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus) && (ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus < 254))
|
|
|
+ if((16 <= ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus) && (ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus < 253))
|
|
|
{
|
|
|
+ //change PWM duty to BS
|
|
|
+ if((ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty == OFF)&&(ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current!=CCS_PWM_DUTY_5))
|
|
|
+ {
|
|
|
+ ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current =CCS_PWM_DUTY_5;
|
|
|
+ ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
+ DEBUG_INFO("ccsHandshakeState = HANDSHAKE_CCS (set 5% duty)\n");
|
|
|
+ }
|
|
|
+ refreshStartTimer(&startTime[TMR_IDX_HANDSHAKING]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if((37 < ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus) && (ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus < 49))
|
|
|
+ {
|
|
|
+ //chang PWM duty to BS
|
|
|
+ if((ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty == OFF)&&(ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current!=CCS_PWM_DUTY_5))
|
|
|
+ {
|
|
|
+ ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current =CCS_PWM_DUTY_5;
|
|
|
+ ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
+ }
|
|
|
ShmDispenser->gun_info.chargingMode = CHARGING_MODE_HLC;
|
|
|
- DEBUG_INFO("Enter HLC Mode charging.\n");
|
|
|
ShmDispenser->gun_info.ccsHandshakeState = HANDSHAKE_HLC_MODE;
|
|
|
- refreshStartTimer(&startTime[TMR_IDX_HANDSHAKING]);
|
|
|
+ DEBUG_INFO("ccsHandshakeState = HANDSHAKE_HLC_MODE\n");
|
|
|
+ }
|
|
|
+ else if((54 < ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus) && (ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus <= 255))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("ccsHandshakeState = CHARGING_MODE_BS, CCS terminated\n");
|
|
|
+ ShmDispenser->gun_info.acCcsInfo.ChargingPermission = OFF;
|
|
|
+ ShmDispenser->gun_info.primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_CP_STATE_F;
|
|
|
+ ShmDispenser->gun_info.mcuFlag.isSetCpPwmDuty = ON;
|
|
|
+ ShmDispenser->gun_info.ccsHandshakeState = HANDSHAKE_CP_STATE_E;
|
|
|
+ ShmDispenser->gun_info.chargingMode = CHARGING_MODE_BS;
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -1093,7 +1128,7 @@ int main(void)
|
|
|
{
|
|
|
DEBUG_INFO("Change to CP STATE E for 4 secs.\n");
|
|
|
//CP STATE E for 4 secs
|
|
|
- sleep(4);
|
|
|
+ sleep(3);
|
|
|
}
|
|
|
|
|
|
//restore normal CP PWM duty
|
|
@@ -1196,7 +1231,7 @@ int main(void)
|
|
|
|
|
|
break;
|
|
|
case HANDSHAKE_HLC_MODE:
|
|
|
- if(ShmDispenser->gun_info.acCcsInfo.EVChargeProgress == HLC_START_MODE)
|
|
|
+ if(ShmDispenser->gun_info.acCcsInfo.EVChargeProgress == HLC_START_MODE)//powerDelivery
|
|
|
{
|
|
|
ShmDispenser->gun_info.isCCSStartTransation = ON;
|
|
|
}
|
|
@@ -1302,17 +1337,6 @@ int main(void)
|
|
|
(getDiffSecNow(startTime[TMR_IDX_CCS_HEARTBEAT_COUNT_RESET]) > TIMEOUT_SPEC_CCS_HEARTBEAT_COUNT_RESET))
|
|
|
{
|
|
|
refreshStartTimer(&startTime[TMR_IDX_CCS_HEARTBEAT_COUNT_RESET]);
|
|
|
- if(ShmDispenser->gun_info.acCcsInfo.CcsHeartBeat > 0)
|
|
|
- {
|
|
|
- ShmDispenser->gun_info.acCcsInfo.CcsHeartBeat = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DEBUG_INFO("CCS could not get MSG from car.\n");
|
|
|
-
|
|
|
- //setChargerMode(SYS_MODE_TERMINATING);
|
|
|
- //setRelay(OFF);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
if(!ShmDispenser->gun_info.legacyRequest.isLegacyRequest ||
|
|
@@ -1320,7 +1344,8 @@ int main(void)
|
|
|
((ShmDispenser->gun_info.chargingMode == CHARGING_MODE_SOCKETE) && !ShmDispenser->gun_info.primaryMcuState.socket_e.isSocketEPinOn) ||
|
|
|
((ShmDispenser->gun_info.chargingMode == CHARGING_MODE_HLC) && (ShmDispenser->gun_info.acCcsInfo.EVChargeProgress == HLC_STOP_MODE)) ||
|
|
|
((ShmDispenser->gun_info.chargingMode == CHARGING_MODE_HLC) && ShmDispenser->gun_info.acCcsInfo.EVChargeProgress == HLC_RENEGOTIATE_MODE) ||
|
|
|
- ((ShmDispenser->gun_info.chargingMode == CHARGING_MODE_HLC) && ShmDispenser->gun_info.acCcsInfo.EVChargeProgress == HLC_STANDBY_MODE))
|
|
|
+ ((ShmDispenser->gun_info.chargingMode == CHARGING_MODE_HLC) && ShmDispenser->gun_info.acCcsInfo.EVChargeProgress == HLC_STANDBY_MODE) ||
|
|
|
+ ((ShmDispenser->gun_info.chargingMode == CHARGING_MODE_HLC) && ((49 <= ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus) && (ShmDispenser->gun_info.acCcsInfo.PresentMsgFlowStatus <= 255))))
|
|
|
{
|
|
|
setChargerMode(SYS_MODE_TERMINATING);
|
|
|
//setRelay(gun_index, OFF);
|