|
@@ -2,9 +2,9 @@
|
|
|
* Module_LcmControl.c
|
|
|
*
|
|
|
* Created on : 2020-10-20
|
|
|
- * Update on : 2022-04-27
|
|
|
+ * Update on : 2022-05-27
|
|
|
* Author : Folus Wen, Eason Yang
|
|
|
- * Version : V0.28
|
|
|
+ * Version : V0.29
|
|
|
*
|
|
|
*/
|
|
|
|
|
@@ -82,6 +82,13 @@ void setConnectionAnimation(uint8_t gun_index, uint8_t system_mode);
|
|
|
void setPresentChargedEnergy(uint8_t gun_index, uint8_t system_mode);
|
|
|
void setMarqueeControl(uint16_t address, uint8_t gun_index, uint8_t type);
|
|
|
|
|
|
+void setPrechargingTimerToDefault();
|
|
|
+void setPrechargingEnergyToDefault();
|
|
|
+void setPrechargingSessionFeeToDefault();
|
|
|
+void setPrechargingParkingFeeToDefault();
|
|
|
+void setPrechargingCostToDefault();
|
|
|
+void setPrechargingPowerToDefault();
|
|
|
+void setClearPrechargingValueToEmpty();
|
|
|
//=======================================
|
|
|
// Declare Timer
|
|
|
//=======================================
|
|
@@ -125,7 +132,7 @@ int Uart1Fd;
|
|
|
//=======================================
|
|
|
// Record version and date
|
|
|
//=======================================
|
|
|
-char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.28", "2022-04-27", "REV.03.00"};
|
|
|
+char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.29", "2022-05-27", "REV.03.00"};
|
|
|
|
|
|
//=======================================
|
|
|
// Common routine
|
|
@@ -339,11 +346,20 @@ void page_booting()
|
|
|
DEBUG_INFO("Setting page to booting.\n");
|
|
|
}
|
|
|
else
|
|
|
- {}
|
|
|
+ {
|
|
|
+ setClearPrechargingValueToEmpty();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void page_idle(uint8_t gun_index, uint8_t system_mode)
|
|
|
{
|
|
|
+ setPrechargingTimerToDefault();
|
|
|
+ setPrechargingEnergyToDefault();
|
|
|
+ setPrechargingSessionFeeToDefault();
|
|
|
+ setPrechargingParkingFeeToDefault();
|
|
|
+ setPrechargingCostToDefault();
|
|
|
+ setPrechargingPowerToDefault();
|
|
|
+
|
|
|
if(ocpp_get_isRemoteStartWait())
|
|
|
{
|
|
|
if((getCurrentPage() != SYSTEM_SCREEN_PREPARING))
|
|
@@ -400,17 +416,38 @@ void page_idle(uint8_t gun_index, uint8_t system_mode)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if((getCurrentPage() != SYSTEM_SCREEN_IDLE) && (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID))
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID && (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE)) &&
|
|
|
+ (ShmCharger->isCcsEnable) &&
|
|
|
+ (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) &&
|
|
|
+ (ShmCharger->gun_info[gun_index].isGetEvCCIDTimeout == OFF) &&
|
|
|
+ (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID) &&
|
|
|
+ (ShmCharger->gun_info[gun_index].isRemoteStartWait != ON) &&
|
|
|
+ (ShmCharger->gun_info[gun_index].isEvCCIDAuthorizeFail != YES))
|
|
|
{
|
|
|
- setCurrentPage(SYSTEM_SCREEN_IDLE);
|
|
|
- setDefaultValue(gun_index, system_mode);
|
|
|
- DEBUG_INFO("Setting page to idle.\n");
|
|
|
+ if((getCurrentPage() != SYSTEM_SCREEN_PREPARE_FOR_EVSE))
|
|
|
+ {
|
|
|
+ setCurrentPage(SYSTEM_SCREEN_PREPARE_FOR_EVSE);
|
|
|
+ DEBUG_INFO("Setting page to EVCCID. \n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setConnectionAnimation(gun_index, system_mode);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- setRfidIcon();
|
|
|
- setQRCodeIcon();
|
|
|
- setConnectionAnimation(gun_index, system_mode);
|
|
|
+ if((getCurrentPage() != SYSTEM_SCREEN_IDLE) && (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID))
|
|
|
+ {
|
|
|
+ setCurrentPage(SYSTEM_SCREEN_IDLE);
|
|
|
+ setDefaultValue(gun_index, system_mode);
|
|
|
+ DEBUG_INFO("Setting page to idle.\n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setRfidIcon();
|
|
|
+ setQRCodeIcon();
|
|
|
+ setConnectionAnimation(gun_index, system_mode);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -459,6 +496,12 @@ void page_preparing(uint8_t gun_index, uint8_t system_mode)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ setPrechargingTimerToDefault();
|
|
|
+ setPrechargingEnergyToDefault();
|
|
|
+ setPrechargingSessionFeeToDefault();
|
|
|
+ setPrechargingParkingFeeToDefault();
|
|
|
+ setPrechargingCostToDefault();
|
|
|
+ setPrechargingPowerToDefault();
|
|
|
setConnectionAnimation(gun_index, system_mode);
|
|
|
setPresentChargedEnergy(gun_index, system_mode);
|
|
|
}
|
|
@@ -496,6 +539,8 @@ void page_charging(uint8_t gun_index, uint8_t system_mode)
|
|
|
setConnectionAnimation(gun_index, system_mode);
|
|
|
setPresentChargedDuration(gun_index);
|
|
|
setPresentChargedgPower(gun_index);
|
|
|
+ setTimeTitle(ON);
|
|
|
+ setEnergyTitle(ON);
|
|
|
|
|
|
if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
|
|
|
{
|
|
@@ -625,6 +670,8 @@ void page_complete(uint8_t gun_index, uint8_t system_mode)
|
|
|
|
|
|
setPresentChargedDuration(gun_index);
|
|
|
setPresentChargedEnergy(gun_index, system_mode);
|
|
|
+ setTimeTitle(ON);
|
|
|
+ setEnergyTitle(ON);
|
|
|
|
|
|
if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
|
|
|
{
|
|
@@ -704,6 +751,8 @@ void page_terminating(uint8_t gun_index, uint8_t system_mode)
|
|
|
setPresentChargedDuration(gun_index);
|
|
|
setPresentChargedEnergy(gun_index, system_mode);
|
|
|
setPresentChargedgPower(gun_index);
|
|
|
+ setTimeTitle(ON);
|
|
|
+ setEnergyTitle(ON);
|
|
|
|
|
|
if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
|
|
|
{
|
|
@@ -1982,11 +2031,13 @@ void setConnectionAnimation(uint8_t gun_index, uint8_t system_mode)
|
|
|
if((CONNECTION_LEVEL_STATUS == CONNECTION_LEVEL_0) && (getDiffSecNow(startTime[gun_index][TMR_IDX_CONNECTION]) > (TIME_ANIMATION_CONNECTION)))
|
|
|
{
|
|
|
setDisplayValue(ICON_PREPARING_ANIMATION, CONNECTION_FLASHING_1);
|
|
|
+ setDisplayValue(ICON_PRECHARGING_ANIMATION, CONNECTION_FLASHING_1);
|
|
|
CONNECTION_LEVEL_STATUS = CONNECTION_LEVEL_1;
|
|
|
}
|
|
|
else if((CONNECTION_LEVEL_STATUS == CONNECTION_LEVEL_1) && (getDiffSecNow(startTime[gun_index][TMR_IDX_CONNECTION]) > (TIME_ANIMATION_CONNECTION*2)))
|
|
|
{
|
|
|
setDisplayValue(ICON_PREPARING_ANIMATION, CONNECTION_FLASHING_2);
|
|
|
+ setDisplayValue(ICON_PRECHARGING_ANIMATION, CONNECTION_FLASHING_2);
|
|
|
CONNECTION_LEVEL_STATUS = CONNECTION_LEVEL_0;
|
|
|
refreshStartTimer(&startTime[gun_index][TMR_IDX_CONNECTION]);
|
|
|
}
|
|
@@ -2379,13 +2430,13 @@ void setDefaultValue(uint8_t gun_index, uint8_t system_mode)
|
|
|
//=======================================
|
|
|
void setTextToEmpty(uint8_t gun_index)
|
|
|
{
|
|
|
- uint8_t data[32];
|
|
|
- uint8_t text_empty[32];
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text_empty[16];
|
|
|
|
|
|
memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
memset(text_empty, 0x00, ARRAY_SIZE(text_empty));
|
|
|
|
|
|
- strcpy((char*)text_empty, " ");
|
|
|
+ strcpy((char*)text_empty, " ");
|
|
|
string2ByteArray(text_empty, data);
|
|
|
|
|
|
lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_TOTAL_COST, data, ARRAY_SIZE(data));
|
|
@@ -2462,7 +2513,7 @@ void setTimeTitle(uint8_t isOn)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- strcpy((char*)text, " ");
|
|
|
+ strcpy((char*)text, " ");
|
|
|
string2ByteArray(text, data);
|
|
|
}
|
|
|
|
|
@@ -2498,7 +2549,7 @@ void setEnergyTitle(uint8_t isOn)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- strcpy((char*)text, " ");
|
|
|
+ strcpy((char*)text, " ");
|
|
|
string2ByteArray(text, data);
|
|
|
}
|
|
|
|
|
@@ -2534,7 +2585,7 @@ void setSessionFeeTitle(uint8_t isOn)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- strcpy((char*)text, " ");
|
|
|
+ strcpy((char*)text, " ");
|
|
|
string2ByteArray(text, data);
|
|
|
}
|
|
|
|
|
@@ -2570,7 +2621,7 @@ void setParkingFeeTitle(uint8_t isOn)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- strcpy((char*)text, " ");
|
|
|
+ strcpy((char*)text, " ");
|
|
|
string2ByteArray(text, data);
|
|
|
}
|
|
|
|
|
@@ -2606,7 +2657,7 @@ void setFinalCostTitle(uint8_t isOn)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- strcpy((char*)text, " ");
|
|
|
+ strcpy((char*)text, " ");
|
|
|
string2ByteArray(text, data);
|
|
|
}
|
|
|
|
|
@@ -2638,6 +2689,124 @@ void setCsuRootFsFwRev()
|
|
|
lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CSU_ROOT_FS_FW_REV, data, ARRAY_SIZE(data));
|
|
|
}
|
|
|
|
|
|
+//=======================================
|
|
|
+// Setting Precharging initial to empty
|
|
|
+//=======================================
|
|
|
+void setClearPrechargingValueToEmpty()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ strcpy((char*)text, " ");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_TIMER, data, ARRAY_SIZE(data));
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_ENERGY, data, ARRAY_SIZE(data));
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_SESSION_FEE, data, ARRAY_SIZE(data));
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_PARKING_FEE, data, ARRAY_SIZE(data));
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_COST, data, ARRAY_SIZE(data));
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_POWER, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
+//=======================================
|
|
|
+// Setting Precharging initial to empty
|
|
|
+//=======================================
|
|
|
+void setPrechargingTimerToDefault()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ sprintf((char *)text, "%s", "00:00:00");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_TIMER, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
+//=======================================
|
|
|
+// Setting Precharging energy to default
|
|
|
+//=======================================
|
|
|
+void setPrechargingEnergyToDefault()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ sprintf((char *)text, "%s kWh", "0000.0000");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_ENERGY, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
+//=======================================
|
|
|
+// Setting Precharging session fee to default
|
|
|
+//=======================================
|
|
|
+void setPrechargingSessionFeeToDefault()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ sprintf((char *)text, "%s", "000.00");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_SESSION_FEE, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
+//=======================================
|
|
|
+// Setting Precharging parking fee to default
|
|
|
+//=======================================
|
|
|
+void setPrechargingParkingFeeToDefault()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ sprintf((char *)text, "%s", "000.00");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_PARKING_FEE, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
+//=======================================
|
|
|
+// Setting Precharging cost to default
|
|
|
+//=======================================
|
|
|
+void setPrechargingCostToDefault()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ sprintf((char *)text, "%s", "000.00");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_COST, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
+//=======================================
|
|
|
+// Setting Precharging power to default
|
|
|
+//=======================================
|
|
|
+void setPrechargingPowerToDefault()
|
|
|
+{
|
|
|
+ uint8_t data[16];
|
|
|
+ uint8_t text[16];
|
|
|
+
|
|
|
+ memset(data, 0x00, ARRAY_SIZE(data));
|
|
|
+ memset(text, 0x00, ARRAY_SIZE(text));
|
|
|
+
|
|
|
+ sprintf((char *)text, "%s kW", "0.00");
|
|
|
+ string2ByteArray(text, data);
|
|
|
+ lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PRECHARGING_POWER, data, ARRAY_SIZE(data));
|
|
|
+}
|
|
|
+
|
|
|
//=======================================
|
|
|
// Initial all share memory
|
|
|
//=======================================
|
|
@@ -3112,7 +3281,8 @@ int main(void)
|
|
|
page_idle(ShmCharger->gun_selectd, ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus);
|
|
|
break;
|
|
|
case SYS_MODE_AUTHORIZING:
|
|
|
- //page_authorizing(ShmCharger->gun_selectd);
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].StartMethod == START_METHOD_EVCCID)
|
|
|
+ page_authorizing(ShmCharger->gun_selectd);
|
|
|
break;
|
|
|
case SYS_MODE_PREPARING:
|
|
|
page_preparing(ShmCharger->gun_selectd, ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus);
|