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

2021-01-07 / Simon Xue

Actions
1. ReadCmdline add chiller on/off function.
2. Modify ReadCmdline strchg function.
3. Modify ReadCmdline setfan function.

Files
As the follow commit history

Image Version:1.19.XX.XX.XX
Simon Xue 3 жил өмнө
parent
commit
7db90e0132
45 өөрчлөгдсөн 147 нэмэгдсэн , 48 устгасан
  1. 1 1
      EVSE/Projects/DD360/Apps/CSU/main.c
  2. 2 1
      EVSE/Projects/DD360/Apps/Config.h
  3. 9 3
      EVSE/Projects/DD360/Apps/ModuleChkSysTask/Module_ChkSysTask.c
  4. 0 3
      EVSE/Projects/DD360/Apps/ModuleInternalComm/FanBoard.c
  5. 1 2
      EVSE/Projects/DD360/Apps/ModuleInternalComm/RelayBoard.c
  6. 5 0
      EVSE/Projects/DD360/Apps/ModulePrimary/Module_PrimaryComm.c
  7. BIN
      EVSE/Projects/DD360/Apps/Module_ChkSysTask
  8. BIN
      EVSE/Projects/DD360/Apps/Module_DoComm
  9. BIN
      EVSE/Projects/DD360/Apps/Module_EvComm
  10. BIN
      EVSE/Projects/DD360/Apps/Module_EventLogging
  11. BIN
      EVSE/Projects/DD360/Apps/Module_InternalComm
  12. BIN
      EVSE/Projects/DD360/Apps/Module_UpdateFW
  13. 30 5
      EVSE/Projects/DD360/Apps/ReadCmdline.c
  14. 1 1
      EVSE/Projects/DD360/Apps/Script/copy_from_d.sh
  15. BIN
      EVSE/Projects/DD360/Apps/UnsafetyOutputTask
  16. BIN
      EVSE/Projects/DD360/Apps/main
  17. BIN
      EVSE/Projects/DD360/Images/ramdisk.gz
  18. BIN
      EVSE/Projects/DD360/output/FactoryConfig
  19. BIN
      EVSE/Projects/DD360/output/Module_ChkSysTask
  20. BIN
      EVSE/Projects/DD360/output/Module_DoComm
  21. BIN
      EVSE/Projects/DD360/output/Module_EvComm
  22. BIN
      EVSE/Projects/DD360/output/Module_EventLogging
  23. BIN
      EVSE/Projects/DD360/output/Module_InternalComm
  24. BIN
      EVSE/Projects/DD360/output/Module_LcmControl
  25. BIN
      EVSE/Projects/DD360/output/Module_PrimaryComm
  26. BIN
      EVSE/Projects/DD360/output/Module_UpdateFW
  27. BIN
      EVSE/Projects/DD360/output/ReadCmdline
  28. BIN
      EVSE/Projects/DD360/output/main
  29. BIN
      EVSE/Projects/DD360/output/simulation
  30. 1 1
      EVSE/Projects/DD360Audi/Apps/CSU/main.c
  31. 2 1
      EVSE/Projects/DD360Audi/Apps/Config.h
  32. 9 3
      EVSE/Projects/DD360Audi/Apps/ModuleChkSysTask/Module_ChkSysTask.c
  33. 0 3
      EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/FanBoard.c
  34. 1 2
      EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/RelayBoard.c
  35. 5 0
      EVSE/Projects/DD360Audi/Apps/ModulePrimary/Module_PrimaryComm.c
  36. 30 5
      EVSE/Projects/DD360Audi/Apps/ReadCmdline.c
  37. 1 1
      EVSE/Projects/DD360Audi/Apps/Script/copy_from_d.sh
  38. 1 1
      EVSE/Projects/DD360ComBox/Apps/CSU/main.c
  39. 2 1
      EVSE/Projects/DD360ComBox/Apps/Config.h
  40. 9 3
      EVSE/Projects/DD360ComBox/Apps/ModuleChkSysTask/Module_ChkSysTask.c
  41. 0 3
      EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/FanBoard.c
  42. 1 2
      EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/RelayBoard.c
  43. 5 0
      EVSE/Projects/DD360ComBox/Apps/ModulePrimary/Module_PrimaryComm.c
  44. 30 5
      EVSE/Projects/DD360ComBox/Apps/ReadCmdline.c
  45. 1 1
      EVSE/Projects/DD360ComBox/Apps/Script/copy_from_d.sh

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

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.19.3";
+char* DebugVersion = "v1.19.4";
 //sqlite3 *localDb;
 bool isDb_ready;
 

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

@@ -379,7 +379,8 @@ typedef struct StDcCommonInfo {
     uint8_t TestTemperature; //ReadCmdline test, manual input value
     uint8_t CcsTypeSaved[2];
     PcPsuOutput PcPsuOutput[2];
-    uint8_t Reserved[3];
+    uint8_t chillerCtrl;
+    uint8_t debugflag;
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 9 - 3
EVSE/Projects/DD360/Apps/ModuleChkSysTask/Module_ChkSysTask.c

@@ -24,6 +24,7 @@ struct ChargingInfoData *pAcChargingInfo = NULL;
 static struct ChargingInfoData *pDcChargingInfo = NULL;
 struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 struct StatusCodeData           *ShmStatusCodeData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -226,13 +227,14 @@ void main(void)
         log_error("create share memory error");
         return ;
     }
-
+    MappingGunChargingInfo("CheckSystem Task");
     pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
     pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSysConfigAndInfo = (struct SysConfigAndInfo *)GetShmSysConfigAndInfo();
-    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();	
-    MappingGunChargingInfo("CheckSystem Task");
+    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
+
     while(true)
     {
       	for (uint8_t gun = 0; gun < pSysConfig->TotalConnectorCount; gun++) {
@@ -240,6 +242,10 @@ void main(void)
 			if (pDcChargingInfo->SystemStatus == SYS_MODE_UPDATE )
 				continue;
 		}
+        if (ShmDcCommonData->debugflag == YES) {
+            sleep(3);
+            continue;
+        }
 		CheckSystemTaskAlive();
 		sleep(3);
     }

+ 0 - 3
EVSE/Projects/DD360/Apps/ModuleInternalComm/FanBoard.c

@@ -76,9 +76,6 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
-        return;
-    }
 
     // 風控修改 :
     // ******************************************************* //

+ 1 - 2
EVSE/Projects/DD360/Apps/ModuleInternalComm/RelayBoard.c

@@ -1200,7 +1200,6 @@ static void SetFanModuleSpeed(void)
             _setFanSpeed = ShmFanModuleData->SetFan1Speed;
         }
 
-        //printf("_setFanSpeed = %d \n", _setFanSpeed);
         _fanSpeed.speed[0] = _setFanSpeed;
 
         _fanSpeed.speed[1] = _setFanSpeed;
@@ -1237,7 +1236,7 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
+    if (ShmDcCommonData->debugflag== YES) {
         return;
     }
 

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

@@ -44,6 +44,7 @@ static struct SysInfoData *pSysInfo = NULL;
 static struct AlarmCodeData *pAlarmCode = NULL;
 static struct FaultCodeData *pFaultCode = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 const char *priPortName = "/dev/ttyS1";
 uint8_t gun_count; //DS60-120 add
@@ -419,6 +420,9 @@ static void checkChillerStatus(Gpio_out *gpio)
         }
     }
 
+    if (ShmDcCommonData->debugflag == YES)
+        _chillerNeedOn = ShmDcCommonData->chillerCtrl;
+
     if(_chiller.ChillerSwitch != _chillerNeedOn)
     {
         log_info("Chiller Need Turn %s", _chillerNeedOn == YES ? "ON" : "OFF");
@@ -639,6 +643,7 @@ int main(void)
     pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
     pFaultCode = (struct FaultCodeData *)GetShmFaultCodeData();
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     Uart1Fd = InitComPort();
     //log_info("407 Port id = %d ", Uart1Fd);

BIN
EVSE/Projects/DD360/Apps/Module_ChkSysTask


BIN
EVSE/Projects/DD360/Apps/Module_DoComm


BIN
EVSE/Projects/DD360/Apps/Module_EvComm


BIN
EVSE/Projects/DD360/Apps/Module_EventLogging


BIN
EVSE/Projects/DD360/Apps/Module_InternalComm


BIN
EVSE/Projects/DD360/Apps/Module_UpdateFW


+ 30 - 5
EVSE/Projects/DD360/Apps/ReadCmdline.c

@@ -517,8 +517,12 @@ void GetGunSelectedNum(char *v1)
 void SetFanSpeed(char *v1)
 {
     int speed = atoi(v1);
-
-    ShmFanModuleData->TestFanSpeed = speed;
+    if(ShmDcCommonData->debugflag == YES) {
+        ShmFanModuleData->TestFanSpeed = speed;
+        printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
+    }
+    else
+        printf("Please open debug mode\n");
 }
 
 void GetFanSpeed()
@@ -533,7 +537,8 @@ void SetDebugMode(char *v1)
 {
     int mode = atoi(v1);
 
-    pSysConfig->SwitchDebugFlag = mode;
+    ShmDcCommonData->debugflag = mode;
+    printf("Set Debug Mode:%d\n" , ShmDcCommonData->debugflag);
 }
 
 void SetGFDMode(char *v1)
@@ -717,7 +722,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         printf ("Input Voltage over range\n");
         return;
     }
-
     //kill ev task
     system("killall Module_EvComm");
 
@@ -771,6 +775,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
             //清除 main timeout 機制
             pDcChargingInfo->TimeoutFlag = 0;
+            pSysInfo->SystemTimeoutFlag = 0;
+            pSysInfo->SystemPage = _LCM_NONE;
             //不論是什麼 type 的槍都固意設成 Chademo 不跑 Prechage step
             pDcChargingInfo->Type = 9;
             break;
@@ -941,6 +947,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
             pDcChargingInfo->PresentChargingPower = 0;
 
             if (stopChg == pSysConfig->TotalConnectorCount) {
+
                 system("/root/Module_EvComm &");
                 sleep(3);
 
@@ -1187,7 +1194,17 @@ static void writeOTPTemp(void)
         usleep(sleepTime);
     }//while
 }
-
+void writeChillerStatus(char *v1)
+{
+    if (ShmDcCommonData->debugflag == YES) {
+        ShmDcCommonData->chillerCtrl = atoi(newString[1]);
+        if (ShmDcCommonData->chillerCtrl)
+            printf("Chiller set on\n");
+        else
+            printf("Chiller set off\n");
+    } else
+        printf("Please open Debug mode\n");
+}
 static void writeGunAndChillerTemp(void)
 {
     uint8_t _GunIndex = 0;
@@ -1288,6 +1305,7 @@ int main(void)
                      "       tempW                             : write connector header and Chiller temperature\r\n"
                      "       tempR                             : print connector header and chiller temperature\r\n"
                      "       OTP                               : Write OTP temperature\r\n"
+                     "       chiller                           : set chiller on/off"
                      "\r\n";
 
     if (CreateAllCsuShareMemory() == FAIL) {
@@ -1323,6 +1341,7 @@ int main(void)
 //    }
 
     while (isContinue) {
+
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
         }
@@ -1437,6 +1456,10 @@ int main(void)
             }
             SetChargingInfoCCID(newString[1], newString[2]);
         } else if (strcmp(newString[0], "strchg") == 0) {
+            if (ShmDcCommonData->debugflag == NO ) {
+                printf("Please Open debug mode\n");
+                continue;
+            }
             //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
             if (strcmp(newString[1], "auto") == 0) {
                 newString[2][0] = 0;
@@ -1457,6 +1480,8 @@ int main(void)
             resdGunAndChillerTemp();
         } else if (strcmp(newString[0], "OTP") == 0) { //測試槍頭和水冷機溫度
             writeOTPTemp();
+        } else if (strcmp(newString[0], "chiller") == 0) { //測試槍頭和水冷機溫度
+            writeChillerStatus(newString[1]);
         } else {
             printf("%s\n", usageMsg);
         }

+ 1 - 1
EVSE/Projects/DD360/Apps/Script/copy_from_d.sh

@@ -1,2 +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/
+sudo cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

BIN
EVSE/Projects/DD360/Apps/UnsafetyOutputTask


BIN
EVSE/Projects/DD360/Apps/main


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


BIN
EVSE/Projects/DD360/output/FactoryConfig


BIN
EVSE/Projects/DD360/output/Module_ChkSysTask


BIN
EVSE/Projects/DD360/output/Module_DoComm


BIN
EVSE/Projects/DD360/output/Module_EvComm


BIN
EVSE/Projects/DD360/output/Module_EventLogging


BIN
EVSE/Projects/DD360/output/Module_InternalComm


BIN
EVSE/Projects/DD360/output/Module_LcmControl


BIN
EVSE/Projects/DD360/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360/output/Module_UpdateFW


BIN
EVSE/Projects/DD360/output/ReadCmdline


BIN
EVSE/Projects/DD360/output/main


BIN
EVSE/Projects/DD360/output/simulation


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

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.19.3";
+char* DebugVersion = "v1.19.4";
 //sqlite3 *localDb;
 bool isDb_ready;
 

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

@@ -379,7 +379,8 @@ typedef struct StDcCommonInfo {
     uint8_t TestTemperature; //ReadCmdline test, manual input value
     uint8_t CcsTypeSaved[2];
     PcPsuOutput PcPsuOutput[2];
-    uint8_t Reserved[3];
+    uint8_t chillerCtrl;
+    uint8_t debugflag;
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 9 - 3
EVSE/Projects/DD360Audi/Apps/ModuleChkSysTask/Module_ChkSysTask.c

@@ -24,6 +24,7 @@ struct ChargingInfoData *pAcChargingInfo = NULL;
 static struct ChargingInfoData *pDcChargingInfo = NULL;
 struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 struct StatusCodeData           *ShmStatusCodeData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -226,13 +227,14 @@ void main(void)
         log_error("create share memory error");
         return ;
     }
-
+    MappingGunChargingInfo("CheckSystem Task");
     pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
     pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSysConfigAndInfo = (struct SysConfigAndInfo *)GetShmSysConfigAndInfo();
-    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();	
-    MappingGunChargingInfo("CheckSystem Task");
+    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
+
     while(true)
     {
       	for (uint8_t gun = 0; gun < pSysConfig->TotalConnectorCount; gun++) {
@@ -240,6 +242,10 @@ void main(void)
 			if (pDcChargingInfo->SystemStatus == SYS_MODE_UPDATE )
 				continue;
 		}
+        if (ShmDcCommonData->debugflag == YES) {
+            sleep(3);
+            continue;
+        }
 		CheckSystemTaskAlive();
 		sleep(3);
     }

+ 0 - 3
EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/FanBoard.c

@@ -76,9 +76,6 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
-        return;
-    }
 
     // 風控修改 :
     // ******************************************************* //

+ 1 - 2
EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/RelayBoard.c

@@ -1200,7 +1200,6 @@ static void SetFanModuleSpeed(void)
             _setFanSpeed = ShmFanModuleData->SetFan1Speed;
         }
 
-        //printf("_setFanSpeed = %d \n", _setFanSpeed);
         _fanSpeed.speed[0] = _setFanSpeed;
 
         _fanSpeed.speed[1] = _setFanSpeed;
@@ -1237,7 +1236,7 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
+    if (ShmDcCommonData->debugflag== YES) {
         return;
     }
 

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

@@ -44,6 +44,7 @@ static struct SysInfoData *pSysInfo = NULL;
 static struct AlarmCodeData *pAlarmCode = NULL;
 static struct FaultCodeData *pFaultCode = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 const char *priPortName = "/dev/ttyS1";
 uint8_t gun_count; //DS60-120 add
@@ -419,6 +420,9 @@ static void checkChillerStatus(Gpio_out *gpio)
         }
     }
 
+    if (ShmDcCommonData->debugflag == YES)
+        _chillerNeedOn = ShmDcCommonData->chillerCtrl;
+
     if(_chiller.ChillerSwitch != _chillerNeedOn)
     {
         log_info("Chiller Need Turn %s", _chillerNeedOn == YES ? "ON" : "OFF");
@@ -639,6 +643,7 @@ int main(void)
     pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
     pFaultCode = (struct FaultCodeData *)GetShmFaultCodeData();
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     Uart1Fd = InitComPort();
     //log_info("407 Port id = %d ", Uart1Fd);

+ 30 - 5
EVSE/Projects/DD360Audi/Apps/ReadCmdline.c

@@ -517,8 +517,12 @@ void GetGunSelectedNum(char *v1)
 void SetFanSpeed(char *v1)
 {
     int speed = atoi(v1);
-
-    ShmFanModuleData->TestFanSpeed = speed;
+    if(ShmDcCommonData->debugflag == YES) {
+        ShmFanModuleData->TestFanSpeed = speed;
+        printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
+    }
+    else
+        printf("Please open debug mode\n");
 }
 
 void GetFanSpeed()
@@ -533,7 +537,8 @@ void SetDebugMode(char *v1)
 {
     int mode = atoi(v1);
 
-    pSysConfig->SwitchDebugFlag = mode;
+    ShmDcCommonData->debugflag = mode;
+    printf("Set Debug Mode:%d\n" , ShmDcCommonData->debugflag);
 }
 
 void SetGFDMode(char *v1)
@@ -717,7 +722,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         printf ("Input Voltage over range\n");
         return;
     }
-
     //kill ev task
     system("killall Module_EvComm");
 
@@ -771,6 +775,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
             //清除 main timeout 機制
             pDcChargingInfo->TimeoutFlag = 0;
+            pSysInfo->SystemTimeoutFlag = 0;
+            pSysInfo->SystemPage = _LCM_NONE;
             //不論是什麼 type 的槍都固意設成 Chademo 不跑 Prechage step
             pDcChargingInfo->Type = 9;
             break;
@@ -941,6 +947,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
             pDcChargingInfo->PresentChargingPower = 0;
 
             if (stopChg == pSysConfig->TotalConnectorCount) {
+
                 system("/root/Module_EvComm &");
                 sleep(3);
 
@@ -1187,7 +1194,17 @@ static void writeOTPTemp(void)
         usleep(sleepTime);
     }//while
 }
-
+void writeChillerStatus(char *v1)
+{
+    if (ShmDcCommonData->debugflag == YES) {
+        ShmDcCommonData->chillerCtrl = atoi(newString[1]);
+        if (ShmDcCommonData->chillerCtrl)
+            printf("Chiller set on\n");
+        else
+            printf("Chiller set off\n");
+    } else
+        printf("Please open Debug mode\n");
+}
 static void writeGunAndChillerTemp(void)
 {
     uint8_t _GunIndex = 0;
@@ -1288,6 +1305,7 @@ int main(void)
                      "       tempW                             : write connector header and Chiller temperature\r\n"
                      "       tempR                             : print connector header and chiller temperature\r\n"
                      "       OTP                               : Write OTP temperature\r\n"
+                     "       chiller                           : set chiller on/off"
                      "\r\n";
 
     if (CreateAllCsuShareMemory() == FAIL) {
@@ -1323,6 +1341,7 @@ int main(void)
 //    }
 
     while (isContinue) {
+
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
         }
@@ -1437,6 +1456,10 @@ int main(void)
             }
             SetChargingInfoCCID(newString[1], newString[2]);
         } else if (strcmp(newString[0], "strchg") == 0) {
+            if (ShmDcCommonData->debugflag == NO ) {
+                printf("Please Open debug mode\n");
+                continue;
+            }
             //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
             if (strcmp(newString[1], "auto") == 0) {
                 newString[2][0] = 0;
@@ -1457,6 +1480,8 @@ int main(void)
             resdGunAndChillerTemp();
         } else if (strcmp(newString[0], "OTP") == 0) { //測試槍頭和水冷機溫度
             writeOTPTemp();
+        } else if (strcmp(newString[0], "chiller") == 0) { //測試槍頭和水冷機溫度
+            writeChillerStatus(newString[1]);
         } else {
             printf("%s\n", usageMsg);
         }

+ 1 - 1
EVSE/Projects/DD360Audi/Apps/Script/copy_from_d.sh

@@ -1,2 +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/
+sudo cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

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

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.19.3";
+char* DebugVersion = "v1.19.4";
 //sqlite3 *localDb;
 bool isDb_ready;
 

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

@@ -379,7 +379,8 @@ typedef struct StDcCommonInfo {
     uint8_t TestTemperature; //ReadCmdline test, manual input value
     uint8_t CcsTypeSaved[2];
     PcPsuOutput PcPsuOutput[2];
-    uint8_t Reserved[3];
+    uint8_t chillerCtrl;
+    uint8_t debugflag;
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 9 - 3
EVSE/Projects/DD360ComBox/Apps/ModuleChkSysTask/Module_ChkSysTask.c

@@ -24,6 +24,7 @@ struct ChargingInfoData *pAcChargingInfo = NULL;
 static struct ChargingInfoData *pDcChargingInfo = NULL;
 struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 struct StatusCodeData           *ShmStatusCodeData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -226,13 +227,14 @@ void main(void)
         log_error("create share memory error");
         return ;
     }
-
+    MappingGunChargingInfo("CheckSystem Task");
     pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
     pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSysConfigAndInfo = (struct SysConfigAndInfo *)GetShmSysConfigAndInfo();
-    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();	
-    MappingGunChargingInfo("CheckSystem Task");
+    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
+
     while(true)
     {
       	for (uint8_t gun = 0; gun < pSysConfig->TotalConnectorCount; gun++) {
@@ -240,6 +242,10 @@ void main(void)
 			if (pDcChargingInfo->SystemStatus == SYS_MODE_UPDATE )
 				continue;
 		}
+        if (ShmDcCommonData->debugflag == YES) {
+            sleep(3);
+            continue;
+        }
 		CheckSystemTaskAlive();
 		sleep(3);
     }

+ 0 - 3
EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/FanBoard.c

@@ -76,9 +76,6 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
-        return;
-    }
 
     // 風控修改 :
     // ******************************************************* //

+ 1 - 2
EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/RelayBoard.c

@@ -1200,7 +1200,6 @@ static void SetFanModuleSpeed(void)
             _setFanSpeed = ShmFanModuleData->SetFan1Speed;
         }
 
-        //printf("_setFanSpeed = %d \n", _setFanSpeed);
         _fanSpeed.speed[0] = _setFanSpeed;
 
         _fanSpeed.speed[1] = _setFanSpeed;
@@ -1237,7 +1236,7 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
+    if (ShmDcCommonData->debugflag== YES) {
         return;
     }
 

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

@@ -44,6 +44,7 @@ static struct SysInfoData *pSysInfo = NULL;
 static struct AlarmCodeData *pAlarmCode = NULL;
 static struct FaultCodeData *pFaultCode = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 const char *priPortName = "/dev/ttyS1";
 uint8_t gun_count; //DS60-120 add
@@ -419,6 +420,9 @@ static void checkChillerStatus(Gpio_out *gpio)
         }
     }
 
+    if (ShmDcCommonData->debugflag == YES)
+        _chillerNeedOn = ShmDcCommonData->chillerCtrl;
+
     if(_chiller.ChillerSwitch != _chillerNeedOn)
     {
         log_info("Chiller Need Turn %s", _chillerNeedOn == YES ? "ON" : "OFF");
@@ -639,6 +643,7 @@ int main(void)
     pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
     pFaultCode = (struct FaultCodeData *)GetShmFaultCodeData();
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     Uart1Fd = InitComPort();
     //log_info("407 Port id = %d ", Uart1Fd);

+ 30 - 5
EVSE/Projects/DD360ComBox/Apps/ReadCmdline.c

@@ -517,8 +517,12 @@ void GetGunSelectedNum(char *v1)
 void SetFanSpeed(char *v1)
 {
     int speed = atoi(v1);
-
-    ShmFanModuleData->TestFanSpeed = speed;
+    if(ShmDcCommonData->debugflag == YES) {
+        ShmFanModuleData->TestFanSpeed = speed;
+        printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
+    }
+    else
+        printf("Please open debug mode\n");
 }
 
 void GetFanSpeed()
@@ -533,7 +537,8 @@ void SetDebugMode(char *v1)
 {
     int mode = atoi(v1);
 
-    pSysConfig->SwitchDebugFlag = mode;
+    ShmDcCommonData->debugflag = mode;
+    printf("Set Debug Mode:%d\n" , ShmDcCommonData->debugflag);
 }
 
 void SetGFDMode(char *v1)
@@ -717,7 +722,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         printf ("Input Voltage over range\n");
         return;
     }
-
     //kill ev task
     system("killall Module_EvComm");
 
@@ -771,6 +775,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
             //清除 main timeout 機制
             pDcChargingInfo->TimeoutFlag = 0;
+            pSysInfo->SystemTimeoutFlag = 0;
+            pSysInfo->SystemPage = _LCM_NONE;
             //不論是什麼 type 的槍都固意設成 Chademo 不跑 Prechage step
             pDcChargingInfo->Type = 9;
             break;
@@ -941,6 +947,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
             pDcChargingInfo->PresentChargingPower = 0;
 
             if (stopChg == pSysConfig->TotalConnectorCount) {
+
                 system("/root/Module_EvComm &");
                 sleep(3);
 
@@ -1187,7 +1194,17 @@ static void writeOTPTemp(void)
         usleep(sleepTime);
     }//while
 }
-
+void writeChillerStatus(char *v1)
+{
+    if (ShmDcCommonData->debugflag == YES) {
+        ShmDcCommonData->chillerCtrl = atoi(newString[1]);
+        if (ShmDcCommonData->chillerCtrl)
+            printf("Chiller set on\n");
+        else
+            printf("Chiller set off\n");
+    } else
+        printf("Please open Debug mode\n");
+}
 static void writeGunAndChillerTemp(void)
 {
     uint8_t _GunIndex = 0;
@@ -1288,6 +1305,7 @@ int main(void)
                      "       tempW                             : write connector header and Chiller temperature\r\n"
                      "       tempR                             : print connector header and chiller temperature\r\n"
                      "       OTP                               : Write OTP temperature\r\n"
+                     "       chiller                           : set chiller on/off"
                      "\r\n";
 
     if (CreateAllCsuShareMemory() == FAIL) {
@@ -1323,6 +1341,7 @@ int main(void)
 //    }
 
     while (isContinue) {
+
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
         }
@@ -1437,6 +1456,10 @@ int main(void)
             }
             SetChargingInfoCCID(newString[1], newString[2]);
         } else if (strcmp(newString[0], "strchg") == 0) {
+            if (ShmDcCommonData->debugflag == NO ) {
+                printf("Please Open debug mode\n");
+                continue;
+            }
             //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
             if (strcmp(newString[1], "auto") == 0) {
                 newString[2][0] = 0;
@@ -1457,6 +1480,8 @@ int main(void)
             resdGunAndChillerTemp();
         } else if (strcmp(newString[0], "OTP") == 0) { //測試槍頭和水冷機溫度
             writeOTPTemp();
+        } else if (strcmp(newString[0], "chiller") == 0) { //測試槍頭和水冷機溫度
+            writeChillerStatus(newString[1]);
         } else {
             printf("%s\n", usageMsg);
         }

+ 1 - 1
EVSE/Projects/DD360ComBox/Apps/Script/copy_from_d.sh

@@ -1,2 +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/
+sudo cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/