瀏覽代碼

[Improve][AW-CCS][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 VERSINO: B0.63.XX.XXXX.PX

8009 2 年之前
父節點
當前提交
11fa3cc86a
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21 0
      EVSE/Projects/AW-CCS/Apps/main.c

+ 21 - 0
EVSE/Projects/AW-CCS/Apps/main.c

@@ -6296,6 +6296,19 @@ int main(void)
 				}
 			}
 
+			//==========================================
+			// Synchronized total power consumption
+			//==========================================
+			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount==1)
+				ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
+			else
+			{
+				ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
+				//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[0] = (ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/10000.0);
+				//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[1] = (ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/10000.0);
+				//ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption[2] = (ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/10000.0);
+			}
+
 			//==========================================
 			// Connector process
 			//==========================================
@@ -6396,6 +6409,11 @@ int main(void)
 
 							system ("pkill OcppBackend");
 						}
+						else
+						{
+							system ("pkill OcppBackend");
+							DEBUG_INFO("Initialization: Kill OcppBackend task. \n");
+						}
 
 						// If rotate switch equal zero, the system needs to change Debug mode
 						if(ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch == 0)
@@ -6441,6 +6459,9 @@ int main(void)
 						// Refresh PTB resend timer
 						if(ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'P')
 							refreshStartTimer(&startTime[gun_index][TMR_IDX_PTB_METER_SEND]);
+
+						DEBUG_INFO("System memory power consumption: %.4f \n",(ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0));
+						DEBUG_INFO("Share memory power consumption: %.4f \n",ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption);
 					}
 
 					break;