Pārlūkot izejas kodu

[Improve][AW-CCS][Module_InternalComm.c]
Action
1.Improve : Print out log.

File
1. Module_InternalComm.c
Action 1

FIRMWARE VERSION: B0.61.XX.XXXX.PX

8009 3 gadi atpakaļ
vecāks
revīzija
27d14f6cc1
1 mainītis faili ar 39 papildinājumiem un 30 dzēšanām
  1. 39 30
      EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

+ 39 - 30
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -2399,6 +2399,28 @@ int main(void)
 						previousCharger.gun_info[gun_index].primaryMcuAlarm.InputAlarmCode = ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode;
 					}
 
+					//===============================
+					// Query primary Out put current config
+					//===============================
+					if((previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]) ||
+					   (previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] != ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]) ||
+					   (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
+					{
+						DEBUG_INFO("===========================================\n");
+						DEBUG_INFO("===== High priority polling : Case 11 =====\n");
+						DEBUG_INFO("===========================================\n");
+						DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
+						if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
+						{
+							DEBUG_INFO("MCU-%d get output current L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]);
+							DEBUG_INFO("MCU-%d get output current L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]);
+						}
+
+						previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] = ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
+						previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] = ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
+						previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] = ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
+					}
+
 					//===============================
 					// Query primary MCU BLE config
 					//===============================
@@ -2440,28 +2462,6 @@ int main(void)
 						memcpy(&previousCharger.gun_info[gun_index].bleLoginCentralId.id, ShmCharger->gun_info[gun_index].bleLoginCentralId.id, ARRAY_SIZE(ShmCharger->gun_info[gun_index].bleLoginCentralId.id));
 					}
 					*/
-					
-					//===============================
-					// Query primary Out put current config
-					//===============================
-					if((previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]) ||
-					   (previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] != ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]) ||
-					   (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
-					{
-						DEBUG_INFO("===========================================\n");
-						DEBUG_INFO("===== High priority polling : Case 11 =====\n");
-						DEBUG_INFO("===========================================\n");
-						DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
-						if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
-						{
-							DEBUG_INFO("MCU-%d get output current L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]);
-							DEBUG_INFO("MCU-%d get output current L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]);
-						}
-
-						previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] = ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
-						previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] = ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
-						previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] = ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
-					}
 				}
 			}
 			else
@@ -2647,7 +2647,7 @@ int main(void)
 						if(ShmCharger->gun_info[gun_index].mcuFlag.isMcuUpgradeReq)
 						{
 							DEBUG_INFO("===========================================\n");
-							DEBUG_INFO("==== Normal priority polling : Case 15 ====\n");
+							DEBUG_INFO("==== Normal priority polling : Case 13 ====\n");
 							DEBUG_INFO("===========================================\n");
 
 							unsigned char cmd[512];
@@ -2869,14 +2869,13 @@ int main(void)
 					switch(logIndex)
 					{
 						case 1:
-							/*
 							if((previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]) ||
 							   (previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] != ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]) ||
 							   (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
 							{
-								DEBUG_INFO("===========================================\n");
-								DEBUG_INFO("==== Normal priority polling : Case 3 =====\n");
-								DEBUG_INFO("===========================================\n");
+								DEBUG_INFO("*******************************************\n");
+								DEBUG_INFO("************* Output Current **************\n");
+								DEBUG_INFO("*******************************************\n");
 								DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
 								if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
 								{
@@ -2888,7 +2887,17 @@ int main(void)
 								previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] = ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
 								previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] = ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
 							}
-							*/
+
+							DEBUG_INFO("*******************************************\n");
+							DEBUG_INFO("************ Power Consumption ************\n");
+							DEBUG_INFO("*******************************************\n");
+							DEBUG_INFO("MCU-%d get total power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0));
+							DEBUG_INFO("MCU-%d get L1N_L12 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/10000.0));
+							if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
+							{
+								DEBUG_INFO("MCU-%d get L2N_L23 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/10000.0));
+								DEBUG_INFO("MCU-%d get L3N_L31 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/10000.0));
+							}
 
 							break;
 						case 2:
@@ -2958,7 +2967,7 @@ int main(void)
 							if(ShmCharger->gun_info[gun_index].isSetBreatheLedTiming == ON)
 							{
 								DEBUG_INFO("===========================================\n");
-								DEBUG_INFO("==== Normal priority polling : Case 17 ====\n");
+								DEBUG_INFO("==== Normal priority polling : Case 15 ====\n");
 								DEBUG_INFO("===========================================\n");
 								DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In);
 								DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out);
@@ -2972,7 +2981,7 @@ int main(void)
 							if(ShmCharger->gun_info[gun_index].isSetLedBrightness == ON)
 							{
 								DEBUG_INFO("===========================================\n");
-								DEBUG_INFO("==== Normal priority polling : Case 19 ====\n");
+								DEBUG_INFO("==== Normal priority polling : Case 17 ====\n");
 								DEBUG_INFO("===========================================\n");
 								DEBUG_INFO("MCU-%d set led brightness Sector 01 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_1);
 								DEBUG_INFO("MCU-%d set led brightness Sector 02 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_2);