Browse Source

[Improve][AW-Regular][main.c]
2022-11-09 / EASON YANG
Action:
1.Improve: Synchronized total power consumption.
2.Improve: Kill ocpp task when system under booting up.

File:
1. main.c
Action 1
Action 2

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

8009 2 years ago
parent
commit
fb1fba5d06
1 changed files with 13 additions and 0 deletions
  1. 13 0
      EVSE/Projects/AW-Regular/Apps/main.c

+ 13 - 0
EVSE/Projects/AW-Regular/Apps/main.c

@@ -4615,6 +4615,11 @@ int main(void)
 			//==========================================
 			checkUnlocker(gun_index);
 
+			//==========================================
+			// Synchronized total power consumption
+			//==========================================
+			ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100.0);
+
 			//==========================================
 			// Connector process
 			//==========================================
@@ -4676,6 +4681,11 @@ int main(void)
 							DEBUG_INFO("URL is empty kill Module_OcppBackend...\n");
 							system("pkill OcppBackend");
 						}
+						else
+						{
+							DEBUG_INFO("Initialization: Kill OcppBackend task. \n");
+							system ("pkill OcppBackend");
+						}
 
 						// If rotate switch equal zero, the system needs to change Debug mode
 						if(ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch == 0)
@@ -4694,6 +4704,9 @@ int main(void)
 								setChargerMode(gun_index, SYS_MODE_MAINTAIN);
 							}
 						}
+
+						DEBUG_INFO("System memory power consumption: %.4f \n", (ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100.0));
+						DEBUG_INFO("Share memory power consumption: %.4f \n",ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption);
 					}
 
 					break;