Преглед изворни кода

[Improve][AW-Regular][Module_InternalComm.c][main.c]
2022-05-04 / EASON YANG
Action
1. Improve: Module_InternalComm.c log print logic.
2. Improve: main.c. Power reset logic for 4G/WIFI. Dose not need to reset when WIFI/4G is disable.

File
1. Module_InternalComm.c
Action 1

2. main.c
Action 2

FIRMWARE VERSION: V0.71.XX.XXXX.PX

8009 пре 2 година
родитељ
комит
50ce2ad5f0

+ 2 - 6
EVSE/Projects/AW-Regular/Apps/Module_InternalComm.c

@@ -1825,8 +1825,6 @@ int main(void)
 				//===============================
 				if((previous_gun_info[gun_index].primaryMcuState.cp_state != ShmCharger->gun_info[gun_index].primaryMcuState.cp_state) ||
 				   (previous_gun_info[gun_index].primaryMcuState.current_limit != ShmCharger->gun_info[gun_index].primaryMcuState.current_limit) ||
-				   (previous_gun_info[gun_index].primaryMcuState.cp_voltage_positive != ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_positive) ||
-				   (previous_gun_info[gun_index].primaryMcuState.cp_voltage_negtive != ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_negtive) ||
 				   (previous_gun_info[gun_index].primaryMcuState.relay_state != ShmCharger->gun_info[gun_index].primaryMcuState.relay_state) ||
 				   (previous_gun_info[gun_index].primaryMcuState.rating_current != ShmCharger->gun_info[gun_index].primaryMcuState.rating_current) ||
 				   (previous_gun_info[gun_index].primaryMcuState.rotatory_switch != ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch))
@@ -1851,8 +1849,6 @@ int main(void)
 
 					previous_gun_info[gun_index].primaryMcuState.cp_state = ShmCharger->gun_info[gun_index].primaryMcuState.cp_state;
 				    previous_gun_info[gun_index].primaryMcuState.current_limit = ShmCharger->gun_info[gun_index].primaryMcuState.current_limit;
-				    previous_gun_info[gun_index].primaryMcuState.cp_voltage_positive = ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_positive;
-				    previous_gun_info[gun_index].primaryMcuState.cp_voltage_negtive = ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_negtive;
 				    previous_gun_info[gun_index].primaryMcuState.relay_state = ShmCharger->gun_info[gun_index].primaryMcuState.relay_state;
 				    previous_gun_info[gun_index].primaryMcuState.rating_current = ShmCharger->gun_info[gun_index].primaryMcuState.rating_current;
 				    previous_gun_info[gun_index].primaryMcuState.rotatory_switch = ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch;
@@ -1893,7 +1889,7 @@ int main(void)
 				//===============================
 				// Query present output current
 				//===============================
-				if(previous_gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0])
+				if((int)previous_gun_info[gun_index].outputCurrent.L1N_L12[0] != (int)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0])
 				{
 					DEBUG_INFO("**************************************************\n");
 					DEBUG_INFO("********* High priority polling : Case 5 *********\n");
@@ -1947,7 +1943,7 @@ int main(void)
 				//==========================================================
 				// Low priority polling log print out
 				//==========================================================
-				if(previous_gun_info[gun_index].inputVoltage.L1N_L12 != ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12)
+				if((int)previous_gun_info[gun_index].inputVoltage.L1N_L12 != (int)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12)
 				{
 					DEBUG_INFO("==================================================\n");
 					DEBUG_INFO("======== Normal priority polling : Case 1 ========\n");

+ 9 - 5
EVSE/Projects/AW-Regular/Apps/main.c

@@ -2213,10 +2213,14 @@ void InitEthernet()
 			{
 				if(DiffTimebWithNow(startTime[0][TMR_IDX_RESET_4G_WIFI_POWER]) > TIMEOUT_SPEC_RESET_4G_WIFI_POWER)
 				{
-					DEBUG_WARN("WIFI/4G module reset.\n");
-					system("echo 1 > /sys/class/gpio/gpio110/value");
-					sleep(3);
-					system("echo 0 > /sys/class/gpio/gpio110/value");
+					if((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode != 0) || (ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled != 0))
+					{
+						DEBUG_WARN("WIFI/4G module reset.\n");
+						system("echo 1 > /sys/class/gpio/gpio110/value");
+						sleep(3);
+						system("echo 0 > /sys/class/gpio/gpio110/value");
+					}
+
 					ftime(&startTime[0][TMR_IDX_RESET_4G_WIFI_POWER]);
 				}
 			}
@@ -2468,7 +2472,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "V0.70.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "V0.71.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)