Pārlūkot izejas kodu

[Bug fixed][DM30][DW30][General]: Fixed AC index assign when connector type check will make share memory read failure

2020.06.22 / TC Hsu

Actions: Add if detection, the AC gun index assign should checkout the AC index > 0.

Image version    : N/A
Image checksum   : N/A

Hardware PWB P/N : N/A
Hardware Version : N/A

Files:

	modified:   EVSE/Projects/DW30/Apps/main.c
	modified:   EVSE/Projects/DM30/Apps/main.c
TC_Hsu 4 gadi atpakaļ
vecāks
revīzija
25fe3b5aeb
2 mainītis faili ar 16 papildinājumiem un 2 dzēšanām
  1. 8 1
      EVSE/Projects/DM30/Apps/main.c
  2. 8 1
      EVSE/Projects/DW30/Apps/main.c

+ 8 - 1
EVSE/Projects/DM30/Apps/main.c

@@ -3016,7 +3016,14 @@ bool CheckConnectorTypeStatus()
         }
 
         // AC index 接在 DC 後面
-        ac_chargingInfo[0]->Index += _gunIndex;
+        if(_ac_Index > 0)
+        {
+            for (int acCurIndex = 0; acCurIndex < _acgunIndex; acCurIndex++)
+            {
+                // AC index 接在 DC 後面
+                ac_chargingInfo[acCurIndex]->Index += _gunIndex;
+            }
+        }
 
         ShmSysConfigAndInfo->SysConfig.TotalConnectorCount = _gunIndex;
         ShmSysConfigAndInfo->SysConfig.AcConnectorCount = _acgunIndex;

+ 8 - 1
EVSE/Projects/DW30/Apps/main.c

@@ -3016,7 +3016,14 @@ bool CheckConnectorTypeStatus()
         }
 
         // AC index 接在 DC 後面
-        ac_chargingInfo[0]->Index += _gunIndex;
+        if(_ac_Index > 0)
+        {
+            for (int acCurIndex = 0; acCurIndex < _acgunIndex; acCurIndex++)
+            {
+                // AC index 接在 DC 後面
+                ac_chargingInfo[acCurIndex]->Index += _gunIndex;
+            }
+        }
 
         ShmSysConfigAndInfo->SysConfig.TotalConnectorCount = _gunIndex;
         ShmSysConfigAndInfo->SysConfig.AcConnectorCount = _acgunIndex;