Browse Source

[Improve][AW-CCS][main.c]
2022-11-03 / EASON YANG
Action:
1. Improve : QCA7000 close and open timing logic.

File:
1. main.c
Action 1

FIRMWARE VERSINO: B0.63.XX.XXXX.PX

8009 2 years ago
parent
commit
9b73f08a62
1 changed files with 23 additions and 14 deletions
  1. 23 14
      EVSE/Projects/AW-CCS/Apps/main.c

+ 23 - 14
EVSE/Projects/AW-CCS/Apps/main.c

@@ -6114,13 +6114,6 @@ int main(void)
 				{
 					DEBUG_INFO("LED status into power saving...%d\n", getDiffSecNow(startTime[gun_index][TMR_IDX_POWERSAVING_LED_STATUS]));
 					ShmCharger->gun_info[gun_index].isSleepOn = YES;
-
-					// Energy Star logic for qca7000
-					if(ShmCharger->isCcsEnable == ON)
-					{
-						system("echo 0 > /sys/class/gpio/gpio115/value");
-						DEBUG_INFO("QCA7000 into saving mode: Power off. \n");
-					}
 				}
 			}
 			else
@@ -6129,13 +6122,6 @@ int main(void)
 				{
 					DEBUG_INFO("LED status exit power saving...%d\n", getDiffSecNow(startTime[gun_index][TMR_IDX_POWERSAVING_LED_STATUS]));
 					ShmCharger->gun_info[gun_index].isSleepOn = NO;
-
-					// Energy Star logic for qca7000
-					if(ShmCharger->isCcsEnable == ON)
-					{
-						system("echo 1 > /sys/class/gpio/gpio115/value");
-						DEBUG_INFO("QCA7000 exit saving mode: Power on. \n");
-					}
 				}
 			}
 
@@ -6287,6 +6273,29 @@ int main(void)
 				}
 			}
 
+			//==========================================
+			// QCA7000 close and open timing
+			//==========================================
+			if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus > SYS_MODE_BOOTING)
+			{
+				if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) ||
+				   (((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_TERMINATING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_COMPLETE)) && (ShmCharger->gun_info[gun_index].chargingMode != CHARGING_MODE_HLC)))
+				{
+					if((gpio_get_value(GPIO_OUT_RST_QCA) == ON) && (ShmCharger->isCcsEnable))
+					{
+						gpio_set_value(GPIO_OUT_RST_QCA, OFF);
+					}
+				}
+				else
+				{
+					if((gpio_get_value(GPIO_OUT_RST_QCA) == OFF) && (ShmCharger->isCcsEnable))
+					{
+						gpio_set_value(GPIO_OUT_RST_QCA, ON);
+						//sleep(3);
+					}
+				}
+			}
+
 			//==========================================
 			// Connector process
 			//==========================================