|
@@ -20,7 +20,7 @@
|
|
|
#define TMR_IDX_HANDSHAKING 0
|
|
|
#define TMR_IDX_AUTH 1
|
|
|
#define TMR_IDX_LOGPPRINTOUT 2
|
|
|
-#define TMR_IDX_3 3
|
|
|
+#define TMR_IDX_PROFILE_PREPARE 3
|
|
|
#define TMR_IDX_4 4
|
|
|
#define TMR_IDX_5 5
|
|
|
#define TMR_IDX_6 6
|
|
@@ -32,6 +32,7 @@
|
|
|
#define TIMEOUT_SPEC_AUTH 15000
|
|
|
#define TIMEOUT_SPEC_HANDSHAKING_LED 185000
|
|
|
#define TIMEOUT_SPEC_LOGPPRINTOUT 30000
|
|
|
+#define TIMEOUT_SPEC_PROFILE_PREPARE 5000
|
|
|
|
|
|
#define MtdBlockSize 0x600000
|
|
|
|
|
@@ -1177,7 +1178,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.31.00.0000.00");
|
|
|
+ sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.32.00.0000.00");
|
|
|
|
|
|
// Get AC connector type from model name
|
|
|
for(uint8_t idx=0;idx<3;idx++)
|
|
@@ -1739,6 +1740,7 @@ int getScheduleStart(int gun_index)
|
|
|
tmScheduleStart.tm_year -= 1900;
|
|
|
tmScheduleStart.tm_mon -= 1;
|
|
|
tbScheduleStart.time = mktime(&tmScheduleStart);
|
|
|
+ tbScheduleStart.millitm = 0;
|
|
|
|
|
|
result = DiffTimebWithNow(tbScheduleStart)/1000;
|
|
|
|
|
@@ -2511,6 +2513,7 @@ int main(void)
|
|
|
ShmCharger->gun_info[gun_index].rfidReq = OFF;
|
|
|
ftime(&startChargingTime[gun_index]);
|
|
|
ftime(&startTime[gun_index][TMR_IDX_LOGPPRINTOUT]);
|
|
|
+ ftime(&startTime[gun_index][TMR_IDX_PROFILE_PREPARE]);
|
|
|
}
|
|
|
|
|
|
if((ShmCharger->gun_info[gun_index].rfidReq == ON) ||
|
|
@@ -2537,6 +2540,20 @@ int main(void)
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf = OFF;
|
|
|
}
|
|
|
|
|
|
+// Charging profile preparation
|
|
|
+ if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_PROFILE_PREPARE]) > TIMEOUT_SPEC_PROFILE_PREPARE)
|
|
|
+ {
|
|
|
+ if(!ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf)
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = ON;
|
|
|
+ ftime(&startTime[gun_index][TMR_IDX_PROFILE_PREPARE]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf = OFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Checking profile id > 0 and current time is between charging profile validFrom & validTo
|
|
|
if((ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId>0) &&
|
|
|
(((strlen((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ValidFrom)>0) && (strlen((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ValidTo)>0)) ? isProfileValid(gun_index) : ON))
|
|
@@ -2651,16 +2668,6 @@ int main(void)
|
|
|
// Debug information
|
|
|
if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_LOGPPRINTOUT]) > TIMEOUT_SPEC_LOGPPRINTOUT)
|
|
|
{
|
|
|
- // Charging profile preparation
|
|
|
- if(!ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf)
|
|
|
- {
|
|
|
- ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = ON;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf = OFF;
|
|
|
- }
|
|
|
-
|
|
|
DEBUG_INFO("=======================================================================\r\n");
|
|
|
DEBUG_INFO("ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent: %d \r\n", ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
|
|
|
DEBUG_INFO("ShmCharger->gun_info[%d].primaryMcuCp_Pwn_Duty.max_current: %d\r\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current);
|