Эх сурвалжийг харах

2022-03-23 / Simon Xue

Action:
1. [Fix] GFD Warming will not enter alarm mode.
2. [Add] EV Board communication fail information code.

Files
As the following commit history files

Image Version: v2.9.2
Simon Xue 3 жил өмнө
parent
commit
9508446632

+ 12 - 5
EVSE/Projects/DD360Tcci/Apps/CSU/main.c

@@ -82,7 +82,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V2.09.00.0000.00"; // Phihong version
-char* DebugVersion = "v2.09.00";      // Software debug version
+char* DebugVersion = "v2.09.02";      // Software debug version
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1717,11 +1717,13 @@ void RecordAlarmCode(uint8_t gunIndex, char *code)
         if (strncmp((char *)pDcChargingInfo->ConnectorAlarmCode, "", 6) == EQUAL) {
             memcpy(pDcChargingInfo->ConnectorAlarmCode, code, 6);
         }
-
+        
         if (pDcChargingInfo->StopChargeFlag == NO)
         {
+            log_info("RecordAlarmCode set Stop Charge Flag");
             pDcChargingInfo->StopChargeFlag = YES;
         }
+        
     }
 }
 
@@ -1961,7 +1963,7 @@ void CheckErrorOccurStatus(uint8_t index)
                     memcpy(pDcChargingInfo->ConnectorAlarmCode, "012205", 6);
                 }
             }
-            //log_info("1 CheckErrorOccurStatus");
+            log_info("1 CheckErrorOccurStatus");
             pDcChargingInfo->StopChargeFlag = YES;
             //------------------------------------------------------------------
         } else {
@@ -1998,7 +2000,7 @@ void CheckErrorOccurStatus(uint8_t index)
                 memcpy(pDcChargingInfo->ConnectorAlarmCode, "012202", 6);
             }
         }
-        //log_info("2 CheckErrorOccurStatus");
+        log_info("2 CheckErrorOccurStatus");
         pDcChargingInfo->StopChargeFlag = YES;
         //----------------------------------------------------------------------
     } else {
@@ -2439,6 +2441,7 @@ void KillAllTask(void)
 void StartSystemTimeoutDet(uint8_t flag)
 {
     if (pSysInfo->SystemTimeoutFlag != flag) {
+        log_info("Set System Timeout Flag %d", flag);
         GetClockTime(&pSysInfo->SystemTimeoutTimer, NULL);
     }
     pSysInfo->SystemTimeoutFlag = flag;
@@ -2457,6 +2460,7 @@ void StartGunInfoTimeoutDet(uint8_t gunIndex, uint8_t flag)
     if (gunIndex < pSysConfig->TotalConnectorCount) {
         if (pDcChargingInfo->TimeoutFlag != flag) {
             gettimeofday(&pDcChargingInfo->TimeoutTimer, NULL);
+            log_info("Set Gun%d Timeout Flag %d", gunIndex, flag);
         }
         pDcChargingInfo->TimeoutFlag = flag;
     }
@@ -2600,8 +2604,11 @@ void CreateTimeoutFork(void)
                 if (GetClockTimeoutValue(pSysInfo->SystemTimeoutTimer) / uSEC_VAL >= AUTHORIZE_STOP_TIMEOUT) {
                     log_info("Timeout_AuthorizingForStop");
                     strcpy((char *)pSysConfig->UserId, "");
+                    pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(pSysInfo->CurGunSelected);
+                    pDcChargingInfo->SystemStatus = S_IDLE;
                     ClearAuthorizedFlag();
                     StopSystemTimeoutDet();
+                    
                     pSysInfo->SystemPage = _PAGE_SELECT_GUN;
                 }
                 break;
@@ -3835,7 +3842,7 @@ static void checkPileEndGfdResult(uint8_t gunIndex, uint8_t gunType, uint8_t sys
             ShmDcCommonData->ConnectErrList[gunIndex].GunBits.CCSGfdWarning = NO;
         } else if (pDcChargingInfo->GroundFaultStatus == GFD_WARNING) {
             // GFD 警告
-            RecordAlarmCode(gunIndex, "012297");
+            //RecordAlarmCode(gunIndex, "012297");
             ShmDcCommonData->ConnectErrList[gunIndex].GunBits.CCSGfdTrip = NO;
             ShmDcCommonData->ConnectErrList[gunIndex].GunBits.CCSGfdWarning = YES;
         }

+ 2 - 0
EVSE/Projects/DD360Tcci/Apps/Config.h

@@ -505,6 +505,8 @@ typedef struct StDcCommonInfo {
     int is_AutoStart[2];
     time_t RecordEnergyTime[2];
     int is_exit[2];
+    time_t EVDisconnectTime[2];
+    int EVDisconnectFlag[2];
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 1 - 0
EVSE/Projects/DD360Tcci/Apps/ModuleDoComm/DoComm.c

@@ -2052,6 +2052,7 @@ static void checkAuthorProcess(int fd, uint8_t plugNum)
                 memset(ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status,
                        0,
                        sizeof(ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status));
+
                 if (ret == 0) {
                     strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Invalid");
                 } else {

+ 61 - 0
EVSE/Projects/DD360Tcci/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -226,6 +226,54 @@ static void AddrAssignment(uint8_t *data)
     //}
 }
 
+void CheckEvConnect(int gunIndex)
+{
+    int isSameType = FALSE;
+    int isDisconnect = FALSE;
+    int gunType = _Type_CCS_2;
+    struct ChargingInfoData* pDcChargingInfo = (struct ChargingInfoData*)GetDcChargingInfoData(gunIndex);
+    struct InfoCodeData* pInfoCode = (struct InfoCodeData*)GetShmInfoCodeData();
+    struct ChargingInfoData* pDcChargingInfo_0 = (struct ChargingInfoData*)GetDcChargingInfoData(0);
+    struct ChargingInfoData* pDcChargingInfo_1 = (struct ChargingInfoData*)GetDcChargingInfoData(1);
+
+    if (pDcChargingInfo_0->Type == pDcChargingInfo_1->Type) {
+        isSameType = TRUE;
+        isDisconnect = ShmDcCommonData->EVDisconnectFlag[0] | ShmDcCommonData->EVDisconnectFlag[1];
+        gunType = pDcChargingInfo_0->Type;
+    } else {
+        isDisconnect = ShmDcCommonData->EVDisconnectFlag[gunIndex];
+        gunType = pDcChargingInfo->Type;
+    }
+
+    //log_info("ShmDcCommonData->EVDisconnectFlag[%d]:%d", gunIndex, ShmDcCommonData->EVDisconnectFlag[gunIndex]);
+    if (isDisconnect) {
+        switch (gunType) {
+        case _Type_Chademo:
+            pInfoCode->InfoEvents.bits.ChademoEvCommFail = YES;
+            break;
+        case _Type_CCS_2:
+            pInfoCode->InfoEvents.bits.CcsEvCommFail = YES;
+            break;
+        case _Type_GB:
+            pInfoCode->InfoEvents.bits.GbEvCommFail = YES;
+            break;
+        }
+
+    } else {
+        switch (gunType) {
+        case _Type_Chademo:
+            pInfoCode->InfoEvents.bits.ChademoEvCommFail = NO;
+            break;
+        case _Type_CCS_2:
+            pInfoCode->InfoEvents.bits.CcsEvCommFail = NO;
+            break;
+        case _Type_GB:
+            pInfoCode->InfoEvents.bits.GbEvCommFail = NO;
+            break;
+        }
+    }
+}
+
 void CANReceiver(int fd)
 {
     pid_t canRecPid;
@@ -274,6 +322,16 @@ void CANReceiver(int fd)
         while (isContinue) {
             memset(&frame, 0, sizeof(struct can_frame));
 
+            for (_index = 0; _index < pSysConfig->TotalConnectorCount; _index++) {
+                // 檢查是否有收到EV小板訊號
+                if ((time((time_t*)NULL) - ShmDcCommonData->EVDisconnectTime[_index]) > 3 && !ShmDcCommonData->EVDisconnectFlag[_index]) {
+                    ShmDcCommonData->EVDisconnectTime[_index] = time((time_t*)NULL);
+                    ShmDcCommonData->EVDisconnectFlag[_index] = TRUE;
+                    log_info("Not Get EV Board %d data in 3 sec.", _index);
+                }
+                CheckEvConnect(_index);
+            }
+
             nbytes = read(fd, &frame, sizeof(struct can_frame));
             if (nbytes <= 0) {
                 usleep(10000);
@@ -325,6 +383,9 @@ void CANReceiver(int fd)
                 usleep(10000);
                 continue;
             }
+            // Reset Connect Timer
+            ShmDcCommonData->EVDisconnectTime[targetGun] = time((time_t*)NULL);
+            ShmDcCommonData->EVDisconnectFlag[targetGun] = FALSE;
 
             pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(targetGun);
             gunTypeIndex = pDcChargingInfo->type_index;

+ 2 - 2
EVSE/Projects/DD360Tcci/Apps/ModuleInternalComm/RelayBoard.c

@@ -462,7 +462,7 @@ void CheckAcInputOvpStatus(uint8_t index)
 //          }
 //      }
 //      else
-        //log_info("CheckAcInputOvpStatus");
+        log_info("CheckAcInputOvpStatus");
         pDcChargingInfo->StopChargeFlag = YES;
     }
 }
@@ -502,7 +502,7 @@ void CheckPhaseLossStatus(uint8_t index)
     if (pAlarmCode->AlarmEvents.bits.SystemL1InputUVP == YES ||
             pAlarmCode->AlarmEvents.bits.SystemL2InputUVP == YES ||
             pAlarmCode->AlarmEvents.bits.SystemL3InputUVP == YES) {
-        //log_info("CheckPhaseLossStatus");
+        log_info("CheckPhaseLossStatus");
         pDcChargingInfo->StopChargeFlag = YES;
     }
 }

+ 1 - 1
EVSE/Projects/DD360Tcci/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -404,7 +404,7 @@ void CheckReturnPress()
         return;
     }*/
 	if ( pSysInfo->SystemPage == _PAGE_EXIT ) {
-        StopSystemTimeoutDet();
+        StopGunInfoTimeoutDet(pSysInfo->CurGunSelected);
 		pDcChargingInfo->SystemStatus = S_IDLE;
 		pSysInfo->SystemPage = _PAGE_IDLE;
 		return;

BIN
EVSE/Projects/DD360Tcci/Apps/UnsafetyOutputTask


BIN
EVSE/Projects/DD360Tcci/Images/ramdisk.gz


BIN
EVSE/Projects/DD360Tcci/output/FactoryConfig


BIN
EVSE/Projects/DD360Tcci/output/Module_ChkSysTask


BIN
EVSE/Projects/DD360Tcci/output/Module_DoComm


BIN
EVSE/Projects/DD360Tcci/output/Module_EvComm


BIN
EVSE/Projects/DD360Tcci/output/Module_EventLogging


BIN
EVSE/Projects/DD360Tcci/output/Module_InternalComm


BIN
EVSE/Projects/DD360Tcci/output/Module_LcmControl


BIN
EVSE/Projects/DD360Tcci/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360Tcci/output/Module_UpdateFW


BIN
EVSE/Projects/DD360Tcci/output/ReadCmdline


BIN
EVSE/Projects/DD360Tcci/output/main