Browse Source

2022-01-25 / Eason Yang
Action
1. Improve: presentChargedEnergyTotal() function. Changed to 4 decimal places.
2. Improve: setPresentChargedEnergy() function. Changed to 4 decimal places.

File
1. main.c
Action 1

2. Module_LcmControl.c
Action 2

LCM VERSION: V0.27
FIRMWARE VERSION: B0.61.XX.XXXX.PX

8009 3 years ago
parent
commit
0ce9423ca8

+ 3 - 3
EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c

@@ -2,7 +2,7 @@
  * Module_LcmControl.c
  *
  * Created on : 2020-10-20
- * Update on : 2022-01-20
+ * Update on : 2022-01-25
  * Author : Folus Wen, Eason Yang
  * Version : V0.27
  *
@@ -118,7 +118,7 @@ int Uart1Fd;
 //=======================================
 // Record version and date
 //=======================================
-char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.27", "2022-01-20", "REV.03.00"};
+char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.27", "2022-01-25", "REV.03.00"};
 
 //=======================================
 // Common routine
@@ -2209,7 +2209,7 @@ void setPresentChargedEnergy(uint8_t gun_index, uint8_t system_mode)
 		case SYS_MODE_TERMINATING:
 		case SYS_MODE_COMPLETE:
 		default:
-			sprintf((char *)energy, "%.3f0 kWh", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
+			sprintf((char *)energy, "%.4f kWh", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
 			string2ByteArray(energy, data);
 			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_ENERGY, data, ARRAY_SIZE(data));
 			break;

+ 1 - 1
EVSE/Projects/AW-CCS/Apps/main.c

@@ -2900,7 +2900,7 @@ float presentChargedEnergyTotal(unsigned char gun_index)
 	for(int idx=0;idx<ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod);idx++)
 	{
 		//result += ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[idx];
-		result += (((int)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[idx]*1000))/(float)1000);
+		result += (((int)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[idx]*10000))/(float)10000);
 	}
 
 	return result;