Browse Source

[Add][AX80][Main]

2021.11.04 / Folus Wen

Actions:
1. LCD UI & LED logic support wait for link EV when receive remote start without connector id.

Files:
1. As follow commit history

Image version: D0.01.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 years ago
parent
commit
1dc814e4a1
2 changed files with 89 additions and 36 deletions
  1. 50 23
      EVSE/Projects/AX80/Apps/LCM/Module_LcmControl.c
  2. 39 13
      EVSE/Projects/AX80/Apps/main.c

+ 50 - 23
EVSE/Projects/AX80/Apps/LCM/Module_LcmControl.c

@@ -260,6 +260,25 @@ void getDateTimeString(char* result)
 	sprintf(result, "%04d/%02d/%02d %02d:%02d", tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min);
 }
 
+//======================================================
+// OCPP routine
+//======================================================
+uint8_t ocpp_get_isRemoteStartWait()
+{
+	uint8_t result = OFF;
+
+	if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+	{
+		result = ShmOCPP16Data->MsMsg.bits.isRemoteStartWaitReq;
+	}
+	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+	{
+		result = ShmOCPP20Data->MsMsg.bits.isRemoteStartWaitReq;
+	}
+
+	return result;
+}
+
 //=======================================
 // Function to page routine
 //=======================================
@@ -276,42 +295,50 @@ void page_booting()
 
 void page_idle(uint8_t gun_index, uint8_t system_mode)
 {
-	if(ShmCharger->gun_info[gun_index].isSleepOn == YES)
+	if(ocpp_get_isRemoteStartWait())
 	{
-		if((getCurrentPage() != SYSTEM_SCREEN_SLEEP))
-		{
-			setCurrentPage(SYSTEM_SCREEN_SLEEP);
-		}
-		else
-		{}
+		setCurrentPage(SYSTEM_SCREEN_PREPARING);
+		DEBUG_INFO("Setting page to preparing.\n");
 	}
 	else
 	{
-		if(ShmCharger->gun_info[gun_index].isCheckPowerConsumption == YES)
+		if(ShmCharger->gun_info[gun_index].isSleepOn == YES)
 		{
-			setCurrentPage(SYSTEM_SCREEN_POWER_CONSUMPTION);
-			setDisplayValue(ICON_POWER_CONSUMPTION, APPEAR);
-			setPresentPowerConsumption(gun_index);
+			if((getCurrentPage() != SYSTEM_SCREEN_SLEEP))
+			{
+				setCurrentPage(SYSTEM_SCREEN_SLEEP);
+			}
+			else
+			{}
 		}
 		else
 		{
-			if((getCurrentPage() != SYSTEM_SCREEN_IDLE) && (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID))
+			if(ShmCharger->gun_info[gun_index].isCheckPowerConsumption == YES)
 			{
-				setCurrentPage(SYSTEM_SCREEN_IDLE);
-				setDefaultValue(gun_index, system_mode);
-				DEBUG_INFO("Setting page to idle.\n");
+				setCurrentPage(SYSTEM_SCREEN_POWER_CONSUMPTION);
+				setDisplayValue(ICON_POWER_CONSUMPTION, APPEAR);
+				setPresentPowerConsumption(gun_index);
 			}
 			else
 			{
-				setRfidIcon();
-				setQRCodeIcon();
-
-				if(isEmulator == YES)
+				if((getCurrentPage() != SYSTEM_SCREEN_IDLE) && (ShmCharger->gun_info[gun_index].resultAuthorization != VALIDATED_RFID))
 				{
-					//if(isCharging == YES)
-						//PERCENTAGE = 0;
-					//else
-						//PERCENTAGE = 100;
+					setCurrentPage(SYSTEM_SCREEN_IDLE);
+					setDefaultValue(gun_index, system_mode);
+					DEBUG_INFO("Setting page to idle.\n");
+				}
+				else
+				{
+					setRfidIcon();
+					setQRCodeIcon();
+
+					if(isEmulator == YES)
+					{
+						//if(isCharging == YES)
+							//PERCENTAGE = 0;
+						//else
+							//PERCENTAGE = 100;
+					}
 				}
 			}
 		}

+ 39 - 13
EVSE/Projects/AX80/Apps/main.c

@@ -461,6 +461,22 @@ void ocpp_process_start()
 		system("/root/OcppBackend20 &");
 }
 
+uint8_t ocpp_get_isRemoteStartWait()
+{
+	uint8_t result = OFF;
+
+	if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+	{
+		result = ShmOCPP16Data->MsMsg.bits.isRemoteStartWaitReq;
+	}
+	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+	{
+		result = ShmOCPP20Data->MsMsg.bits.isRemoteStartWaitReq;
+	}
+
+	return result;
+}
+
 uint8_t ocpp_get_connection_status()
 {
 	uint8_t result = OFF;
@@ -5288,24 +5304,33 @@ int main(void)
 						// LED status in Idle mode
 						if(!ShmCharger->isAuthrizing)
 						{
-							if(ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON)
+							if(ocpp_get_isRemoteStartWait())
 							{
-								if(ShmCharger->gun_info[gun_index].rfidReq == OFF)
-								{
-									if(ShmCharger->gun_info[gun_index].isSleepOn == NO)
-										setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_CONNECTED);
-									else
-										setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_CONNECTED_SLEEP);
-								}
+								ShmCharger->gun_info[gun_index].isSleepOn = OFF;
+								setLedMotion(gun_index, LED_ACTION_AUTHED);
+								refreshStartTimer(&startTime[gun_index][TMR_IDX_POWERSAVING_LCD]);
 							}
 							else
 							{
-								if(ShmCharger->gun_info[gun_index].rfidReq == OFF)
+								if(ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON)
 								{
-									if(ShmCharger->gun_info[gun_index].isSleepOn == NO)
-										setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_DISCONNECTED);
-									else
-										setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_DISCONNECTED_SLEEP);
+									if(ShmCharger->gun_info[gun_index].rfidReq == OFF)
+									{
+										if(ShmCharger->gun_info[gun_index].isSleepOn == NO)
+											setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_CONNECTED);
+										else
+											setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_CONNECTED_SLEEP);
+									}
+								}
+								else
+								{
+									if(ShmCharger->gun_info[gun_index].rfidReq == OFF)
+									{
+										if(ShmCharger->gun_info[gun_index].isSleepOn == NO)
+											setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_DISCONNECTED);
+										else
+											setLedMotion(gun_index, LED_ACTION_IDLE_BACKEND_DISCONNECTED_SLEEP);
+									}
 								}
 							}
 						}
@@ -5462,6 +5487,7 @@ int main(void)
 							switch(ShmCharger->gun_info[gun_index].ccsHandshakeState)
 							{
 								case HANDSHAKE_DUTY_5:
+									break;
 								case HANDSHAKE_DUTY_5_CHECK:
 									refreshStartTimer(&startTime[gun_index][TMR_IDX_BS_HLC_HANDSHAKE]);
 									DEBUG_INFO("HLC slac handshake start.\n");