Browse Source

2021-12-28 / Simon Xue

Actions
1. Merge RFIC Libary.
2. Add DCInputOVP and DCInputUVP message.
3. Fix bug. The second gun plugin timeout, the status from complete to idle can't select the first gun.
4. Get StartSoc after Prepare_for_EVSE.
5. Can't press right button in Authorizing Page in DD360 Project.
6. Add countdown in precharge.
7. Add String: Communication, GFD, precharge in Precharge LCM.

Files
1. As follow commit history

Image version : V1.19.XX.XXXX.XX
Simon Xue 3 years ago
parent
commit
20c8780dcf
100 changed files with 800 additions and 274 deletions
  1. 94 70
      EVSE/Modularization/Module_RFID.c
  2. BIN
      EVSE/Projects/DD360/Apps/CSU/.main.c.swp
  3. 22 9
      EVSE/Projects/DD360/Apps/CSU/Primary.c
  4. 15 8
      EVSE/Projects/DD360/Apps/CSU/main.c
  5. 1 0
      EVSE/Projects/DD360/Apps/CSU/main.h
  6. 2 1
      EVSE/Projects/DD360/Apps/Config.h
  7. 17 0
      EVSE/Projects/DD360/Apps/DebugLog.md
  8. 7 7
      EVSE/Projects/DD360/Apps/Define/define.c
  9. 64 35
      EVSE/Projects/DD360/Apps/Define/define.h
  10. 2 1
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c
  11. 2 1
      EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvRxComm.c
  12. 75 6
      EVSE/Projects/DD360/Apps/ModuleLcmCtrl/Module_LcmControl.c
  13. 2 0
      EVSE/Projects/DD360/Apps/Script/copy_from_d.sh
  14. 2 0
      EVSE/Projects/DD360/Apps/Script/copy_to_d.sh
  15. BIN
      EVSE/Projects/DD360/Apps/UnsafetyOutputTask
  16. BIN
      EVSE/Projects/DD360/Images/ramdisk.gz
  17. BIN
      EVSE/Projects/DD360/output/FactoryConfig
  18. BIN
      EVSE/Projects/DD360/output/Module_ChkSysTask
  19. BIN
      EVSE/Projects/DD360/output/Module_DoComm
  20. BIN
      EVSE/Projects/DD360/output/Module_EvComm
  21. BIN
      EVSE/Projects/DD360/output/Module_EventLogging
  22. BIN
      EVSE/Projects/DD360/output/Module_InternalComm
  23. BIN
      EVSE/Projects/DD360/output/Module_LcmControl
  24. BIN
      EVSE/Projects/DD360/output/Module_PrimaryComm
  25. BIN
      EVSE/Projects/DD360/output/Module_UpdateFW
  26. BIN
      EVSE/Projects/DD360/output/ReadCmdline
  27. BIN
      EVSE/Projects/DD360/output/UnsafetyOutputTask
  28. BIN
      EVSE/Projects/DD360/output/main
  29. BIN
      EVSE/Projects/DD360/output/simulation
  30. BIN
      EVSE/Projects/DD360Audi/Apps/CSU/.main.c.swp
  31. 22 9
      EVSE/Projects/DD360Audi/Apps/CSU/Primary.c
  32. 15 8
      EVSE/Projects/DD360Audi/Apps/CSU/main.c
  33. 1 0
      EVSE/Projects/DD360Audi/Apps/CSU/main.h
  34. 2 1
      EVSE/Projects/DD360Audi/Apps/Config.h
  35. 17 0
      EVSE/Projects/DD360Audi/Apps/DebugLog.md
  36. 7 7
      EVSE/Projects/DD360Audi/Apps/Define/define.c
  37. 64 35
      EVSE/Projects/DD360Audi/Apps/Define/define.h
  38. 2 1
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c
  39. 2 1
      EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvRxComm.c
  40. 75 6
      EVSE/Projects/DD360Audi/Apps/ModuleLcmCtrl/Module_LcmControl.c
  41. BIN
      EVSE/Projects/DD360Audi/Apps/Module_ChkSysTask
  42. BIN
      EVSE/Projects/DD360Audi/Apps/Module_DoComm
  43. BIN
      EVSE/Projects/DD360Audi/Apps/Module_EvComm
  44. BIN
      EVSE/Projects/DD360Audi/Apps/Module_EventLogging
  45. BIN
      EVSE/Projects/DD360Audi/Apps/Module_InternalComm
  46. BIN
      EVSE/Projects/DD360Audi/Apps/Module_UpdateFW
  47. 2 0
      EVSE/Projects/DD360Audi/Apps/Script/copy_from_d.sh
  48. 2 0
      EVSE/Projects/DD360Audi/Apps/Script/copy_to_d.sh
  49. BIN
      EVSE/Projects/DD360Audi/Apps/main
  50. BIN
      EVSE/Projects/DD360ComBox/Apps/CSU/.main.c.swp
  51. 22 9
      EVSE/Projects/DD360ComBox/Apps/CSU/Primary.c
  52. 15 8
      EVSE/Projects/DD360ComBox/Apps/CSU/main.c
  53. 1 0
      EVSE/Projects/DD360ComBox/Apps/CSU/main.h
  54. 2 1
      EVSE/Projects/DD360ComBox/Apps/Config.h
  55. 17 0
      EVSE/Projects/DD360ComBox/Apps/DebugLog.md
  56. 7 7
      EVSE/Projects/DD360ComBox/Apps/Define/define.c
  57. 64 35
      EVSE/Projects/DD360ComBox/Apps/Define/define.h
  58. 2 1
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c
  59. 2 1
      EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvRxComm.c
  60. 75 6
      EVSE/Projects/DD360ComBox/Apps/ModuleLcmCtrl/Module_LcmControl.c
  61. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_ChkSysTask
  62. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_DoComm
  63. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_EvComm
  64. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_EventLogging
  65. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_InternalComm
  66. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_UpdateFW
  67. 2 0
      EVSE/Projects/DD360ComBox/Apps/Script/copy_from_d.sh
  68. 2 0
      EVSE/Projects/DD360ComBox/Apps/Script/copy_to_d.sh
  69. BIN
      EVSE/Projects/DD360ComBox/Apps/UnsafetyOutputTask
  70. BIN
      EVSE/Projects/DD360ComBox/Apps/main
  71. BIN
      EVSE/Projects/DD360Tcci/Images/FactoryDefaultConfig.bin
  72. BIN
      EVSE/Projects/DD360Tcci/Images/ramdisk.gz
  73. BIN
      EVSE/Projects/DD360Tcci/output/FactoryConfig
  74. BIN
      EVSE/Projects/DD360Tcci/output/Module_ChkSysTask
  75. BIN
      EVSE/Projects/DD360Tcci/output/Module_DoComm
  76. BIN
      EVSE/Projects/DD360Tcci/output/Module_EvComm
  77. BIN
      EVSE/Projects/DD360Tcci/output/Module_EventLogging
  78. BIN
      EVSE/Projects/DD360Tcci/output/Module_InternalComm
  79. BIN
      EVSE/Projects/DD360Tcci/output/Module_LcmControl
  80. BIN
      EVSE/Projects/DD360Tcci/output/Module_PrimaryComm
  81. BIN
      EVSE/Projects/DD360Tcci/output/Module_UpdateFW
  82. BIN
      EVSE/Projects/DD360Tcci/output/ReadCmdline
  83. 10 0
      EVSE/Projects/DD360Tcci/output/SearchIP.sh
  84. BIN
      EVSE/Projects/DD360Tcci/output/UnsafetyOutputTask
  85. 15 0
      EVSE/Projects/DD360Tcci/output/init.sh
  86. 47 0
      EVSE/Projects/DD360Tcci/output/kill.sh
  87. BIN
      EVSE/Projects/DD360Tcci/output/main
  88. BIN
      EVSE/Projects/DD360Tcci/output/simulation
  89. 1 0
      EVSE/Projects/DD360Tcci/output/web.sh
  90. BIN
      EVSE/Projects/DD360UCar/Images/FactoryDefaultConfig.bin
  91. BIN
      EVSE/Projects/DD360UCar/Images/ramdisk.gz
  92. BIN
      EVSE/Projects/DD360UCar/output/FactoryConfig
  93. BIN
      EVSE/Projects/DD360UCar/output/Module_ChkSysTask
  94. BIN
      EVSE/Projects/DD360UCar/output/Module_DoComm
  95. BIN
      EVSE/Projects/DD360UCar/output/Module_EvComm
  96. BIN
      EVSE/Projects/DD360UCar/output/Module_EventLogging
  97. BIN
      EVSE/Projects/DD360UCar/output/Module_InternalComm
  98. BIN
      EVSE/Projects/DD360UCar/output/Module_LcmControl
  99. BIN
      EVSE/Projects/DD360UCar/output/Module_PrimaryComm
  100. BIN
      EVSE/Projects/DD360UCar/output/Module_UpdateFW

+ 94 - 70
EVSE/Modularization/Module_RFID.c

@@ -198,6 +198,25 @@ char ClaCheckSum(unsigned char *buffer, int len)
 	return chksum;
 }
 
+int chksumValid(unsigned char * buffer)
+{
+	int result = FAIL;
+	int chksum = 0;
+
+	if(buffer[0] > 2)
+	{
+		for(int idx=0;idx<(buffer[0]);idx++)
+		{
+			chksum ^= buffer[idx];
+		}
+
+		if(chksum == buffer[buffer[0]])
+			result = PASS;
+	}
+
+	return result;
+}
+
 bool getRequestCardSN(int Fd, int moduleType, RFID* rfid)
 {
 	bool isSuccess = false;
@@ -250,15 +269,14 @@ bool ISO14443A_REQUEST_SN(int Fd, int moduleType, unsigned char *data)
 {
 	bool isSuccess = false;
 	int tx_len = 4;
-	unsigned char txByte[tx_len];
-	unsigned char rxByte[254];
-	unsigned char tmp[254];
+	unsigned char txByte[4] 		= {0};
+	unsigned char rxByte[254] 		= {0};
 	
-	unsigned char TX_MESSAGE[254];
-	unsigned char RX_MESSAGE[254];
-	unsigned char TMP_MESSAGE[254];
-	unsigned char TX_LENGTH;
-	unsigned char RX_LENGTH;
+	unsigned char TX_MESSAGE[254] 	= {0};
+	unsigned char RX_MESSAGE[254] 	= {0};
+	unsigned char TMP_MESSAGE[254] 	= {0};
+	unsigned char TX_LENGTH 		= 0;
+	unsigned char RX_LENGTH			= 0;
 
 	switch(moduleType)
 	{
@@ -274,41 +292,42 @@ bool ISO14443A_REQUEST_SN(int Fd, int moduleType, unsigned char *data)
 
 			if(Fd > 0)
 			{
-				memset(rxByte, 0, sizeof (rxByte));
 				if(system_command(Fd, txByte, tx_len, rxByte) > 0)
 				{
-					memset(tmp, 0, sizeof tmp);
-					memcpy(tmp, rxByte, sizeof(rxByte));
-					if(tmp[1] == RFID_CMD_ISO1443A_REQUEST)
+					if(chksumValid(rxByte) == PASS)
 					{
-						if(tmp[0] == 0x09)
+						if((rxByte[1] == RFID_CMD_ISO1443A_REQUEST))
 						{
-							DEBUG_INFO_1("MIFARE CLASSIC.\n");
-
-							cardLength = LENGTH_4;
-							memcpy(data, rxByte+2, cardLength);
-
-							isSuccess = true;
+							if(rxByte[0] == 0x09)
+							{
+								cardLength = LENGTH_4;
+								memcpy(data, rxByte+2, cardLength);
+								DEBUG_INFO_1("MIFARE CLASSIC SN: %02X-%02X-%02X-%02X\n", data[0], data[1], data[2], data[3]);
+								isSuccess = true;
+							}
+							else if(rxByte[0] == 0x0C)
+							{
+								cardLength = LENGTH_7;
+								memcpy(data, rxByte+2, cardLength);
+								DEBUG_INFO_1("MIFARE PLUS SN: %02X-%02X-%02X-%02X-%02X-%02X-%02X\n", data[0], data[1], data[2], data[3], data[4], data[5], data[6]);
+
+								isSuccess = true;
+							}
+							else
+							{}
 						}
-						else if(tmp[0] == 0x0C)
+						else if (rxByte[1] == 0xDF)
 						{
-							DEBUG_INFO_1("MIFARE PLUS.\n");
-
-							cardLength = LENGTH_7;
-							memcpy(data, rxByte+2, cardLength);
-
-							isSuccess = true;
+							cardLength = LENGTH_0;
+							isSuccess = false;
 						}
 						else
 						{}
 					}
-					else if (tmp[1] == 0xDF)
+					else
 					{
-						cardLength = LENGTH_0;
-						isSuccess = false;
+						//DEBUG_ERROR_1("Response check sum mismatch.\n");
 					}
-					else
-					{}
 				}
 				else
 				{}
@@ -394,9 +413,8 @@ bool ISO14443B_REQUEST_SN(int Fd, int moduleType, unsigned char *data)
 	bool isSuccess = false;
 	int cardLength;
 	int tx_len = 5;
-	unsigned char txByte[tx_len];
-	unsigned char rxByte[254];
-	unsigned char tmp[254];
+	unsigned char txByte[5] 	= {0};
+	unsigned char rxByte[254] 	= {0};
 	
 	/*
 	unsigned char TX_MESSAGE[254];
@@ -421,27 +439,30 @@ bool ISO14443B_REQUEST_SN(int Fd, int moduleType, unsigned char *data)
 
 			if(Fd > 0)
 			{
-				memset(rxByte, 0, sizeof (rxByte));
 				if(system_command(Fd, txByte, tx_len, rxByte) > 0)
 				{
-					memset(tmp, 0, sizeof tmp);
-					memcpy(tmp, rxByte, sizeof(rxByte));
-					if(tmp[1] == RFID_CMD_ISO1443B_REQUEST)
+					if(chksumValid(rxByte) == PASS)
 					{
-						DEBUG_INFO_1("ISO14443 TYPE B.\n");
-
-						cardLength = LENGTH_4;
-						memcpy(data, rxByte+3, cardLength);
+						if((rxByte[1] == RFID_CMD_ISO1443B_REQUEST) && (rxByte[0] >= 12))
+						{
+							cardLength = LENGTH_4;
+							memcpy(data, rxByte+3, cardLength);
+							DEBUG_INFO_1("ISO14443-B SN: %02X-%02X-%02X-%02X\n", data[0], data[1], data[2], data[3]);
 
-						isSuccess = true;
+							isSuccess = true;
+						}
+						else if(rxByte[1] == 0x9F)
+						{
+							cardLength = LENGTH_0;
+							isSuccess = false;
+						}
+						else
+						{}
 					}
-					else if(tmp[1] == 0x9F)
+					else
 					{
-						cardLength = LENGTH_0;
-						isSuccess = false;
+						//DEBUG_ERROR_1("Response check sum mismatch.\n");
 					}
-					else
-					{}
 				}
 				else
 				{}
@@ -515,15 +536,14 @@ bool FELICA_REQUEST_SN(int Fd, int moduleType, unsigned char *data)
 	bool isSuccess = false;
 	int cardLength;
 	int tx_len = 9;
-	unsigned char txByte[tx_len];
-	unsigned char rxByte[254];
-	unsigned char tmp[254];
+	unsigned char txByte[9] 		= {0};
+	unsigned char rxByte[254]		= {0};
 	
-	unsigned char TX_MESSAGE[254];
-	unsigned char RX_MESSAGE[254];
-	unsigned char TMP_MESSAGE[254];
-	unsigned char TX_LENGTH;
-	unsigned char RX_LENGTH;
+	unsigned char TX_MESSAGE[254]	= {0};
+	unsigned char RX_MESSAGE[254]	= {0};
+	unsigned char TMP_MESSAGE[254]	= {0};
+	unsigned char TX_LENGTH			= 0;
+	unsigned char RX_LENGTH			= 0;
 
 	switch(moduleType)
 	{
@@ -547,24 +567,28 @@ bool FELICA_REQUEST_SN(int Fd, int moduleType, unsigned char *data)
 				memset(rxByte, 0, sizeof (rxByte));
 				if(system_command(Fd, txByte, tx_len, rxByte) > 0)
 				{
-					memset(tmp, 0, sizeof tmp);
-					memcpy(tmp, rxByte, sizeof(rxByte));
-					if(tmp[1] == RFID_CMD_FELICA_POLLING_REQUEST)
+					if(chksumValid(rxByte) == PASS)
 					{
-						DEBUG_INFO_1("FELICA.\n");
-
-						cardLength = LENGTH_6;
-						memcpy(data, rxByte+6, cardLength);
+						if((rxByte[1] == RFID_CMD_FELICA_POLLING_REQUEST) && (rxByte[0] >= 22))
+						{
+							cardLength = LENGTH_6;
+							memcpy(data, rxByte+6, cardLength);
+							DEBUG_INFO_1("FELICA SN: %02X-%02X-%02X-%02X-%02X-%02X\n", data[0], data[1], data[2], data[3], data[4], data[5]);
 
-						isSuccess = true;
+							isSuccess = true;
+						}
+						else if(rxByte[1] == 0xD0)
+						{
+							cardLength = LENGTH_0;
+							isSuccess = false;
+						}
+						else
+						{}
 					}
-					else if(tmp[1] == 0xD0)
+					else
 					{
-						cardLength = LENGTH_0;
-						isSuccess = false;
+						//DEBUG_ERROR_1("Response check sum mismatch.\n");
 					}
-					else
-					{}
 				}
 				else
 				{}
@@ -1023,4 +1047,4 @@ bool setDefaultOfAutomaticDetectingCard(int Fd, int moduleType, int Value)
 	}
 	
 	return isSuccess;
-}
+}

BIN
EVSE/Projects/DD360/Apps/CSU/.main.c.swp


+ 22 - 9
EVSE/Projects/DD360/Apps/CSU/Primary.c

@@ -339,6 +339,14 @@ void ChkPrimaryStatus(void)
                 ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
                 EmcOccureByString("042252");
                 Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
+                EmcOccureByString("042327");
+                Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
+                EmcOccureByString("042328");
+                Rtn = 1;
             } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
                 ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
                 EmcOccureByString("042200");
@@ -364,12 +372,16 @@ void ChkPrimaryStatus(void)
         if (Rtn == 0) {
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
             ReleaseEmsOccureByString(0, "042251");
             ReleaseEmsOccureByString(0, "042252");
+            ReleaseEmsOccureByString(0, "042327");
+            ReleaseEmsOccureByString(0, "042328");
             ReleaseEmsOccureByString(0, "042200");
             ReleaseEmsOccureByString(0, "042201");
             ReleaseEmsOccureByString(0, "042202");
@@ -379,12 +391,16 @@ void ChkPrimaryStatus(void)
     } else {
         ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
         ReleaseEmsOccureByString(0, "042251");
         ReleaseEmsOccureByString(0, "042252");
+        ReleaseEmsOccureByString(0, "042327");
+        ReleaseEmsOccureByString(0, "042328");
         ReleaseEmsOccureByString(0, "042200");
         ReleaseEmsOccureByString(0, "042201");
         ReleaseEmsOccureByString(0, "042202");
@@ -428,13 +444,10 @@ void ChkPrimaryStatus(void)
     //}
 
     if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
-            !leftBtnPush
-#if defined DD360Audi
-            &&
+            !leftBtnPush &&
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
-#endif //defined DD360Audi
        ) {
         pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
 
@@ -538,15 +551,14 @@ void ChkPrimaryStatus(void)
     }
 
     if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
-            !rightBtnPush
+            !rightBtnPush &&
 #if defined DD360Audi
-            &&
             pSysInfo->SystemPage != _LCM_IDLE &&
+#endif
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
             pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
-#endif //defined DD360Audi
        ) {
         if (!rightBtnPush) {
             rightBtnPush = true;
@@ -576,9 +588,10 @@ void ChkPrimaryStatus(void)
                 pSysInfo->CurGunSelected = 0;
                 ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
             }
+            log_info("current select gun ............................... %d ",
+                     pSysInfo->CurGunSelected);
         }
-        log_info("current select gun ............................... %d ",
-                 pSysInfo->CurGunSelected);
+
     } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
         if (rightBtnPush) {
             rightBtnPush = false;

+ 15 - 8
EVSE/Projects/DD360/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V1.18.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.18.0";
+char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
+char* DebugVersion = "v1.19.2";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1644,9 +1644,6 @@ void _DetectPlugInTimeout(void)
 	setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
 #elif DD360 || DD360Combox
  	setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
-    systemPageRestoreInit();
-   
-	return;
 #endif
     systemPageRestoreInit();
 }
@@ -3849,6 +3846,8 @@ static void ReviewCriticalAlarm(void)
             //Power cabinet alarm status
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP == YES ||
@@ -4362,7 +4361,14 @@ int main(void)
     log_info(" ********************************************************");
     log_info(" ******************  FileSystem Boot up *****************");
     log_info(" ********************************************************");
-
+#if defined DD360
+    log_info(" ******************  Project:DD360  *********************");
+#elif defined DD360Audi
+    log_info(" ******************  Project:DD360Audi  *****************");
+#elif defined DD360ComBox
+    log_info(" ******************  Project:DD360ComBox  ***************");
+#endif
+    log_info(" ********************************************************");
     if (!InitialSystemDefaultConfig()) {
         log_error("InitialSystemDefaultConfig NG ");
         //StopProcessingLoop();
@@ -5239,8 +5245,9 @@ int main(void)
                         GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
                     setChargerMode(gunIndex, MODE_IDLE);
                     destroySelGun(gunIndex); //Jerry add
-#ifdef DD360 || DD3660ComBox
-					pSysInfo->SystemPage = _LCM_IDLE;
+#ifdef defined DD360 || defined DD3660ComBox
+					//pSysInfo->SystemPage = _LCM_IDLE;
+                    connectorPageRestoreIdle();
 #endif
                 }
 

+ 1 - 0
EVSE/Projects/DD360/Apps/CSU/main.h

@@ -43,6 +43,7 @@
 #define GUN_COMP_WAIT_TIMEOUT                   (10)
 #define GUN_PRECHARGING_TIMEOUT                 (60)
 #define EVCCID_LINK_TIMEOUT                     (120)
+#define PRECHARGING_TTIMEOUT                    (60)
 
 #define WHILE_LOOP_TIME                         (10000)
 

+ 2 - 1
EVSE/Projects/DD360/Apps/Config.h

@@ -333,11 +333,12 @@ typedef union {
     struct {
         uint8_t EmergencyStop: 1;    //Power cabinet emergency stop
         uint8_t DoorOpen: 1;         //Power cabinet emergency door open
+        uint8_t DcInputOVP: 1;
+        uint8_t DcInputUVP: 1;
         uint8_t SystemL1InputOVP: 1; //Power cabinet system L1 input OVP
         uint8_t SystemL2InputOVP: 1; //Power cabinet System L2 input OVP
         uint8_t SystemL3InputOVP: 1; //Power cabinet System L3 input OVP
         uint8_t PsuFailure: 1;       //Power cabinet PSU Failure Alarm
-        uint8_t Reserved: 2;
     } StatusBit;
 } PowerAlarmState;
 

+ 17 - 0
EVSE/Projects/DD360/Apps/DebugLog.md

@@ -0,0 +1,17 @@
+2021/05/25
+1. Add detected chiller temperature and stop charging when it exceeds 90°C.
+2. Fix multi dispenser reboot, DHCP IP address conflict issue.
+3. Fix the GFD test failed and the alarm code was not recorded.
+4. Fix ccs OVP status code not release issue.
+5. Add to complete the registration but did not get the balance to restart DoComm.
+6. Add button stop charging function.
+
+2021/06/10
+1. Add Chiller temperature OTP and chiller sensor broken status code 012323 and 011038.
+
+2021/06/18
+1. ReadCmdLine.c add support double test charging function.
+
+2021/06/23
+1. Debug Module_RateCurrent.c lost gun type issue.
+2. 在充電第二把槍時,槍櫃等待主後送permission後再通知小板進入充電狀態。

+ 7 - 7
EVSE/Projects/DD360/Apps/Define/define.c

@@ -103,8 +103,8 @@ char FaultStatusCode[40][6]=
 "011036", //Rotary switch fault
 "011037", //CCS liquid chiller water level fault
 "011038", //Chiller temperature sensor broken
-"011039", //Reserved
-"011040" //Reserved
+"011039", //Parallel relay welding
+"011040"  //Parallel output relay driving fault
 };
 
 char AlarmStatusCode[160][6]=
@@ -233,11 +233,11 @@ char AlarmStatusCode[160][6]=
 "012321", // System CCS output UCP
 "012322", // System GBT output UCP
 "012323", // System Chiller output OTP
-"012324", // reserved
-"012325", // reserved
-"012326", // reserved
-"012327", // reserved
-"012328",   // reserved
+"012324", // Connector 1 detects abnormal voltage on the output line
+"012325", // Connector 2 detects abnormal voltage on the output line
+"012326", // System task is lost
+"012327", // DC input ovp
+"012328",   // DC input uvp
 "012329",   // reserved
 "012330",   // reserved
 "012331",   // reserved

+ 64 - 35
EVSE/Projects/DD360/Apps/Define/define.h

@@ -63,6 +63,15 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY    0
     #define PSU_QUANTITY            0
     #define ONE_CONNECTOR_USE       0
+#elif defined NoodoeAX
+    #define MAX_PSU_QUANTITY        62
+    #define CHAdeMO_QUANTITY        1
+    #define CCS_QUANTITY            1
+    #define GB_QUANTITY             0
+    #define AC_QUANTITY             1
+    #define GENERAL_GUN_QUANTITY    0
+    #define PSU_QUANTITY            0
+    #define ONE_CONNECTOR_USE       0
 #elif defined AX80
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        1
@@ -117,7 +126,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY	0
     #define PSU_QUANTITY            2
     #define ONE_CONNECTOR_USE       0
-#elif defined DD360 || defined DD360Audi || defined DD360ComBox
+#elif defined DD360 || defined DD360Audi || defined DD360ComBox || defined DD360UCar || defined DD360Tcci
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        2
     #define CCS_QUANTITY            2
@@ -312,6 +321,8 @@ enum CoreProfile {
      TimeOffsetNextTransition,
      SystemUptimeSec,
      FreeVend,
+     OcppServer,
+     MaintainServer,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -450,7 +461,10 @@ typedef union
         unsigned int AlarmStop:1;                   // 0: no effect,    1: alarm stop
         unsigned int BackendStop:1;                 // 0: no effect,    1: backend stop
         unsigned int ManualStop:1;                  // 0: no effect,    1: manual stop
-        unsigned int res:28;
+        unsigned int HardResetStop:1;               // 0: no effect,    1: hard reset stop
+        unsigned int SoftResetStop:1;               // 0: no effect,    1: soft reset stop
+        unsigned int InvalidIdStop:1;               // 0: no effect,    1: invalid stop when StopTransactionOnInvalidId is true
+        unsigned int res:25;
     }bits;
 }ChargingStop;
 
@@ -551,9 +565,11 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           OcppReceiptrURL[512];               // Charging receipt display URL
+    unsigned char           isAuthrizeByEVCCID;                 // is Authorize by EVCCID (CCS)
+    unsigned char           MaintainServerURL[512];             // ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
 };
 
 struct ChargingInfoData
@@ -580,6 +596,7 @@ struct ChargingInfoData
 	float PresentChargingCurrent;   // unit: 1A
 	float PresentChargingPower;		//0~6553.5 kW
 	float PresentChargedEnergy;		//0~6553.5 kWh
+	float presentChargedEnergyPeriod[24];       // Session present charged energy at each period
 	int PresentChargedDuration;	// second
 	int RemainChargingDuration;	// second
 	float EvBatteryMaxVoltage;		// 0~6553.5 volt
@@ -654,8 +671,22 @@ struct ChargingInfoData
     unsigned char       PantographFlag;                 // 0: normal gun type,  1: pantograph gun type
     unsigned char       Replug_flag;
     unsigned char       isEVCCIDVerify;
+    unsigned char       CCSGunType;
+    struct timeval      PreChargeTimer;
 };
 
+typedef struct
+{
+    unsigned char       AuthId[32];
+                                                        // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
+    unsigned char       AuthStatus;                     // 3: Authorize done, 4: Authorize end
+    unsigned char       AuthTarget;                     // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
+    unsigned char       AuthType;                       // 0: _AuthType_None,   1: _AuthType_RFID, 2: _AuthType_RemoteStart
+    unsigned char       AuthResult;                     // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    unsigned char       AuthRequest;                    // 0: no request, 1: authorize request
+    unsigned char       res;
+}AuthorizingInfoData;
+
 typedef union
 {
     unsigned int SettingValue;
@@ -666,7 +697,6 @@ typedef union
         unsigned int DispenserConfigSync:1;             // 0: not synced,   1: synced
         unsigned int MiscNeedAnnouncement:1;            // 0: no need,      1: need send misc command
         unsigned int NeedDispenserVerInfo:1;            // 0: no need,      1: need dispenser to report it's version info
-        unsigned int EnableAutoGunSelection:1;          // 0: disable,      1: enable auto gun selection
         unsigned int AuthorizeRequest:1;                // 0: idle,         1: requesting                           ( dispenser -> cabinet)
         unsigned int ConnectorTimeoutConfigRequest:1;   // 0: no request,   1: connector timeout setting            (    ocpp   -> cabinet -> dispenser)
         unsigned int DefaultPriceConfigRequest:1;       // 0: no request,   1: default price setting                (    ocpp   -> cabinet -> dispenser)
@@ -686,6 +716,7 @@ typedef union
         unsigned int StopButtonStatusRequest:1;         // 0: no request,   1: stop charging button status has changed          ( cabinet -> dispenser)
         unsigned int AuthModeConfigRequest:1;           // 0: no request,   1: AuthMode Config has changed                      ( cabinet -> dispenser)
         unsigned int EVCCIDConfigRequest:1;             // 0: no request,   1: EVCCID Config has changed                        ( cabinet -> dispenser)
+        unsigned int LEDIntensityRequest:1;             // 0: no request,   1: LED Intensity has changed                        ( cabinet -> dispenser)
         unsigned int res:7;
     }bits;
 }DispenserSettingFlag;
@@ -723,11 +754,7 @@ struct DispenserModule
     unsigned char   Connector2FwRev[32];        //Connector2 module firmware version
     struct   LED    LedInfo;                    // LED configuration info
 
-                                                // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
-    unsigned char           AuthStatus;         // 3: Authorize done, 4: Authorize end
-    unsigned char           AuthTarget;         // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
-    unsigned char           AuthType;           // 0: _AuthType_None, 1: _AuthType_RFID, 2: _AuthType_RemoteStart
-    unsigned char           AuthResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData     AuthInfo;
     DispenserSettingFlag    Setting;
     char                    FwFileName[128];
     unsigned char           ConnectionChannel;
@@ -808,7 +835,8 @@ typedef union
         unsigned int  FaultStatusRequest:1;
         unsigned int  Disconnection:1;
         unsigned int  GfdDetection:1;                   // 0: stop,         1: start
-        unsigned int  res:9;
+        unsigned int  GetStartChargingSoc:1;            // 0: no effect,    1: get start soc
+        unsigned int  res:8;
     }bits;
 }ConnectorParameter;
 
@@ -820,8 +848,7 @@ struct ConnectorInfoData
     unsigned char ParentDispensetIndex;                 // Parent Dispenser Index: 0 ~ 3
     ConnectorParameter       Parameter;
 
-    unsigned char            AuthorizingType;
-    unsigned char            AuthorizingResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData      AuthInfo;
     struct ChargingInfoData  GeneralChargingData;
     struct WARNING_CODE_INFO WarningInfo;
 
@@ -840,8 +867,11 @@ struct ConnectorInfoData
 
     unsigned short          MaxTotalChargingCurrent;        // max total output current, unit: 0.1A
     unsigned short          MaxTotalChargingPower;          // max total output power, unit: 0.1kw
-    unsigned short          MaxOutputEnergy;                //0: no limit,  1 ~ 65535   kWh
-    unsigned short          MaxOutputDuration;              //0: no limit,  1 ~ 65535   minutes
+    unsigned short          MaxOutputEnergy;                // 0: no limit,  1 ~ 65535   kWh
+    unsigned short          MaxOutputDuration;              // 0: no limit,  1 ~ 65535   minutes
+    float                   CapabilityVoltage;              // unit 0.1V
+    float                   CapabilityCurrent;              // unit 0.1A
+    float                   CapabilityPower;                // unit 0.1kW
 
     unsigned int            UserPrice;                      // connector user's user price, unit: 0.01 (dollar / kWh)
     unsigned int            TotalCost;                      // connector user's total cost, unit: 0.01 dollar
@@ -853,14 +883,11 @@ typedef union
     unsigned int SettingValue;
     struct
     {
-        unsigned int StartAuthorize:1;          // 0: idle,    1: authorizing
-        unsigned int AuthorizingCompleted:1;    // 0: not yet, 1: authorizing completed
         unsigned int DispenserDisconnection:1;  // 0: no connection,  1: dispenser connected
-        unsigned int BackendAuthorized:1;       // 0: local authorized, 1: backend authorized
         unsigned int FlashConfigChanged:1;      // 0: no effect, 1: flash config has changed
         unsigned int EnableWriteFlash:1;        // 0: no effect, 1: enable to write flash after timeout
         unsigned int CleanWiringInfo:1;         // 0: no effect, 1: clean wiring info
-        unsigned int res:25;
+        unsigned int res:28;
     }bits;
 }CabinetSettingFlag;
 
@@ -943,7 +970,7 @@ struct SysInfoData
 	unsigned char 		InternetConn;					//0: disconnected, 1: connected
 	/**************Backend***************/
 	unsigned char 		OcppConnStatus;					//0: disconnected, 1: connected
-	unsigned char 		MaintainServerConnStatus;		//0: disconnected, 1: connected
+    unsigned char       MaintainServerConnStatus;       //0: disconnected, 1: connected
 	char 				OrderCharging;
     float               MaxChargingProfilePower;        // unit: 1W
 	/**************Alston***************/
@@ -986,7 +1013,7 @@ struct SysInfoData
     CabinetMiscCommand      CabinetMicsStatus;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     DC_Meter_Info DcMeterInfo[4];
-    unsigned char           OTPTemp;                    // OTP Temperature 
+    unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
 };
 
@@ -1112,8 +1139,8 @@ char FaultStatusCode[40][6]=
 	"011036",	//Rotary switch fault
 	"011037",	//CCS liquid chiller water level fault
 	"011038",	//Chiller temperature sensor broken
-	"011039",	//Reserved
-	"011040"	//Reserved
+	"011039",	//Parallel relay welding
+	"011040"	//Parallel output relay driving fault
 };
 */
 
@@ -1168,7 +1195,8 @@ struct FaultCodeData
 			unsigned char RotarySwitchFault:1;					//bit 3 
 			unsigned char CcsLiquidChillerWaterLevelFault:1;    //bit 4
             unsigned char ChillerTempSensorBroken:1;            //bit 5
-            unsigned char :2;                                   //bit 6 ~ 7 reserved
+            unsigned char ParallelRelayWelding:1;               //bit 6
+            unsigned char ParallelRelayDriving:1;               //bit 7
 		}bits;
 	}FaultEvents;
 };
@@ -1303,8 +1331,8 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // reserved
-    "012328",   // reserved
+    "012327",   // DC input ovp
+    "012328",   // DC input uvp
     "012329",   // reserved
     "012330",   // reserved
     "012331",   // reserved
@@ -1489,9 +1517,10 @@ struct AlarmCodeData
             unsigned char AbnormalVoltageOnOutputLine_1:1;          //bit 4
             unsigned char AbnormalVoltageOnOutputLine_2:1;          //bit 5
             unsigned char SystemTaskLost:1;                         //bit 6
-            unsigned char Reserved:1;                               //bit 7
+            unsigned char DcInputOVP:1;                             //bit 7
             //AlarmVal[16]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char DcInputUVP:1;                             //bit 0
+            unsigned char :7;                                       //reserved bit 1 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -4264,7 +4293,7 @@ struct StructDataTransfer
 	unsigned char MessageId[52];
 	unsigned char Data[512];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];
+	unsigned char ResponseData[512];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4383,7 +4412,7 @@ struct OCPP16ConfigurationItem
 {
 	unsigned char 		ItemName[64];
 	unsigned char 		ItemAccessibility;//0:RO, 1:RW
-	unsigned char 		ItemData[500];
+	unsigned char 		ItemData[501];//value should be limited in 500 bytes
 };
 
 struct OCPP16ConfigurationTable
@@ -4563,9 +4592,9 @@ struct StructSignedFirmwareStatusNotification
 
 struct StructSessionTarget
 {
-	unsigned char		targetSoc;			// Unit: %,   		0 is unlimit
-	unsigned short		targetEnergy;		// Unit: KWH		0 is unlimit
-	unsigned short		targetDuration;		// Unit: Minutes	0 is unlimit
+    unsigned char       targetSoc;          // Unit: %,         0 is unlimit
+    unsigned short      targetEnergy;       // Unit: KWH        0 is unlimit
+    unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
 struct OCPP16Data
@@ -4756,7 +4785,7 @@ struct OCPP16Data
     struct StructSecurityEventNotification          SecurityEventNotification;
     struct StructSignCertificate                    SignCertificate;
     struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget	                    SessionTarget[CONNECTOR_QUANTITY];
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
 };
 
 

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

@@ -1431,7 +1431,8 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
         pConnState->State = CONN_ST_PREPARING;    //preparing
     } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
         pConnState->State = CONN_ST_CHARGING;    //charging
-    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING) {
+    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING ||
+            pDcChargingInfo->SystemStatus == S_COMPLETE) {
         pConnState->State = CONN_ST_TERMINATING;    //terminating
     } else if ((pDcChargingInfo->SystemStatus == S_ALARM) ||
                (pDcChargingInfo->SystemStatus == S_FAULT)) {

+ 2 - 1
EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -417,7 +417,8 @@ void CANReceiver(int fd)
                         (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
                          pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1)
                    ) {
-                    if (pDcChargingInfo->EvBatteryStartSoc <= 0) {
+                    if (pDcChargingInfo->EvBatteryStartSoc <= 0 &&
+                            pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE) {
                         pDcChargingInfo->EvBatteryStartSoc = frame.data[1];
                     }
 

+ 75 - 6
EVSE/Projects/DD360/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -16,7 +16,7 @@
 #include "../Define/define.h"
 #include "../Config.h"
 #include "../SelectGun/SelectGun.h"
-
+#include "../CSU/main.h"
 //------------------------------------------------------------------------------
 //struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 //struct StatusCodeData           *ShmStatusCodeData;
@@ -215,7 +215,7 @@ uint8_t _logo_cmp               = 62;
 uint8_t _battery_eng_trp_map    = 63;
 uint8_t _money_trp_map          = 64;
 uint8_t _elapse_time_trp_map    = 65;
-
+#if defined DD360Audi
 ////For Audi
 uint8_t _left_gun_disable_map   = 66;
 uint8_t _left_gun_enable_map    = 67;
@@ -240,7 +240,18 @@ uint8_t _showselectgun_right    = 78;
 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;
+
+uint8_t _show_handshark_dark    = 67;
+uint8_t _show_handshark_light   = 68;
+uint8_t _show_GFD_dark          = 69;
+uint8_t _show_GFD_light         = 70;
+uint8_t _show_precharge_dark    = 71;
+uint8_t _show_precharge_light   = 72;
+#endif
 //#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -880,7 +891,7 @@ void GetTimespecFunc(struct timespec *time)
 {
     clock_gettime(CLOCK_MONOTONIC_COARSE, time);
 }
-
+#if defined DD360Audi
 void RunReplugStringFunction(bool isRun)
 {
     if (isRun) {
@@ -918,7 +929,7 @@ void RunFullTargetFunction(bool isRun)
         ChangeDisplay2Value(__show_StatusString_value_2, _disappear);
     }
 }
-
+#endif
 /**
  * [ChangeBalanceValue :print balance information]
  * @Author
@@ -1739,6 +1750,40 @@ void InformationShow()
     }
 }
 
+void showPhihongLogo(bool _show)
+{
+    /*
+    if( pSysConfig->ModelName[3] == 'U' ) {
+        if (pSysConfig->ModelName[12] == 'P' && pSysConfig->ModelName[13] == 'H') {
+            ChangeDisplay2Value(_logo, _disappear);
+            ChangeDisplay2Value(_logo_cmp, _disappear);
+        }
+    }
+    */
+    if (!_show) {
+        ChangeDisplay2Value(_logo, _disappear);
+        ChangeDisplay2Value(_logo_cmp, _disappear);
+    }
+}
+unsigned long GetPreChargeTimeoutValue(struct timeval _sour_time)
+{
+    struct timeval _end_time;
+    gettimeofday(&_end_time, NULL);
+
+    return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
+}
+
+void ChangeTimeValue(uint8_t time)
+{
+    uint8_t cmd[2];
+    uint8_t value[2];
+
+    memset(cmd, 0x00, sizeof(cmd));
+    sprintf((char *) value, "%d", time);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
+}
+
 void ProcessPageInfo()
 {
     _page_reload = IsPageReloadChk();
@@ -1756,7 +1801,7 @@ void ProcessPageInfo()
             ChangeDisplay2Value(__sel_gun_btn, _disappear);
         }
     }
-
+    showPhihongLogo(false);
     switch (_currentPage) {
 #if defined DD360Audi
     case _LCM_SELECT_GUN: ////For Audi
@@ -2040,6 +2085,30 @@ 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;
+                    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) {
+                        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);
+                    } 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);
+                    } else {
+                        ChangeDisplay2Value(__show_handshark_value, _disappear);
+                        ChangeDisplay2Value(__show_GFD_value, _disappear);
+                        ChangeDisplay2Value(__show_precharge_value, _disappear);
+                    }
                 }
             } else if (_currentPage == _LCM_CHARGING && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {

+ 2 - 0
EVSE/Projects/DD360/Apps/Script/copy_from_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

+ 2 - 0
EVSE/Projects/DD360/Apps/Script/copy_to_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/* /mnt/d/Phihong/Project/DD360Audi/Apps/

BIN
EVSE/Projects/DD360/Apps/UnsafetyOutputTask


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/UnsafetyOutputTask


BIN
EVSE/Projects/DD360/output/main


BIN
EVSE/Projects/DD360/output/simulation


BIN
EVSE/Projects/DD360Audi/Apps/CSU/.main.c.swp


+ 22 - 9
EVSE/Projects/DD360Audi/Apps/CSU/Primary.c

@@ -339,6 +339,14 @@ void ChkPrimaryStatus(void)
                 ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
                 EmcOccureByString("042252");
                 Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
+                EmcOccureByString("042327");
+                Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
+                EmcOccureByString("042328");
+                Rtn = 1;
             } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
                 ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
                 EmcOccureByString("042200");
@@ -364,12 +372,16 @@ void ChkPrimaryStatus(void)
         if (Rtn == 0) {
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
             ReleaseEmsOccureByString(0, "042251");
             ReleaseEmsOccureByString(0, "042252");
+            ReleaseEmsOccureByString(0, "042327");
+            ReleaseEmsOccureByString(0, "042328");
             ReleaseEmsOccureByString(0, "042200");
             ReleaseEmsOccureByString(0, "042201");
             ReleaseEmsOccureByString(0, "042202");
@@ -379,12 +391,16 @@ void ChkPrimaryStatus(void)
     } else {
         ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
         ReleaseEmsOccureByString(0, "042251");
         ReleaseEmsOccureByString(0, "042252");
+        ReleaseEmsOccureByString(0, "042327");
+        ReleaseEmsOccureByString(0, "042328");
         ReleaseEmsOccureByString(0, "042200");
         ReleaseEmsOccureByString(0, "042201");
         ReleaseEmsOccureByString(0, "042202");
@@ -428,13 +444,10 @@ void ChkPrimaryStatus(void)
     //}
 
     if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
-            !leftBtnPush
-#if defined DD360Audi
-            &&
+            !leftBtnPush &&
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
-#endif //defined DD360Audi
        ) {
         pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
 
@@ -538,15 +551,14 @@ void ChkPrimaryStatus(void)
     }
 
     if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
-            !rightBtnPush
+            !rightBtnPush &&
 #if defined DD360Audi
-            &&
             pSysInfo->SystemPage != _LCM_IDLE &&
+#endif
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
             pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
-#endif //defined DD360Audi
        ) {
         if (!rightBtnPush) {
             rightBtnPush = true;
@@ -576,9 +588,10 @@ void ChkPrimaryStatus(void)
                 pSysInfo->CurGunSelected = 0;
                 ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
             }
+            log_info("current select gun ............................... %d ",
+                     pSysInfo->CurGunSelected);
         }
-        log_info("current select gun ............................... %d ",
-                 pSysInfo->CurGunSelected);
+
     } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
         if (rightBtnPush) {
             rightBtnPush = false;

+ 15 - 8
EVSE/Projects/DD360Audi/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V1.18.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.18.0";
+char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
+char* DebugVersion = "v1.19.2";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1644,9 +1644,6 @@ void _DetectPlugInTimeout(void)
 	setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
 #elif DD360 || DD360Combox
  	setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
-    systemPageRestoreInit();
-   
-	return;
 #endif
     systemPageRestoreInit();
 }
@@ -3849,6 +3846,8 @@ static void ReviewCriticalAlarm(void)
             //Power cabinet alarm status
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP == YES ||
@@ -4362,7 +4361,14 @@ int main(void)
     log_info(" ********************************************************");
     log_info(" ******************  FileSystem Boot up *****************");
     log_info(" ********************************************************");
-
+#if defined DD360
+    log_info(" ******************  Project:DD360  *********************");
+#elif defined DD360Audi
+    log_info(" ******************  Project:DD360Audi  *****************");
+#elif defined DD360ComBox
+    log_info(" ******************  Project:DD360ComBox  ***************");
+#endif
+    log_info(" ********************************************************");
     if (!InitialSystemDefaultConfig()) {
         log_error("InitialSystemDefaultConfig NG ");
         //StopProcessingLoop();
@@ -5239,8 +5245,9 @@ int main(void)
                         GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
                     setChargerMode(gunIndex, MODE_IDLE);
                     destroySelGun(gunIndex); //Jerry add
-#ifdef DD360 || DD3660ComBox
-					pSysInfo->SystemPage = _LCM_IDLE;
+#ifdef defined DD360 || defined DD3660ComBox
+					//pSysInfo->SystemPage = _LCM_IDLE;
+                    connectorPageRestoreIdle();
 #endif
                 }
 

+ 1 - 0
EVSE/Projects/DD360Audi/Apps/CSU/main.h

@@ -43,6 +43,7 @@
 #define GUN_COMP_WAIT_TIMEOUT                   (10)
 #define GUN_PRECHARGING_TIMEOUT                 (60)
 #define EVCCID_LINK_TIMEOUT                     (120)
+#define PRECHARGING_TTIMEOUT                    (60)
 
 #define WHILE_LOOP_TIME                         (10000)
 

+ 2 - 1
EVSE/Projects/DD360Audi/Apps/Config.h

@@ -333,11 +333,12 @@ typedef union {
     struct {
         uint8_t EmergencyStop: 1;    //Power cabinet emergency stop
         uint8_t DoorOpen: 1;         //Power cabinet emergency door open
+        uint8_t DcInputOVP: 1;
+        uint8_t DcInputUVP: 1;
         uint8_t SystemL1InputOVP: 1; //Power cabinet system L1 input OVP
         uint8_t SystemL2InputOVP: 1; //Power cabinet System L2 input OVP
         uint8_t SystemL3InputOVP: 1; //Power cabinet System L3 input OVP
         uint8_t PsuFailure: 1;       //Power cabinet PSU Failure Alarm
-        uint8_t Reserved: 2;
     } StatusBit;
 } PowerAlarmState;
 

+ 17 - 0
EVSE/Projects/DD360Audi/Apps/DebugLog.md

@@ -0,0 +1,17 @@
+2021/05/25
+1. Add detected chiller temperature and stop charging when it exceeds 90°C.
+2. Fix multi dispenser reboot, DHCP IP address conflict issue.
+3. Fix the GFD test failed and the alarm code was not recorded.
+4. Fix ccs OVP status code not release issue.
+5. Add to complete the registration but did not get the balance to restart DoComm.
+6. Add button stop charging function.
+
+2021/06/10
+1. Add Chiller temperature OTP and chiller sensor broken status code 012323 and 011038.
+
+2021/06/18
+1. ReadCmdLine.c add support double test charging function.
+
+2021/06/23
+1. Debug Module_RateCurrent.c lost gun type issue.
+2. 在充電第二把槍時,槍櫃等待主後送permission後再通知小板進入充電狀態。

+ 7 - 7
EVSE/Projects/DD360Audi/Apps/Define/define.c

@@ -103,8 +103,8 @@ char FaultStatusCode[40][6]=
 "011036", //Rotary switch fault
 "011037", //CCS liquid chiller water level fault
 "011038", //Chiller temperature sensor broken
-"011039", //Reserved
-"011040" //Reserved
+"011039", //Parallel relay welding
+"011040"  //Parallel output relay driving fault
 };
 
 char AlarmStatusCode[160][6]=
@@ -233,11 +233,11 @@ char AlarmStatusCode[160][6]=
 "012321", // System CCS output UCP
 "012322", // System GBT output UCP
 "012323", // System Chiller output OTP
-"012324", // reserved
-"012325", // reserved
-"012326", // reserved
-"012327", // reserved
-"012328",   // reserved
+"012324", // Connector 1 detects abnormal voltage on the output line
+"012325", // Connector 2 detects abnormal voltage on the output line
+"012326", // System task is lost
+"012327", // DC input ovp
+"012328",   // DC input uvp
 "012329",   // reserved
 "012330",   // reserved
 "012331",   // reserved

+ 64 - 35
EVSE/Projects/DD360Audi/Apps/Define/define.h

@@ -63,6 +63,15 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY    0
     #define PSU_QUANTITY            0
     #define ONE_CONNECTOR_USE       0
+#elif defined NoodoeAX
+    #define MAX_PSU_QUANTITY        62
+    #define CHAdeMO_QUANTITY        1
+    #define CCS_QUANTITY            1
+    #define GB_QUANTITY             0
+    #define AC_QUANTITY             1
+    #define GENERAL_GUN_QUANTITY    0
+    #define PSU_QUANTITY            0
+    #define ONE_CONNECTOR_USE       0
 #elif defined AX80
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        1
@@ -117,7 +126,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY	0
     #define PSU_QUANTITY            2
     #define ONE_CONNECTOR_USE       0
-#elif defined DD360 || defined DD360Audi || defined DD360ComBox
+#elif defined DD360 || defined DD360Audi || defined DD360ComBox || defined DD360UCar || defined DD360Tcci
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        2
     #define CCS_QUANTITY            2
@@ -312,6 +321,8 @@ enum CoreProfile {
      TimeOffsetNextTransition,
      SystemUptimeSec,
      FreeVend,
+     OcppServer,
+     MaintainServer,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -450,7 +461,10 @@ typedef union
         unsigned int AlarmStop:1;                   // 0: no effect,    1: alarm stop
         unsigned int BackendStop:1;                 // 0: no effect,    1: backend stop
         unsigned int ManualStop:1;                  // 0: no effect,    1: manual stop
-        unsigned int res:28;
+        unsigned int HardResetStop:1;               // 0: no effect,    1: hard reset stop
+        unsigned int SoftResetStop:1;               // 0: no effect,    1: soft reset stop
+        unsigned int InvalidIdStop:1;               // 0: no effect,    1: invalid stop when StopTransactionOnInvalidId is true
+        unsigned int res:25;
     }bits;
 }ChargingStop;
 
@@ -551,9 +565,11 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           OcppReceiptrURL[512];               // Charging receipt display URL
+    unsigned char           isAuthrizeByEVCCID;                 // is Authorize by EVCCID (CCS)
+    unsigned char           MaintainServerURL[512];             // ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
 };
 
 struct ChargingInfoData
@@ -580,6 +596,7 @@ struct ChargingInfoData
 	float PresentChargingCurrent;   // unit: 1A
 	float PresentChargingPower;		//0~6553.5 kW
 	float PresentChargedEnergy;		//0~6553.5 kWh
+	float presentChargedEnergyPeriod[24];       // Session present charged energy at each period
 	int PresentChargedDuration;	// second
 	int RemainChargingDuration;	// second
 	float EvBatteryMaxVoltage;		// 0~6553.5 volt
@@ -654,8 +671,22 @@ struct ChargingInfoData
     unsigned char       PantographFlag;                 // 0: normal gun type,  1: pantograph gun type
     unsigned char       Replug_flag;
     unsigned char       isEVCCIDVerify;
+    unsigned char       CCSGunType;
+    struct timeval      PreChargeTimer;
 };
 
+typedef struct
+{
+    unsigned char       AuthId[32];
+                                                        // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
+    unsigned char       AuthStatus;                     // 3: Authorize done, 4: Authorize end
+    unsigned char       AuthTarget;                     // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
+    unsigned char       AuthType;                       // 0: _AuthType_None,   1: _AuthType_RFID, 2: _AuthType_RemoteStart
+    unsigned char       AuthResult;                     // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    unsigned char       AuthRequest;                    // 0: no request, 1: authorize request
+    unsigned char       res;
+}AuthorizingInfoData;
+
 typedef union
 {
     unsigned int SettingValue;
@@ -666,7 +697,6 @@ typedef union
         unsigned int DispenserConfigSync:1;             // 0: not synced,   1: synced
         unsigned int MiscNeedAnnouncement:1;            // 0: no need,      1: need send misc command
         unsigned int NeedDispenserVerInfo:1;            // 0: no need,      1: need dispenser to report it's version info
-        unsigned int EnableAutoGunSelection:1;          // 0: disable,      1: enable auto gun selection
         unsigned int AuthorizeRequest:1;                // 0: idle,         1: requesting                           ( dispenser -> cabinet)
         unsigned int ConnectorTimeoutConfigRequest:1;   // 0: no request,   1: connector timeout setting            (    ocpp   -> cabinet -> dispenser)
         unsigned int DefaultPriceConfigRequest:1;       // 0: no request,   1: default price setting                (    ocpp   -> cabinet -> dispenser)
@@ -686,6 +716,7 @@ typedef union
         unsigned int StopButtonStatusRequest:1;         // 0: no request,   1: stop charging button status has changed          ( cabinet -> dispenser)
         unsigned int AuthModeConfigRequest:1;           // 0: no request,   1: AuthMode Config has changed                      ( cabinet -> dispenser)
         unsigned int EVCCIDConfigRequest:1;             // 0: no request,   1: EVCCID Config has changed                        ( cabinet -> dispenser)
+        unsigned int LEDIntensityRequest:1;             // 0: no request,   1: LED Intensity has changed                        ( cabinet -> dispenser)
         unsigned int res:7;
     }bits;
 }DispenserSettingFlag;
@@ -723,11 +754,7 @@ struct DispenserModule
     unsigned char   Connector2FwRev[32];        //Connector2 module firmware version
     struct   LED    LedInfo;                    // LED configuration info
 
-                                                // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
-    unsigned char           AuthStatus;         // 3: Authorize done, 4: Authorize end
-    unsigned char           AuthTarget;         // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
-    unsigned char           AuthType;           // 0: _AuthType_None, 1: _AuthType_RFID, 2: _AuthType_RemoteStart
-    unsigned char           AuthResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData     AuthInfo;
     DispenserSettingFlag    Setting;
     char                    FwFileName[128];
     unsigned char           ConnectionChannel;
@@ -808,7 +835,8 @@ typedef union
         unsigned int  FaultStatusRequest:1;
         unsigned int  Disconnection:1;
         unsigned int  GfdDetection:1;                   // 0: stop,         1: start
-        unsigned int  res:9;
+        unsigned int  GetStartChargingSoc:1;            // 0: no effect,    1: get start soc
+        unsigned int  res:8;
     }bits;
 }ConnectorParameter;
 
@@ -820,8 +848,7 @@ struct ConnectorInfoData
     unsigned char ParentDispensetIndex;                 // Parent Dispenser Index: 0 ~ 3
     ConnectorParameter       Parameter;
 
-    unsigned char            AuthorizingType;
-    unsigned char            AuthorizingResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData      AuthInfo;
     struct ChargingInfoData  GeneralChargingData;
     struct WARNING_CODE_INFO WarningInfo;
 
@@ -840,8 +867,11 @@ struct ConnectorInfoData
 
     unsigned short          MaxTotalChargingCurrent;        // max total output current, unit: 0.1A
     unsigned short          MaxTotalChargingPower;          // max total output power, unit: 0.1kw
-    unsigned short          MaxOutputEnergy;                //0: no limit,  1 ~ 65535   kWh
-    unsigned short          MaxOutputDuration;              //0: no limit,  1 ~ 65535   minutes
+    unsigned short          MaxOutputEnergy;                // 0: no limit,  1 ~ 65535   kWh
+    unsigned short          MaxOutputDuration;              // 0: no limit,  1 ~ 65535   minutes
+    float                   CapabilityVoltage;              // unit 0.1V
+    float                   CapabilityCurrent;              // unit 0.1A
+    float                   CapabilityPower;                // unit 0.1kW
 
     unsigned int            UserPrice;                      // connector user's user price, unit: 0.01 (dollar / kWh)
     unsigned int            TotalCost;                      // connector user's total cost, unit: 0.01 dollar
@@ -853,14 +883,11 @@ typedef union
     unsigned int SettingValue;
     struct
     {
-        unsigned int StartAuthorize:1;          // 0: idle,    1: authorizing
-        unsigned int AuthorizingCompleted:1;    // 0: not yet, 1: authorizing completed
         unsigned int DispenserDisconnection:1;  // 0: no connection,  1: dispenser connected
-        unsigned int BackendAuthorized:1;       // 0: local authorized, 1: backend authorized
         unsigned int FlashConfigChanged:1;      // 0: no effect, 1: flash config has changed
         unsigned int EnableWriteFlash:1;        // 0: no effect, 1: enable to write flash after timeout
         unsigned int CleanWiringInfo:1;         // 0: no effect, 1: clean wiring info
-        unsigned int res:25;
+        unsigned int res:28;
     }bits;
 }CabinetSettingFlag;
 
@@ -943,7 +970,7 @@ struct SysInfoData
 	unsigned char 		InternetConn;					//0: disconnected, 1: connected
 	/**************Backend***************/
 	unsigned char 		OcppConnStatus;					//0: disconnected, 1: connected
-	unsigned char 		MaintainServerConnStatus;		//0: disconnected, 1: connected
+    unsigned char       MaintainServerConnStatus;       //0: disconnected, 1: connected
 	char 				OrderCharging;
     float               MaxChargingProfilePower;        // unit: 1W
 	/**************Alston***************/
@@ -986,7 +1013,7 @@ struct SysInfoData
     CabinetMiscCommand      CabinetMicsStatus;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     DC_Meter_Info DcMeterInfo[4];
-    unsigned char           OTPTemp;                    // OTP Temperature 
+    unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
 };
 
@@ -1112,8 +1139,8 @@ char FaultStatusCode[40][6]=
 	"011036",	//Rotary switch fault
 	"011037",	//CCS liquid chiller water level fault
 	"011038",	//Chiller temperature sensor broken
-	"011039",	//Reserved
-	"011040"	//Reserved
+	"011039",	//Parallel relay welding
+	"011040"	//Parallel output relay driving fault
 };
 */
 
@@ -1168,7 +1195,8 @@ struct FaultCodeData
 			unsigned char RotarySwitchFault:1;					//bit 3 
 			unsigned char CcsLiquidChillerWaterLevelFault:1;    //bit 4
             unsigned char ChillerTempSensorBroken:1;            //bit 5
-            unsigned char :2;                                   //bit 6 ~ 7 reserved
+            unsigned char ParallelRelayWelding:1;               //bit 6
+            unsigned char ParallelRelayDriving:1;               //bit 7
 		}bits;
 	}FaultEvents;
 };
@@ -1303,8 +1331,8 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // reserved
-    "012328",   // reserved
+    "012327",   // DC input ovp
+    "012328",   // DC input uvp
     "012329",   // reserved
     "012330",   // reserved
     "012331",   // reserved
@@ -1489,9 +1517,10 @@ struct AlarmCodeData
             unsigned char AbnormalVoltageOnOutputLine_1:1;          //bit 4
             unsigned char AbnormalVoltageOnOutputLine_2:1;          //bit 5
             unsigned char SystemTaskLost:1;                         //bit 6
-            unsigned char Reserved:1;                               //bit 7
+            unsigned char DcInputOVP:1;                             //bit 7
             //AlarmVal[16]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char DcInputUVP:1;                             //bit 0
+            unsigned char :7;                                       //reserved bit 1 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -4264,7 +4293,7 @@ struct StructDataTransfer
 	unsigned char MessageId[52];
 	unsigned char Data[512];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];
+	unsigned char ResponseData[512];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4383,7 +4412,7 @@ struct OCPP16ConfigurationItem
 {
 	unsigned char 		ItemName[64];
 	unsigned char 		ItemAccessibility;//0:RO, 1:RW
-	unsigned char 		ItemData[500];
+	unsigned char 		ItemData[501];//value should be limited in 500 bytes
 };
 
 struct OCPP16ConfigurationTable
@@ -4563,9 +4592,9 @@ struct StructSignedFirmwareStatusNotification
 
 struct StructSessionTarget
 {
-	unsigned char		targetSoc;			// Unit: %,   		0 is unlimit
-	unsigned short		targetEnergy;		// Unit: KWH		0 is unlimit
-	unsigned short		targetDuration;		// Unit: Minutes	0 is unlimit
+    unsigned char       targetSoc;          // Unit: %,         0 is unlimit
+    unsigned short      targetEnergy;       // Unit: KWH        0 is unlimit
+    unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
 struct OCPP16Data
@@ -4756,7 +4785,7 @@ struct OCPP16Data
     struct StructSecurityEventNotification          SecurityEventNotification;
     struct StructSignCertificate                    SignCertificate;
     struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget	                    SessionTarget[CONNECTOR_QUANTITY];
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
 };
 
 

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

@@ -1431,7 +1431,8 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
         pConnState->State = CONN_ST_PREPARING;    //preparing
     } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
         pConnState->State = CONN_ST_CHARGING;    //charging
-    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING) {
+    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING ||
+            pDcChargingInfo->SystemStatus == S_COMPLETE) {
         pConnState->State = CONN_ST_TERMINATING;    //terminating
     } else if ((pDcChargingInfo->SystemStatus == S_ALARM) ||
                (pDcChargingInfo->SystemStatus == S_FAULT)) {

+ 2 - 1
EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -417,7 +417,8 @@ void CANReceiver(int fd)
                         (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
                          pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1)
                    ) {
-                    if (pDcChargingInfo->EvBatteryStartSoc <= 0) {
+                    if (pDcChargingInfo->EvBatteryStartSoc <= 0 &&
+                            pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE) {
                         pDcChargingInfo->EvBatteryStartSoc = frame.data[1];
                     }
 

+ 75 - 6
EVSE/Projects/DD360Audi/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -16,7 +16,7 @@
 #include "../Define/define.h"
 #include "../Config.h"
 #include "../SelectGun/SelectGun.h"
-
+#include "../CSU/main.h"
 //------------------------------------------------------------------------------
 //struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 //struct StatusCodeData           *ShmStatusCodeData;
@@ -215,7 +215,7 @@ uint8_t _logo_cmp               = 62;
 uint8_t _battery_eng_trp_map    = 63;
 uint8_t _money_trp_map          = 64;
 uint8_t _elapse_time_trp_map    = 65;
-
+#if defined DD360Audi
 ////For Audi
 uint8_t _left_gun_disable_map   = 66;
 uint8_t _left_gun_enable_map    = 67;
@@ -240,7 +240,18 @@ uint8_t _showselectgun_right    = 78;
 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;
+
+uint8_t _show_handshark_dark    = 67;
+uint8_t _show_handshark_light   = 68;
+uint8_t _show_GFD_dark          = 69;
+uint8_t _show_GFD_light         = 70;
+uint8_t _show_precharge_dark    = 71;
+uint8_t _show_precharge_light   = 72;
+#endif
 //#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -880,7 +891,7 @@ void GetTimespecFunc(struct timespec *time)
 {
     clock_gettime(CLOCK_MONOTONIC_COARSE, time);
 }
-
+#if defined DD360Audi
 void RunReplugStringFunction(bool isRun)
 {
     if (isRun) {
@@ -918,7 +929,7 @@ void RunFullTargetFunction(bool isRun)
         ChangeDisplay2Value(__show_StatusString_value_2, _disappear);
     }
 }
-
+#endif
 /**
  * [ChangeBalanceValue :print balance information]
  * @Author
@@ -1739,6 +1750,40 @@ void InformationShow()
     }
 }
 
+void showPhihongLogo(bool _show)
+{
+    /*
+    if( pSysConfig->ModelName[3] == 'U' ) {
+        if (pSysConfig->ModelName[12] == 'P' && pSysConfig->ModelName[13] == 'H') {
+            ChangeDisplay2Value(_logo, _disappear);
+            ChangeDisplay2Value(_logo_cmp, _disappear);
+        }
+    }
+    */
+    if (!_show) {
+        ChangeDisplay2Value(_logo, _disappear);
+        ChangeDisplay2Value(_logo_cmp, _disappear);
+    }
+}
+unsigned long GetPreChargeTimeoutValue(struct timeval _sour_time)
+{
+    struct timeval _end_time;
+    gettimeofday(&_end_time, NULL);
+
+    return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
+}
+
+void ChangeTimeValue(uint8_t time)
+{
+    uint8_t cmd[2];
+    uint8_t value[2];
+
+    memset(cmd, 0x00, sizeof(cmd));
+    sprintf((char *) value, "%d", time);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
+}
+
 void ProcessPageInfo()
 {
     _page_reload = IsPageReloadChk();
@@ -1756,7 +1801,7 @@ void ProcessPageInfo()
             ChangeDisplay2Value(__sel_gun_btn, _disappear);
         }
     }
-
+    showPhihongLogo(false);
     switch (_currentPage) {
 #if defined DD360Audi
     case _LCM_SELECT_GUN: ////For Audi
@@ -2040,6 +2085,30 @@ 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;
+                    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) {
+                        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);
+                    } 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);
+                    } else {
+                        ChangeDisplay2Value(__show_handshark_value, _disappear);
+                        ChangeDisplay2Value(__show_GFD_value, _disappear);
+                        ChangeDisplay2Value(__show_precharge_value, _disappear);
+                    }
                 }
             } else if (_currentPage == _LCM_CHARGING && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {

BIN
EVSE/Projects/DD360Audi/Apps/Module_ChkSysTask


BIN
EVSE/Projects/DD360Audi/Apps/Module_DoComm


BIN
EVSE/Projects/DD360Audi/Apps/Module_EvComm


BIN
EVSE/Projects/DD360Audi/Apps/Module_EventLogging


BIN
EVSE/Projects/DD360Audi/Apps/Module_InternalComm


BIN
EVSE/Projects/DD360Audi/Apps/Module_UpdateFW


+ 2 - 0
EVSE/Projects/DD360Audi/Apps/Script/copy_from_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

+ 2 - 0
EVSE/Projects/DD360Audi/Apps/Script/copy_to_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/* /mnt/d/Phihong/Project/DD360Audi/Apps/

BIN
EVSE/Projects/DD360Audi/Apps/main


BIN
EVSE/Projects/DD360ComBox/Apps/CSU/.main.c.swp


+ 22 - 9
EVSE/Projects/DD360ComBox/Apps/CSU/Primary.c

@@ -339,6 +339,14 @@ void ChkPrimaryStatus(void)
                 ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
                 EmcOccureByString("042252");
                 Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
+                EmcOccureByString("042327");
+                Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
+                EmcOccureByString("042328");
+                Rtn = 1;
             } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
                 ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
                 EmcOccureByString("042200");
@@ -364,12 +372,16 @@ void ChkPrimaryStatus(void)
         if (Rtn == 0) {
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
             ReleaseEmsOccureByString(0, "042251");
             ReleaseEmsOccureByString(0, "042252");
+            ReleaseEmsOccureByString(0, "042327");
+            ReleaseEmsOccureByString(0, "042328");
             ReleaseEmsOccureByString(0, "042200");
             ReleaseEmsOccureByString(0, "042201");
             ReleaseEmsOccureByString(0, "042202");
@@ -379,12 +391,16 @@ void ChkPrimaryStatus(void)
     } else {
         ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
         ReleaseEmsOccureByString(0, "042251");
         ReleaseEmsOccureByString(0, "042252");
+        ReleaseEmsOccureByString(0, "042327");
+        ReleaseEmsOccureByString(0, "042328");
         ReleaseEmsOccureByString(0, "042200");
         ReleaseEmsOccureByString(0, "042201");
         ReleaseEmsOccureByString(0, "042202");
@@ -428,13 +444,10 @@ void ChkPrimaryStatus(void)
     //}
 
     if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
-            !leftBtnPush
-#if defined DD360Audi
-            &&
+            !leftBtnPush &&
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
-#endif //defined DD360Audi
        ) {
         pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
 
@@ -538,15 +551,14 @@ void ChkPrimaryStatus(void)
     }
 
     if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
-            !rightBtnPush
+            !rightBtnPush &&
 #if defined DD360Audi
-            &&
             pSysInfo->SystemPage != _LCM_IDLE &&
+#endif
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
             pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
-#endif //defined DD360Audi
        ) {
         if (!rightBtnPush) {
             rightBtnPush = true;
@@ -576,9 +588,10 @@ void ChkPrimaryStatus(void)
                 pSysInfo->CurGunSelected = 0;
                 ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
             }
+            log_info("current select gun ............................... %d ",
+                     pSysInfo->CurGunSelected);
         }
-        log_info("current select gun ............................... %d ",
-                 pSysInfo->CurGunSelected);
+
     } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
         if (rightBtnPush) {
             rightBtnPush = false;

+ 15 - 8
EVSE/Projects/DD360ComBox/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V1.18.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.18.0";
+char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
+char* DebugVersion = "v1.19.2";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1644,9 +1644,6 @@ void _DetectPlugInTimeout(void)
 	setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
 #elif DD360 || DD360Combox
  	setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
-    systemPageRestoreInit();
-   
-	return;
 #endif
     systemPageRestoreInit();
 }
@@ -3849,6 +3846,8 @@ static void ReviewCriticalAlarm(void)
             //Power cabinet alarm status
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP == YES ||
@@ -4362,7 +4361,14 @@ int main(void)
     log_info(" ********************************************************");
     log_info(" ******************  FileSystem Boot up *****************");
     log_info(" ********************************************************");
-
+#if defined DD360
+    log_info(" ******************  Project:DD360  *********************");
+#elif defined DD360Audi
+    log_info(" ******************  Project:DD360Audi  *****************");
+#elif defined DD360ComBox
+    log_info(" ******************  Project:DD360ComBox  ***************");
+#endif
+    log_info(" ********************************************************");
     if (!InitialSystemDefaultConfig()) {
         log_error("InitialSystemDefaultConfig NG ");
         //StopProcessingLoop();
@@ -5239,8 +5245,9 @@ int main(void)
                         GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
                     setChargerMode(gunIndex, MODE_IDLE);
                     destroySelGun(gunIndex); //Jerry add
-#ifdef DD360 || DD3660ComBox
-					pSysInfo->SystemPage = _LCM_IDLE;
+#ifdef defined DD360 || defined DD3660ComBox
+					//pSysInfo->SystemPage = _LCM_IDLE;
+                    connectorPageRestoreIdle();
 #endif
                 }
 

+ 1 - 0
EVSE/Projects/DD360ComBox/Apps/CSU/main.h

@@ -43,6 +43,7 @@
 #define GUN_COMP_WAIT_TIMEOUT                   (10)
 #define GUN_PRECHARGING_TIMEOUT                 (60)
 #define EVCCID_LINK_TIMEOUT                     (120)
+#define PRECHARGING_TTIMEOUT                    (60)
 
 #define WHILE_LOOP_TIME                         (10000)
 

+ 2 - 1
EVSE/Projects/DD360ComBox/Apps/Config.h

@@ -333,11 +333,12 @@ typedef union {
     struct {
         uint8_t EmergencyStop: 1;    //Power cabinet emergency stop
         uint8_t DoorOpen: 1;         //Power cabinet emergency door open
+        uint8_t DcInputOVP: 1;
+        uint8_t DcInputUVP: 1;
         uint8_t SystemL1InputOVP: 1; //Power cabinet system L1 input OVP
         uint8_t SystemL2InputOVP: 1; //Power cabinet System L2 input OVP
         uint8_t SystemL3InputOVP: 1; //Power cabinet System L3 input OVP
         uint8_t PsuFailure: 1;       //Power cabinet PSU Failure Alarm
-        uint8_t Reserved: 2;
     } StatusBit;
 } PowerAlarmState;
 

+ 17 - 0
EVSE/Projects/DD360ComBox/Apps/DebugLog.md

@@ -0,0 +1,17 @@
+2021/05/25
+1. Add detected chiller temperature and stop charging when it exceeds 90°C.
+2. Fix multi dispenser reboot, DHCP IP address conflict issue.
+3. Fix the GFD test failed and the alarm code was not recorded.
+4. Fix ccs OVP status code not release issue.
+5. Add to complete the registration but did not get the balance to restart DoComm.
+6. Add button stop charging function.
+
+2021/06/10
+1. Add Chiller temperature OTP and chiller sensor broken status code 012323 and 011038.
+
+2021/06/18
+1. ReadCmdLine.c add support double test charging function.
+
+2021/06/23
+1. Debug Module_RateCurrent.c lost gun type issue.
+2. 在充電第二把槍時,槍櫃等待主後送permission後再通知小板進入充電狀態。

+ 7 - 7
EVSE/Projects/DD360ComBox/Apps/Define/define.c

@@ -103,8 +103,8 @@ char FaultStatusCode[40][6]=
 "011036", //Rotary switch fault
 "011037", //CCS liquid chiller water level fault
 "011038", //Chiller temperature sensor broken
-"011039", //Reserved
-"011040" //Reserved
+"011039", //Parallel relay welding
+"011040"  //Parallel output relay driving fault
 };
 
 char AlarmStatusCode[160][6]=
@@ -233,11 +233,11 @@ char AlarmStatusCode[160][6]=
 "012321", // System CCS output UCP
 "012322", // System GBT output UCP
 "012323", // System Chiller output OTP
-"012324", // reserved
-"012325", // reserved
-"012326", // reserved
-"012327", // reserved
-"012328",   // reserved
+"012324", // Connector 1 detects abnormal voltage on the output line
+"012325", // Connector 2 detects abnormal voltage on the output line
+"012326", // System task is lost
+"012327", // DC input ovp
+"012328",   // DC input uvp
 "012329",   // reserved
 "012330",   // reserved
 "012331",   // reserved

+ 64 - 35
EVSE/Projects/DD360ComBox/Apps/Define/define.h

@@ -63,6 +63,15 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY    0
     #define PSU_QUANTITY            0
     #define ONE_CONNECTOR_USE       0
+#elif defined NoodoeAX
+    #define MAX_PSU_QUANTITY        62
+    #define CHAdeMO_QUANTITY        1
+    #define CCS_QUANTITY            1
+    #define GB_QUANTITY             0
+    #define AC_QUANTITY             1
+    #define GENERAL_GUN_QUANTITY    0
+    #define PSU_QUANTITY            0
+    #define ONE_CONNECTOR_USE       0
 #elif defined AX80
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        1
@@ -117,7 +126,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY	0
     #define PSU_QUANTITY            2
     #define ONE_CONNECTOR_USE       0
-#elif defined DD360 || defined DD360Audi || defined DD360ComBox
+#elif defined DD360 || defined DD360Audi || defined DD360ComBox || defined DD360UCar || defined DD360Tcci
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        2
     #define CCS_QUANTITY            2
@@ -312,6 +321,8 @@ enum CoreProfile {
      TimeOffsetNextTransition,
      SystemUptimeSec,
      FreeVend,
+     OcppServer,
+     MaintainServer,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -450,7 +461,10 @@ typedef union
         unsigned int AlarmStop:1;                   // 0: no effect,    1: alarm stop
         unsigned int BackendStop:1;                 // 0: no effect,    1: backend stop
         unsigned int ManualStop:1;                  // 0: no effect,    1: manual stop
-        unsigned int res:28;
+        unsigned int HardResetStop:1;               // 0: no effect,    1: hard reset stop
+        unsigned int SoftResetStop:1;               // 0: no effect,    1: soft reset stop
+        unsigned int InvalidIdStop:1;               // 0: no effect,    1: invalid stop when StopTransactionOnInvalidId is true
+        unsigned int res:25;
     }bits;
 }ChargingStop;
 
@@ -551,9 +565,11 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           OcppReceiptrURL[512];               // Charging receipt display URL
+    unsigned char           isAuthrizeByEVCCID;                 // is Authorize by EVCCID (CCS)
+    unsigned char           MaintainServerURL[512];             // ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
 };
 
 struct ChargingInfoData
@@ -580,6 +596,7 @@ struct ChargingInfoData
 	float PresentChargingCurrent;   // unit: 1A
 	float PresentChargingPower;		//0~6553.5 kW
 	float PresentChargedEnergy;		//0~6553.5 kWh
+	float presentChargedEnergyPeriod[24];       // Session present charged energy at each period
 	int PresentChargedDuration;	// second
 	int RemainChargingDuration;	// second
 	float EvBatteryMaxVoltage;		// 0~6553.5 volt
@@ -654,8 +671,22 @@ struct ChargingInfoData
     unsigned char       PantographFlag;                 // 0: normal gun type,  1: pantograph gun type
     unsigned char       Replug_flag;
     unsigned char       isEVCCIDVerify;
+    unsigned char       CCSGunType;
+    struct timeval      PreChargeTimer;
 };
 
+typedef struct
+{
+    unsigned char       AuthId[32];
+                                                        // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
+    unsigned char       AuthStatus;                     // 3: Authorize done, 4: Authorize end
+    unsigned char       AuthTarget;                     // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
+    unsigned char       AuthType;                       // 0: _AuthType_None,   1: _AuthType_RFID, 2: _AuthType_RemoteStart
+    unsigned char       AuthResult;                     // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    unsigned char       AuthRequest;                    // 0: no request, 1: authorize request
+    unsigned char       res;
+}AuthorizingInfoData;
+
 typedef union
 {
     unsigned int SettingValue;
@@ -666,7 +697,6 @@ typedef union
         unsigned int DispenserConfigSync:1;             // 0: not synced,   1: synced
         unsigned int MiscNeedAnnouncement:1;            // 0: no need,      1: need send misc command
         unsigned int NeedDispenserVerInfo:1;            // 0: no need,      1: need dispenser to report it's version info
-        unsigned int EnableAutoGunSelection:1;          // 0: disable,      1: enable auto gun selection
         unsigned int AuthorizeRequest:1;                // 0: idle,         1: requesting                           ( dispenser -> cabinet)
         unsigned int ConnectorTimeoutConfigRequest:1;   // 0: no request,   1: connector timeout setting            (    ocpp   -> cabinet -> dispenser)
         unsigned int DefaultPriceConfigRequest:1;       // 0: no request,   1: default price setting                (    ocpp   -> cabinet -> dispenser)
@@ -686,6 +716,7 @@ typedef union
         unsigned int StopButtonStatusRequest:1;         // 0: no request,   1: stop charging button status has changed          ( cabinet -> dispenser)
         unsigned int AuthModeConfigRequest:1;           // 0: no request,   1: AuthMode Config has changed                      ( cabinet -> dispenser)
         unsigned int EVCCIDConfigRequest:1;             // 0: no request,   1: EVCCID Config has changed                        ( cabinet -> dispenser)
+        unsigned int LEDIntensityRequest:1;             // 0: no request,   1: LED Intensity has changed                        ( cabinet -> dispenser)
         unsigned int res:7;
     }bits;
 }DispenserSettingFlag;
@@ -723,11 +754,7 @@ struct DispenserModule
     unsigned char   Connector2FwRev[32];        //Connector2 module firmware version
     struct   LED    LedInfo;                    // LED configuration info
 
-                                                // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
-    unsigned char           AuthStatus;         // 3: Authorize done, 4: Authorize end
-    unsigned char           AuthTarget;         // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
-    unsigned char           AuthType;           // 0: _AuthType_None, 1: _AuthType_RFID, 2: _AuthType_RemoteStart
-    unsigned char           AuthResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData     AuthInfo;
     DispenserSettingFlag    Setting;
     char                    FwFileName[128];
     unsigned char           ConnectionChannel;
@@ -808,7 +835,8 @@ typedef union
         unsigned int  FaultStatusRequest:1;
         unsigned int  Disconnection:1;
         unsigned int  GfdDetection:1;                   // 0: stop,         1: start
-        unsigned int  res:9;
+        unsigned int  GetStartChargingSoc:1;            // 0: no effect,    1: get start soc
+        unsigned int  res:8;
     }bits;
 }ConnectorParameter;
 
@@ -820,8 +848,7 @@ struct ConnectorInfoData
     unsigned char ParentDispensetIndex;                 // Parent Dispenser Index: 0 ~ 3
     ConnectorParameter       Parameter;
 
-    unsigned char            AuthorizingType;
-    unsigned char            AuthorizingResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData      AuthInfo;
     struct ChargingInfoData  GeneralChargingData;
     struct WARNING_CODE_INFO WarningInfo;
 
@@ -840,8 +867,11 @@ struct ConnectorInfoData
 
     unsigned short          MaxTotalChargingCurrent;        // max total output current, unit: 0.1A
     unsigned short          MaxTotalChargingPower;          // max total output power, unit: 0.1kw
-    unsigned short          MaxOutputEnergy;                //0: no limit,  1 ~ 65535   kWh
-    unsigned short          MaxOutputDuration;              //0: no limit,  1 ~ 65535   minutes
+    unsigned short          MaxOutputEnergy;                // 0: no limit,  1 ~ 65535   kWh
+    unsigned short          MaxOutputDuration;              // 0: no limit,  1 ~ 65535   minutes
+    float                   CapabilityVoltage;              // unit 0.1V
+    float                   CapabilityCurrent;              // unit 0.1A
+    float                   CapabilityPower;                // unit 0.1kW
 
     unsigned int            UserPrice;                      // connector user's user price, unit: 0.01 (dollar / kWh)
     unsigned int            TotalCost;                      // connector user's total cost, unit: 0.01 dollar
@@ -853,14 +883,11 @@ typedef union
     unsigned int SettingValue;
     struct
     {
-        unsigned int StartAuthorize:1;          // 0: idle,    1: authorizing
-        unsigned int AuthorizingCompleted:1;    // 0: not yet, 1: authorizing completed
         unsigned int DispenserDisconnection:1;  // 0: no connection,  1: dispenser connected
-        unsigned int BackendAuthorized:1;       // 0: local authorized, 1: backend authorized
         unsigned int FlashConfigChanged:1;      // 0: no effect, 1: flash config has changed
         unsigned int EnableWriteFlash:1;        // 0: no effect, 1: enable to write flash after timeout
         unsigned int CleanWiringInfo:1;         // 0: no effect, 1: clean wiring info
-        unsigned int res:25;
+        unsigned int res:28;
     }bits;
 }CabinetSettingFlag;
 
@@ -943,7 +970,7 @@ struct SysInfoData
 	unsigned char 		InternetConn;					//0: disconnected, 1: connected
 	/**************Backend***************/
 	unsigned char 		OcppConnStatus;					//0: disconnected, 1: connected
-	unsigned char 		MaintainServerConnStatus;		//0: disconnected, 1: connected
+    unsigned char       MaintainServerConnStatus;       //0: disconnected, 1: connected
 	char 				OrderCharging;
     float               MaxChargingProfilePower;        // unit: 1W
 	/**************Alston***************/
@@ -986,7 +1013,7 @@ struct SysInfoData
     CabinetMiscCommand      CabinetMicsStatus;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     DC_Meter_Info DcMeterInfo[4];
-    unsigned char           OTPTemp;                    // OTP Temperature 
+    unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
 };
 
@@ -1112,8 +1139,8 @@ char FaultStatusCode[40][6]=
 	"011036",	//Rotary switch fault
 	"011037",	//CCS liquid chiller water level fault
 	"011038",	//Chiller temperature sensor broken
-	"011039",	//Reserved
-	"011040"	//Reserved
+	"011039",	//Parallel relay welding
+	"011040"	//Parallel output relay driving fault
 };
 */
 
@@ -1168,7 +1195,8 @@ struct FaultCodeData
 			unsigned char RotarySwitchFault:1;					//bit 3 
 			unsigned char CcsLiquidChillerWaterLevelFault:1;    //bit 4
             unsigned char ChillerTempSensorBroken:1;            //bit 5
-            unsigned char :2;                                   //bit 6 ~ 7 reserved
+            unsigned char ParallelRelayWelding:1;               //bit 6
+            unsigned char ParallelRelayDriving:1;               //bit 7
 		}bits;
 	}FaultEvents;
 };
@@ -1303,8 +1331,8 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // reserved
-    "012328",   // reserved
+    "012327",   // DC input ovp
+    "012328",   // DC input uvp
     "012329",   // reserved
     "012330",   // reserved
     "012331",   // reserved
@@ -1489,9 +1517,10 @@ struct AlarmCodeData
             unsigned char AbnormalVoltageOnOutputLine_1:1;          //bit 4
             unsigned char AbnormalVoltageOnOutputLine_2:1;          //bit 5
             unsigned char SystemTaskLost:1;                         //bit 6
-            unsigned char Reserved:1;                               //bit 7
+            unsigned char DcInputOVP:1;                             //bit 7
             //AlarmVal[16]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char DcInputUVP:1;                             //bit 0
+            unsigned char :7;                                       //reserved bit 1 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -4264,7 +4293,7 @@ struct StructDataTransfer
 	unsigned char MessageId[52];
 	unsigned char Data[512];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];
+	unsigned char ResponseData[512];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4383,7 +4412,7 @@ struct OCPP16ConfigurationItem
 {
 	unsigned char 		ItemName[64];
 	unsigned char 		ItemAccessibility;//0:RO, 1:RW
-	unsigned char 		ItemData[500];
+	unsigned char 		ItemData[501];//value should be limited in 500 bytes
 };
 
 struct OCPP16ConfigurationTable
@@ -4563,9 +4592,9 @@ struct StructSignedFirmwareStatusNotification
 
 struct StructSessionTarget
 {
-	unsigned char		targetSoc;			// Unit: %,   		0 is unlimit
-	unsigned short		targetEnergy;		// Unit: KWH		0 is unlimit
-	unsigned short		targetDuration;		// Unit: Minutes	0 is unlimit
+    unsigned char       targetSoc;          // Unit: %,         0 is unlimit
+    unsigned short      targetEnergy;       // Unit: KWH        0 is unlimit
+    unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
 struct OCPP16Data
@@ -4756,7 +4785,7 @@ struct OCPP16Data
     struct StructSecurityEventNotification          SecurityEventNotification;
     struct StructSignCertificate                    SignCertificate;
     struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget	                    SessionTarget[CONNECTOR_QUANTITY];
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
 };
 
 

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

@@ -1431,7 +1431,8 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
         pConnState->State = CONN_ST_PREPARING;    //preparing
     } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
         pConnState->State = CONN_ST_CHARGING;    //charging
-    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING) {
+    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING ||
+            pDcChargingInfo->SystemStatus == S_COMPLETE) {
         pConnState->State = CONN_ST_TERMINATING;    //terminating
     } else if ((pDcChargingInfo->SystemStatus == S_ALARM) ||
                (pDcChargingInfo->SystemStatus == S_FAULT)) {

+ 2 - 1
EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -417,7 +417,8 @@ void CANReceiver(int fd)
                         (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
                          pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1)
                    ) {
-                    if (pDcChargingInfo->EvBatteryStartSoc <= 0) {
+                    if (pDcChargingInfo->EvBatteryStartSoc <= 0 &&
+                            pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE) {
                         pDcChargingInfo->EvBatteryStartSoc = frame.data[1];
                     }
 

+ 75 - 6
EVSE/Projects/DD360ComBox/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -16,7 +16,7 @@
 #include "../Define/define.h"
 #include "../Config.h"
 #include "../SelectGun/SelectGun.h"
-
+#include "../CSU/main.h"
 //------------------------------------------------------------------------------
 //struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 //struct StatusCodeData           *ShmStatusCodeData;
@@ -215,7 +215,7 @@ uint8_t _logo_cmp               = 62;
 uint8_t _battery_eng_trp_map    = 63;
 uint8_t _money_trp_map          = 64;
 uint8_t _elapse_time_trp_map    = 65;
-
+#if defined DD360Audi
 ////For Audi
 uint8_t _left_gun_disable_map   = 66;
 uint8_t _left_gun_enable_map    = 67;
@@ -240,7 +240,18 @@ uint8_t _showselectgun_right    = 78;
 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;
+
+uint8_t _show_handshark_dark    = 67;
+uint8_t _show_handshark_light   = 68;
+uint8_t _show_GFD_dark          = 69;
+uint8_t _show_GFD_light         = 70;
+uint8_t _show_precharge_dark    = 71;
+uint8_t _show_precharge_light   = 72;
+#endif
 //#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -880,7 +891,7 @@ void GetTimespecFunc(struct timespec *time)
 {
     clock_gettime(CLOCK_MONOTONIC_COARSE, time);
 }
-
+#if defined DD360Audi
 void RunReplugStringFunction(bool isRun)
 {
     if (isRun) {
@@ -918,7 +929,7 @@ void RunFullTargetFunction(bool isRun)
         ChangeDisplay2Value(__show_StatusString_value_2, _disappear);
     }
 }
-
+#endif
 /**
  * [ChangeBalanceValue :print balance information]
  * @Author
@@ -1739,6 +1750,40 @@ void InformationShow()
     }
 }
 
+void showPhihongLogo(bool _show)
+{
+    /*
+    if( pSysConfig->ModelName[3] == 'U' ) {
+        if (pSysConfig->ModelName[12] == 'P' && pSysConfig->ModelName[13] == 'H') {
+            ChangeDisplay2Value(_logo, _disappear);
+            ChangeDisplay2Value(_logo_cmp, _disappear);
+        }
+    }
+    */
+    if (!_show) {
+        ChangeDisplay2Value(_logo, _disappear);
+        ChangeDisplay2Value(_logo_cmp, _disappear);
+    }
+}
+unsigned long GetPreChargeTimeoutValue(struct timeval _sour_time)
+{
+    struct timeval _end_time;
+    gettimeofday(&_end_time, NULL);
+
+    return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
+}
+
+void ChangeTimeValue(uint8_t time)
+{
+    uint8_t cmd[2];
+    uint8_t value[2];
+
+    memset(cmd, 0x00, sizeof(cmd));
+    sprintf((char *) value, "%d", time);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
+}
+
 void ProcessPageInfo()
 {
     _page_reload = IsPageReloadChk();
@@ -1756,7 +1801,7 @@ void ProcessPageInfo()
             ChangeDisplay2Value(__sel_gun_btn, _disappear);
         }
     }
-
+    showPhihongLogo(false);
     switch (_currentPage) {
 #if defined DD360Audi
     case _LCM_SELECT_GUN: ////For Audi
@@ -2040,6 +2085,30 @@ 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;
+                    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) {
+                        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);
+                    } 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);
+                    } else {
+                        ChangeDisplay2Value(__show_handshark_value, _disappear);
+                        ChangeDisplay2Value(__show_GFD_value, _disappear);
+                        ChangeDisplay2Value(__show_precharge_value, _disappear);
+                    }
                 }
             } else if (_currentPage == _LCM_CHARGING && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {

BIN
EVSE/Projects/DD360ComBox/Apps/Module_ChkSysTask


BIN
EVSE/Projects/DD360ComBox/Apps/Module_DoComm


BIN
EVSE/Projects/DD360ComBox/Apps/Module_EvComm


BIN
EVSE/Projects/DD360ComBox/Apps/Module_EventLogging


BIN
EVSE/Projects/DD360ComBox/Apps/Module_InternalComm


BIN
EVSE/Projects/DD360ComBox/Apps/Module_UpdateFW


+ 2 - 0
EVSE/Projects/DD360ComBox/Apps/Script/copy_from_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

+ 2 - 0
EVSE/Projects/DD360ComBox/Apps/Script/copy_to_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/* /mnt/d/Phihong/Project/DD360Audi/Apps/

BIN
EVSE/Projects/DD360ComBox/Apps/UnsafetyOutputTask


BIN
EVSE/Projects/DD360ComBox/Apps/main


BIN
EVSE/Projects/DD360Tcci/Images/FactoryDefaultConfig.bin


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


+ 10 - 0
EVSE/Projects/DD360Tcci/output/SearchIP.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+# 用 arping 來 ping 區域網路中所有的 IP 位址
+echo $0;
+
+for ip in "$1".{1..254}; do
+  arping -I "$0" -w 3 -f $ip | grep reply &;
+done
+
+# 等待所有背景的 arping 結束
+wait;

BIN
EVSE/Projects/DD360Tcci/output/UnsafetyOutputTask


+ 15 - 0
EVSE/Projects/DD360Tcci/output/init.sh

@@ -0,0 +1,15 @@
+chmod 777 Module_CSU
+chmod 777 Module_PrimaryComm
+chmod 777 Module_LcmControl
+chmod 777 Module_InternalComm
+chmod 777 Module_EventLogging
+chmod 777 Module_EvComm
+chmod 777 Module_PsuComm
+chmod 777 Module_UpdateFW
+chmod 777 Module_ChkSysTask
+chmod 777 OcppBackend
+chmod 777 kill.sh
+chmod 777 ReadCmdline
+chmod 777 Module_DoComm
+chmod 777 SearchIP.sh
+chmod 777 FactoryConfig

+ 47 - 0
EVSE/Projects/DD360Tcci/output/kill.sh

@@ -0,0 +1,47 @@
+pkill Module_CSU;
+pkill Module_PrimaryComm;
+pkill Module_LcmControl;
+pkill Module_InternalComm;
+pkill Module_EventLogging;
+pkill Module_EvComm;
+pkill Module_PsuComm;
+pkill Module_UpdateFW;
+pkill Module_ChkSysTask;
+pkill Module_4g;
+pkill Module_Wifi;
+pkill OcppBackend;
+pkill Module_ProduceUtils;
+pkill Module_DoComm;
+pkill main;
+
+/usr/bin/fuser -k /dev/watchdog
+sleep 1
+
+echo V > /dev/watchdog
+
+ipcrm -M 0x000003e9;
+ipcrm -M 0x000003ed;
+ipcrm -M 0x000003ea;
+ipcrm -M 0x000003ec;
+ipcrm -M 0x000003ee;
+ipcrm -M 0x000003ef;
+ipcrm -M 0x000003f0;
+ipcrm -M 0x000003f3;
+ipcrm -M 0x000003f1;
+ipcrm -M 0x000003f6;
+
+ipcrm -M 0x000003e9;
+ipcrm -M 0x000003ed;
+ipcrm -M 0x000003ea;
+ipcrm -M 0x000003ec;
+ipcrm -M 0x000003ee;
+ipcrm -M 0x000003ef;
+ipcrm -M 0x000003f0;
+ipcrm -M 0x000003f3;
+ipcrm -M 0x000003f1;
+ipcrm -M 0x000003f6;
+ipcrm -M 0x000003eb;
+ipcrm -M 0x000003f2;
+ipcrm -M 0x000007d2;
+
+ipcs;

BIN
EVSE/Projects/DD360Tcci/output/main


BIN
EVSE/Projects/DD360Tcci/output/simulation


+ 1 - 0
EVSE/Projects/DD360Tcci/output/web.sh

@@ -0,0 +1 @@
+/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf  -m /lib

BIN
EVSE/Projects/DD360UCar/Images/FactoryDefaultConfig.bin


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


BIN
EVSE/Projects/DD360UCar/output/FactoryConfig


BIN
EVSE/Projects/DD360UCar/output/Module_ChkSysTask


BIN
EVSE/Projects/DD360UCar/output/Module_DoComm


BIN
EVSE/Projects/DD360UCar/output/Module_EvComm


BIN
EVSE/Projects/DD360UCar/output/Module_EventLogging


BIN
EVSE/Projects/DD360UCar/output/Module_InternalComm


BIN
EVSE/Projects/DD360UCar/output/Module_LcmControl


BIN
EVSE/Projects/DD360UCar/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360UCar/output/Module_UpdateFW


Some files were not shown because too many files changed in this diff