Преглед изворни кода

2022-01-06 / Simon Xue

Action
1. Add Plugin status in connector status to cabinet.
2. Modify Primary Pause.

Files
1. As follow commit history

Image version : V1.19.XX.XXXX.XX
Simon Xue пре 3 година
родитељ
комит
87550c0fee
32 измењених фајлова са 178 додато и 63 уклоњено
  1. 2 1
      EVSE/Projects/DD360/Apps/CSU/main.c
  2. 1 0
      EVSE/Projects/DD360/Apps/Define/define.h
  3. 11 3
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c
  4. 2 1
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.h
  5. 37 11
      EVSE/Projects/DD360/Apps/ModuleLcmCtrl/Module_LcmControl.c
  6. 6 5
      EVSE/Projects/DD360/Apps/ModulePrimary/Module_PrimaryComm.c
  7. BIN
      EVSE/Projects/DD360/Images/ramdisk.gz
  8. BIN
      EVSE/Projects/DD360/output/FactoryConfig
  9. BIN
      EVSE/Projects/DD360/output/Module_ChkSysTask
  10. BIN
      EVSE/Projects/DD360/output/Module_DoComm
  11. BIN
      EVSE/Projects/DD360/output/Module_EvComm
  12. BIN
      EVSE/Projects/DD360/output/Module_EventLogging
  13. BIN
      EVSE/Projects/DD360/output/Module_InternalComm
  14. BIN
      EVSE/Projects/DD360/output/Module_LcmControl
  15. BIN
      EVSE/Projects/DD360/output/Module_PrimaryComm
  16. BIN
      EVSE/Projects/DD360/output/Module_UpdateFW
  17. BIN
      EVSE/Projects/DD360/output/ReadCmdline
  18. BIN
      EVSE/Projects/DD360/output/main
  19. BIN
      EVSE/Projects/DD360/output/simulation
  20. 2 1
      EVSE/Projects/DD360Audi/Apps/CSU/main.c
  21. 1 0
      EVSE/Projects/DD360Audi/Apps/Define/define.h
  22. 11 3
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c
  23. 2 1
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.h
  24. 37 11
      EVSE/Projects/DD360Audi/Apps/ModuleLcmCtrl/Module_LcmControl.c
  25. 6 5
      EVSE/Projects/DD360Audi/Apps/ModulePrimary/Module_PrimaryComm.c
  26. 2 1
      EVSE/Projects/DD360ComBox/Apps/CSU/main.c
  27. 1 0
      EVSE/Projects/DD360ComBox/Apps/Define/define.h
  28. 11 3
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c
  29. 2 1
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.h
  30. 37 11
      EVSE/Projects/DD360ComBox/Apps/ModuleLcmCtrl/Module_LcmControl.c
  31. 6 5
      EVSE/Projects/DD360ComBox/Apps/ModulePrimary/Module_PrimaryComm.c
  32. 1 0
      EVSE/Projects/define.h

+ 2 - 1
EVSE/Projects/DD360/Apps/CSU/main.c

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.19.2";
+char* DebugVersion = "v1.19.3";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -4797,6 +4797,7 @@ int main(void)
                         pSysInfo->OrderCharging = NO_DEFINE;
                     }
                     StopSystemTimeoutDet();
+                    gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
                 }
 
                 isRessign = NO;

+ 1 - 0
EVSE/Projects/DD360/Apps/Define/define.h

@@ -673,6 +673,7 @@ struct ChargingInfoData
     unsigned char       isEVCCIDVerify;
     unsigned char       CCSGunType;
     struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
 typedef struct

+ 11 - 3
EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c

@@ -854,6 +854,7 @@ static void addFaultCodeToBuf(uint8_t *Code)
                Code,
                strlen((char *)Code));
         pSysWarning->WarningCount++;
+        log_info("Warning Code:%s",Code);
     }
 }
 
@@ -912,7 +913,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     //uint8_t statusCodeError = 0;
 
     if (dataLen > 0) {
-        Hexdump((uint8_t *)data, dataLen);
+        //Hexdump((uint8_t *)data, dataLen);
 
         remaindLen = dataLen % WARNING_CODE_SIZE;
 
@@ -923,7 +924,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
 
         if (dataLen < WARNING_CODE_SIZE) {
             log_error("fail status code length = %d", dataLen);
-            Hexdump(data, dataLen);
+            //Hexdump(data, dataLen);
             if (pSysWarning->WarningCount > 0) {
                 for (i = 0; i < pSysWarning->WarningCount; i++) {
                     usleep(128);
@@ -993,7 +994,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     } else {
         if (CompareArrayIsZero(data, WARNING_CODE_SIZE) == false) {
             log_error("power cabinet status code data length is zero, but have data");
-            Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
+            //Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
         }
     }
 
@@ -1417,6 +1418,7 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
 
     pConnState->ConnectorTemp = pDcChargingInfo->ConnectorTemp;
     pConnState->ChillerTemp = pDcChargingInfo->ChillerTemp;
+    pConnState->PlugIn = pDcChargingInfo->ConnectorPlugIn;
 
     if (pDcChargingInfo->SystemStatus <= S_AUTHORIZING) {
         pConnState->State = CONN_ST_IDLE;    //idle
@@ -1446,9 +1448,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                     (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                     WARNING_CODE_SIZE);
             vendorErrorCodeTmp[plugNum][6] = '\0';
+            /*
             log_info("1 ID = %d, VendorErrorCode = %s",
                      plugNum,
                      (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                     */
         } else {
             if (strncmp(&vendorErrorCodeTmp[plugNum][0],
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
@@ -1458,9 +1462,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                         WARNING_CODE_SIZE);
                 vendorErrorCodeTmp[plugNum][6] = '\0';
+                /*
                 log_info("2 ID = %d, VendorErrorCode = %s",
                          plugNum,
                          (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                         */
             }
         }
     }
@@ -2054,7 +2060,9 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_PREPARING_FOR_EVSE: //insaulation test
     case S_CCS_PRECHARGE_ST0:
     case S_CCS_PRECHARGE_ST1:
+
         writeChargingTarget(fd, plugNum, gunID);
+
 		if (pDcChargingInfo->PantographFlag)
 			writeGroundFaultDetection(fd, 1, gunID);
 

+ 2 - 1
EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.h

@@ -130,7 +130,8 @@ typedef struct StConnectorState {
     uint8_t WarningCode[6];
     uint8_t ConnectorTemp;
     uint8_t ChillerTemp;
-    uint8_t Reserved[3];
+    uint8_t PlugIn;
+    uint8_t Reserved[2];
 } ConnectorState;
 
 typedef struct StConnectorIDTable {

+ 37 - 11
EVSE/Projects/DD360/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -31,7 +31,7 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
 static struct ChargingInfoData *pAcChargingInfo = NULL;
 
 bool needReloadQr = true;
-
+bool _saftydetect = false;
 bool _isShow = false; //DS60-120 add
 uint8_t _showInformIndex = 0; //DS60-120 add
 
@@ -241,9 +241,9 @@ short __show_waitgunplug_value    = 0x0468;
 uint8_t _showwaitgunplug_left     = 80;
 uint8_t _showwaitgunplug_right    = 81;
 #else
-short __show_handshark_value    = 0x1464;
-short __show_GFD_value          = 0x1466;
-short __show_precharge_value    = 0x1468;
+short __show_handshark_value    = 0x0464;
+short __show_GFD_value          = 0x0466;
+short __show_precharge_value    = 0x0468;
 
 uint8_t _show_handshark_dark    = 67;
 uint8_t _show_handshark_light   = 68;
@@ -573,6 +573,7 @@ void ChangeWarningFunc()
     //log_info("WarningCount = %d ", pSysWarning->WarningCount);
 //#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
     for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
         memset(cmd, 0x00, sizeof(cmd));
         if ((i) >= 5) {
             break;
@@ -1817,6 +1818,7 @@ void ProcessPageInfo()
 #endif //defined DD360Audi
 
     case _LCM_IDLE: {
+
         if (pSysConfig->isRFID) {
             ChangeDisplay2Value(__main_rfid, _main_rfid);
         } else {
@@ -2085,25 +2087,49 @@ void ProcessPageInfo()
             if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {
                     ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
-                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1.5) / uSEC_VAL;
+                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
                     if (precharg_time > PRECHARGING_TTIMEOUT)
                         precharg_time = PRECHARGING_TTIMEOUT;
                     ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
 
                     if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
                             pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
+                        pDcChargingInfo->_SaftyDetect = false;
                         ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
                         ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
                         ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+
                     } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
-                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
-                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
-                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
+                            if (pDcChargingInfo->_SaftyDetect == false ) {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                                if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                    pDcChargingInfo->_SaftyDetect = true;
+                            } else {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                            }
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        }
                     } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
                             pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
-                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
-                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
-                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        if (pDcChargingInfo->_SaftyDetect == false ) {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                            if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                pDcChargingInfo->_SaftyDetect = true;
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        }
                     } else {
                         ChangeDisplay2Value(__show_handshark_value, _disappear);
                         ChangeDisplay2Value(__show_GFD_value, _disappear);

+ 6 - 5
EVSE/Projects/DD360/Apps/ModulePrimary/Module_PrimaryComm.c

@@ -664,6 +664,11 @@ int main(void)
     for (;;) {
         // 程序開始之前~ 必須先確定 FW 版本與硬體版本,確認後!!~ 該模組才算是真正的 Initial Comp.
         // 模組更新 FW 後,需重新做
+        if(IsPrimaryProcessNeedPause() == true)
+        {
+            sleep(1);
+            continue;
+        }
         if (ShmPrimaryMcuData->SelfTest_Comp != PASS) {
             //log_info("(407) Get Fw and Hw Ver. ");
             GetFwAndHwVersion(Uart1Fd);
@@ -674,11 +679,7 @@ int main(void)
 
             GetInputGpioStatus(Uart1Fd);
         }
-        if(IsPrimaryProcessNeedPause() == true)
-        {
-            sleep(1);
-            continue;
-        }
+
 
         usleep(50000);
     }

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


BIN
EVSE/Projects/DD360/output/FactoryConfig


BIN
EVSE/Projects/DD360/output/Module_ChkSysTask


BIN
EVSE/Projects/DD360/output/Module_DoComm


BIN
EVSE/Projects/DD360/output/Module_EvComm


BIN
EVSE/Projects/DD360/output/Module_EventLogging


BIN
EVSE/Projects/DD360/output/Module_InternalComm


BIN
EVSE/Projects/DD360/output/Module_LcmControl


BIN
EVSE/Projects/DD360/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360/output/Module_UpdateFW


BIN
EVSE/Projects/DD360/output/ReadCmdline


BIN
EVSE/Projects/DD360/output/main


BIN
EVSE/Projects/DD360/output/simulation


+ 2 - 1
EVSE/Projects/DD360Audi/Apps/CSU/main.c

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.19.2";
+char* DebugVersion = "v1.19.3";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -4797,6 +4797,7 @@ int main(void)
                         pSysInfo->OrderCharging = NO_DEFINE;
                     }
                     StopSystemTimeoutDet();
+                    gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
                 }
 
                 isRessign = NO;

+ 1 - 0
EVSE/Projects/DD360Audi/Apps/Define/define.h

@@ -673,6 +673,7 @@ struct ChargingInfoData
     unsigned char       isEVCCIDVerify;
     unsigned char       CCSGunType;
     struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
 typedef struct

+ 11 - 3
EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c

@@ -854,6 +854,7 @@ static void addFaultCodeToBuf(uint8_t *Code)
                Code,
                strlen((char *)Code));
         pSysWarning->WarningCount++;
+        log_info("Warning Code:%s",Code);
     }
 }
 
@@ -912,7 +913,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     //uint8_t statusCodeError = 0;
 
     if (dataLen > 0) {
-        Hexdump((uint8_t *)data, dataLen);
+        //Hexdump((uint8_t *)data, dataLen);
 
         remaindLen = dataLen % WARNING_CODE_SIZE;
 
@@ -923,7 +924,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
 
         if (dataLen < WARNING_CODE_SIZE) {
             log_error("fail status code length = %d", dataLen);
-            Hexdump(data, dataLen);
+            //Hexdump(data, dataLen);
             if (pSysWarning->WarningCount > 0) {
                 for (i = 0; i < pSysWarning->WarningCount; i++) {
                     usleep(128);
@@ -993,7 +994,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     } else {
         if (CompareArrayIsZero(data, WARNING_CODE_SIZE) == false) {
             log_error("power cabinet status code data length is zero, but have data");
-            Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
+            //Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
         }
     }
 
@@ -1417,6 +1418,7 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
 
     pConnState->ConnectorTemp = pDcChargingInfo->ConnectorTemp;
     pConnState->ChillerTemp = pDcChargingInfo->ChillerTemp;
+    pConnState->PlugIn = pDcChargingInfo->ConnectorPlugIn;
 
     if (pDcChargingInfo->SystemStatus <= S_AUTHORIZING) {
         pConnState->State = CONN_ST_IDLE;    //idle
@@ -1446,9 +1448,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                     (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                     WARNING_CODE_SIZE);
             vendorErrorCodeTmp[plugNum][6] = '\0';
+            /*
             log_info("1 ID = %d, VendorErrorCode = %s",
                      plugNum,
                      (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                     */
         } else {
             if (strncmp(&vendorErrorCodeTmp[plugNum][0],
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
@@ -1458,9 +1462,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                         WARNING_CODE_SIZE);
                 vendorErrorCodeTmp[plugNum][6] = '\0';
+                /*
                 log_info("2 ID = %d, VendorErrorCode = %s",
                          plugNum,
                          (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                         */
             }
         }
     }
@@ -2054,7 +2060,9 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_PREPARING_FOR_EVSE: //insaulation test
     case S_CCS_PRECHARGE_ST0:
     case S_CCS_PRECHARGE_ST1:
+
         writeChargingTarget(fd, plugNum, gunID);
+
 		if (pDcChargingInfo->PantographFlag)
 			writeGroundFaultDetection(fd, 1, gunID);
 

+ 2 - 1
EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.h

@@ -130,7 +130,8 @@ typedef struct StConnectorState {
     uint8_t WarningCode[6];
     uint8_t ConnectorTemp;
     uint8_t ChillerTemp;
-    uint8_t Reserved[3];
+    uint8_t PlugIn;
+    uint8_t Reserved[2];
 } ConnectorState;
 
 typedef struct StConnectorIDTable {

+ 37 - 11
EVSE/Projects/DD360Audi/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -31,7 +31,7 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
 static struct ChargingInfoData *pAcChargingInfo = NULL;
 
 bool needReloadQr = true;
-
+bool _saftydetect = false;
 bool _isShow = false; //DS60-120 add
 uint8_t _showInformIndex = 0; //DS60-120 add
 
@@ -241,9 +241,9 @@ short __show_waitgunplug_value    = 0x0468;
 uint8_t _showwaitgunplug_left     = 80;
 uint8_t _showwaitgunplug_right    = 81;
 #else
-short __show_handshark_value    = 0x1464;
-short __show_GFD_value          = 0x1466;
-short __show_precharge_value    = 0x1468;
+short __show_handshark_value    = 0x0464;
+short __show_GFD_value          = 0x0466;
+short __show_precharge_value    = 0x0468;
 
 uint8_t _show_handshark_dark    = 67;
 uint8_t _show_handshark_light   = 68;
@@ -573,6 +573,7 @@ void ChangeWarningFunc()
     //log_info("WarningCount = %d ", pSysWarning->WarningCount);
 //#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
     for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
         memset(cmd, 0x00, sizeof(cmd));
         if ((i) >= 5) {
             break;
@@ -1817,6 +1818,7 @@ void ProcessPageInfo()
 #endif //defined DD360Audi
 
     case _LCM_IDLE: {
+
         if (pSysConfig->isRFID) {
             ChangeDisplay2Value(__main_rfid, _main_rfid);
         } else {
@@ -2085,25 +2087,49 @@ void ProcessPageInfo()
             if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {
                     ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
-                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1.5) / uSEC_VAL;
+                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
                     if (precharg_time > PRECHARGING_TTIMEOUT)
                         precharg_time = PRECHARGING_TTIMEOUT;
                     ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
 
                     if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
                             pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
+                        pDcChargingInfo->_SaftyDetect = false;
                         ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
                         ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
                         ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+
                     } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
-                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
-                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
-                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
+                            if (pDcChargingInfo->_SaftyDetect == false ) {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                                if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                    pDcChargingInfo->_SaftyDetect = true;
+                            } else {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                            }
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        }
                     } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
                             pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
-                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
-                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
-                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        if (pDcChargingInfo->_SaftyDetect == false ) {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                            if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                pDcChargingInfo->_SaftyDetect = true;
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        }
                     } else {
                         ChangeDisplay2Value(__show_handshark_value, _disappear);
                         ChangeDisplay2Value(__show_GFD_value, _disappear);

+ 6 - 5
EVSE/Projects/DD360Audi/Apps/ModulePrimary/Module_PrimaryComm.c

@@ -664,6 +664,11 @@ int main(void)
     for (;;) {
         // 程序開始之前~ 必須先確定 FW 版本與硬體版本,確認後!!~ 該模組才算是真正的 Initial Comp.
         // 模組更新 FW 後,需重新做
+        if(IsPrimaryProcessNeedPause() == true)
+        {
+            sleep(1);
+            continue;
+        }
         if (ShmPrimaryMcuData->SelfTest_Comp != PASS) {
             //log_info("(407) Get Fw and Hw Ver. ");
             GetFwAndHwVersion(Uart1Fd);
@@ -674,11 +679,7 @@ int main(void)
 
             GetInputGpioStatus(Uart1Fd);
         }
-        if(IsPrimaryProcessNeedPause() == true)
-        {
-            sleep(1);
-            continue;
-        }
+
 
         usleep(50000);
     }

+ 2 - 1
EVSE/Projects/DD360ComBox/Apps/CSU/main.c

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.19.2";
+char* DebugVersion = "v1.19.3";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -4797,6 +4797,7 @@ int main(void)
                         pSysInfo->OrderCharging = NO_DEFINE;
                     }
                     StopSystemTimeoutDet();
+                    gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
                 }
 
                 isRessign = NO;

+ 1 - 0
EVSE/Projects/DD360ComBox/Apps/Define/define.h

@@ -673,6 +673,7 @@ struct ChargingInfoData
     unsigned char       isEVCCIDVerify;
     unsigned char       CCSGunType;
     struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
 typedef struct

+ 11 - 3
EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c

@@ -854,6 +854,7 @@ static void addFaultCodeToBuf(uint8_t *Code)
                Code,
                strlen((char *)Code));
         pSysWarning->WarningCount++;
+        log_info("Warning Code:%s",Code);
     }
 }
 
@@ -912,7 +913,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     //uint8_t statusCodeError = 0;
 
     if (dataLen > 0) {
-        Hexdump((uint8_t *)data, dataLen);
+        //Hexdump((uint8_t *)data, dataLen);
 
         remaindLen = dataLen % WARNING_CODE_SIZE;
 
@@ -923,7 +924,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
 
         if (dataLen < WARNING_CODE_SIZE) {
             log_error("fail status code length = %d", dataLen);
-            Hexdump(data, dataLen);
+            //Hexdump(data, dataLen);
             if (pSysWarning->WarningCount > 0) {
                 for (i = 0; i < pSysWarning->WarningCount; i++) {
                     usleep(128);
@@ -993,7 +994,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     } else {
         if (CompareArrayIsZero(data, WARNING_CODE_SIZE) == false) {
             log_error("power cabinet status code data length is zero, but have data");
-            Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
+            //Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
         }
     }
 
@@ -1417,6 +1418,7 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
 
     pConnState->ConnectorTemp = pDcChargingInfo->ConnectorTemp;
     pConnState->ChillerTemp = pDcChargingInfo->ChillerTemp;
+    pConnState->PlugIn = pDcChargingInfo->ConnectorPlugIn;
 
     if (pDcChargingInfo->SystemStatus <= S_AUTHORIZING) {
         pConnState->State = CONN_ST_IDLE;    //idle
@@ -1446,9 +1448,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                     (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                     WARNING_CODE_SIZE);
             vendorErrorCodeTmp[plugNum][6] = '\0';
+            /*
             log_info("1 ID = %d, VendorErrorCode = %s",
                      plugNum,
                      (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                     */
         } else {
             if (strncmp(&vendorErrorCodeTmp[plugNum][0],
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
@@ -1458,9 +1462,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                         WARNING_CODE_SIZE);
                 vendorErrorCodeTmp[plugNum][6] = '\0';
+                /*
                 log_info("2 ID = %d, VendorErrorCode = %s",
                          plugNum,
                          (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                         */
             }
         }
     }
@@ -2054,7 +2060,9 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_PREPARING_FOR_EVSE: //insaulation test
     case S_CCS_PRECHARGE_ST0:
     case S_CCS_PRECHARGE_ST1:
+
         writeChargingTarget(fd, plugNum, gunID);
+
 		if (pDcChargingInfo->PantographFlag)
 			writeGroundFaultDetection(fd, 1, gunID);
 

+ 2 - 1
EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.h

@@ -130,7 +130,8 @@ typedef struct StConnectorState {
     uint8_t WarningCode[6];
     uint8_t ConnectorTemp;
     uint8_t ChillerTemp;
-    uint8_t Reserved[3];
+    uint8_t PlugIn;
+    uint8_t Reserved[2];
 } ConnectorState;
 
 typedef struct StConnectorIDTable {

+ 37 - 11
EVSE/Projects/DD360ComBox/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -31,7 +31,7 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
 static struct ChargingInfoData *pAcChargingInfo = NULL;
 
 bool needReloadQr = true;
-
+bool _saftydetect = false;
 bool _isShow = false; //DS60-120 add
 uint8_t _showInformIndex = 0; //DS60-120 add
 
@@ -241,9 +241,9 @@ short __show_waitgunplug_value    = 0x0468;
 uint8_t _showwaitgunplug_left     = 80;
 uint8_t _showwaitgunplug_right    = 81;
 #else
-short __show_handshark_value    = 0x1464;
-short __show_GFD_value          = 0x1466;
-short __show_precharge_value    = 0x1468;
+short __show_handshark_value    = 0x0464;
+short __show_GFD_value          = 0x0466;
+short __show_precharge_value    = 0x0468;
 
 uint8_t _show_handshark_dark    = 67;
 uint8_t _show_handshark_light   = 68;
@@ -573,6 +573,7 @@ void ChangeWarningFunc()
     //log_info("WarningCount = %d ", pSysWarning->WarningCount);
 //#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
     for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
         memset(cmd, 0x00, sizeof(cmd));
         if ((i) >= 5) {
             break;
@@ -1817,6 +1818,7 @@ void ProcessPageInfo()
 #endif //defined DD360Audi
 
     case _LCM_IDLE: {
+
         if (pSysConfig->isRFID) {
             ChangeDisplay2Value(__main_rfid, _main_rfid);
         } else {
@@ -2085,25 +2087,49 @@ void ProcessPageInfo()
             if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {
                     ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
-                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1.5) / uSEC_VAL;
+                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
                     if (precharg_time > PRECHARGING_TTIMEOUT)
                         precharg_time = PRECHARGING_TTIMEOUT;
                     ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
 
                     if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
                             pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
+                        pDcChargingInfo->_SaftyDetect = false;
                         ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
                         ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
                         ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+
                     } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
-                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
-                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
-                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
+                            if (pDcChargingInfo->_SaftyDetect == false ) {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                                if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                    pDcChargingInfo->_SaftyDetect = true;
+                            } else {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                            }
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        }
                     } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
                             pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
-                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
-                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
-                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        if (pDcChargingInfo->_SaftyDetect == false ) {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                            if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                pDcChargingInfo->_SaftyDetect = true;
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        }
                     } else {
                         ChangeDisplay2Value(__show_handshark_value, _disappear);
                         ChangeDisplay2Value(__show_GFD_value, _disappear);

+ 6 - 5
EVSE/Projects/DD360ComBox/Apps/ModulePrimary/Module_PrimaryComm.c

@@ -664,6 +664,11 @@ int main(void)
     for (;;) {
         // 程序開始之前~ 必須先確定 FW 版本與硬體版本,確認後!!~ 該模組才算是真正的 Initial Comp.
         // 模組更新 FW 後,需重新做
+        if(IsPrimaryProcessNeedPause() == true)
+        {
+            sleep(1);
+            continue;
+        }
         if (ShmPrimaryMcuData->SelfTest_Comp != PASS) {
             //log_info("(407) Get Fw and Hw Ver. ");
             GetFwAndHwVersion(Uart1Fd);
@@ -674,11 +679,7 @@ int main(void)
 
             GetInputGpioStatus(Uart1Fd);
         }
-        if(IsPrimaryProcessNeedPause() == true)
-        {
-            sleep(1);
-            continue;
-        }
+
 
         usleep(50000);
     }

+ 1 - 0
EVSE/Projects/define.h

@@ -673,6 +673,7 @@ struct ChargingInfoData
     unsigned char       isEVCCIDVerify;
     unsigned char       CCSGunType;
     struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
 typedef struct