|
@@ -1063,7 +1063,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, "B0.19.00.0000.00");
|
|
|
+ sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.20.00.0000.00");
|
|
|
|
|
|
// Get AC connector type from model name
|
|
|
for(uint8_t idx=0;idx<3;idx++)
|
|
@@ -1763,6 +1763,7 @@ int main(void)
|
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus = 0xff;
|
|
|
ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch = 0xff;
|
|
|
ShmCharger->gun_info[gun_index].mcuResetRequest.isMcuResetRequest = ON;
|
|
|
+ ShmCharger->gun_info[gun_index].isInitialPass = NO;
|
|
|
}
|
|
|
|
|
|
// Main loop
|
|
@@ -1875,23 +1876,29 @@ int main(void)
|
|
|
else
|
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingPower = 0;
|
|
|
|
|
|
- // Alarm event check
|
|
|
- if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0))
|
|
|
+ // The system switch to Booting mode
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == 0XFF)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus != SYS_MODE_ALARM)
|
|
|
- {
|
|
|
- setChargerMode(gun_index, SYS_MODE_ALARM);
|
|
|
- }
|
|
|
+ setChargerMode(gun_index, SYS_MODE_BOOTING);
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ // Check initialization "PASS" or "FAIL"
|
|
|
+ if(ShmCharger->gun_info[gun_index].isInitialPass == YES)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_ALARM)
|
|
|
+ // Alarm event check
|
|
|
+ if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0))
|
|
|
{
|
|
|
-
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus != SYS_MODE_ALARM)
|
|
|
+ {
|
|
|
+ setChargerMode(gun_index, SYS_MODE_ALARM);
|
|
|
+ }
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == 0XFF)
|
|
|
+ else
|
|
|
{
|
|
|
- setChargerMode(gun_index, SYS_MODE_BOOTING);
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_ALARM)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1980,8 +1987,13 @@ int main(void)
|
|
|
DEBUG_INFO("Wifi password: %s\r\n", ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
|
|
|
DEBUG_INFO("==========================================\r\n");
|
|
|
|
|
|
+ // Flag for initialization system success
|
|
|
+ ShmCharger->gun_info[gun_index].isInitialPass = YES;
|
|
|
+
|
|
|
+ // Set max current to rating current
|
|
|
ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ShmCharger->gun_info[gun_index].primaryMcuState.rating_current;
|
|
|
|
|
|
+ // If rotate switch equal zero, the system needs to change Debug mode
|
|
|
if(ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch == 0)
|
|
|
setChargerMode(gun_index, SYS_MODE_DEBUG);
|
|
|
else
|
|
@@ -2473,9 +2485,10 @@ int main(void)
|
|
|
(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) ||
|
|
|
ShmOCPP16Data->MsMsg.bits.ResetReq)
|
|
|
{
|
|
|
- setSpeaker(ON,SPEAKER_SHORT);
|
|
|
+ if(ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest == ON)
|
|
|
+ setSpeaker(ON,SPEAKER_SHORT);
|
|
|
+
|
|
|
setRelay(gun_index, OFF);
|
|
|
- sleep(5);
|
|
|
|
|
|
if(!ShmCharger->gun_info[gun_index].primaryMcuState.relay_state)
|
|
|
{
|