Browse Source

2022-01-15 / Wendell
Actions
1. Fix rating current limitation on DD and DX model when power is zero

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX

Wendell 3 years ago
parent
commit
754e958e49
1 changed files with 11 additions and 5 deletions
  1. 11 5
      EVSE/Modularization/Module_RatedCurrent.c

+ 11 - 5
EVSE/Modularization/Module_RatedCurrent.c

@@ -159,12 +159,18 @@ static int keyfromstring(char *key, SymStruct *table, int tableCount)
 }
 
 //------------------------------------------------------------------------------
-static uint16_t defaultRatedCurrent(uint32_t gunType, int powerKey)
+static uint16_t defaultRatedCurrent(uint8_t modelType, uint32_t gunType, int powerKey)
 {
 	uint16_t ret = RC_0A;
 
-	if(powerKey == BADKEY)
-		powerKey = POWER_30W;
+    if (powerKey == BADKEY)
+    {
+        powerKey = POWER_30W;
+        if (modelType == MODEL_DD || modelType == MODEL_DX)
+        {
+            powerKey = POWER_360W;
+        }
+    }
 
     switch (gunType) {
     case GUN_TYPE_J:
@@ -615,7 +621,7 @@ int RatedCurrentParsing(char *pModuleName, void *pDestStruct)
         modelKey = keyfromstring(&model[0], &modelTable[0], sizeof(modelTable) / sizeof(SymStruct));
         reguKey = keyfromstring(&regulation[0], &regulationTable[0], sizeof(regulationTable) / sizeof(SymStruct));
         if ((gunTypeKey = keyfromstring(&gunType[0], &gunTypeTable[0], sizeof(gunTypeTable) / sizeof(SymStruct))) == GUN_TYPE_0) {
-            log_error("Rated Current Parsing the type of gun is none\r\n");
+            //log_error("Rated Current Parsing the type of gun is none\r\n");
             continue;
             //return FAIL;
         }
@@ -624,7 +630,7 @@ int RatedCurrentParsing(char *pModuleName, void *pDestStruct)
         ret = ((modelKey << 24) | (reguKey << 16) | (powerKey << 8) | gunTypeKey);
         ratingCurVal = exchangeRatingCur(ret);
         if (ratingCurVal == RC_0A) {
-            ratingCurVal = defaultRatedCurrent(gunTypeKey, powerKey);
+            ratingCurVal = defaultRatedCurrent(modelKey, gunTypeKey, powerKey);
         }
 
         memset((uint8_t *)&fGunAndVol, 0, sizeof(GunTypeAndVolInfo));