Ver código fonte

[Improve][AW-CCS][main.c]
2022-06-21 / EASON YANG
Action
1. Improve: checkRfidAuthrize() function. Check SN already start.
2. Improve: checkRfidAuthrize() function. Logic for authoriz fail and led light.

File
1. main.c

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

8009 2 anos atrás
pai
commit
065b9ccf97
1 arquivos alterados com 9 adições e 2 exclusões
  1. 9 2
      EVSE/Projects/AW-CCS/Apps/main.c

+ 9 - 2
EVSE/Projects/AW-CCS/Apps/main.c

@@ -5007,7 +5007,7 @@ void checkRfidAuthrize()
 			// Check SN already start
 			for(int gun_index = 0;gun_index<AC_QUANTITY;gun_index++)
 			{
-				if(isMatchStartUser(gun_index) || (isMatchPresentUser(gun_index) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_PREPARING)))
+				if(isMatchStartUser(gun_index) || (isMatchPresentUser(gun_index) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_PREPARING) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)))
 				{
 					DEBUG_INFO("%s running on connector-%02d.\n", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, gun_index);
 					isSnStart = TRUE;
@@ -5186,7 +5186,14 @@ void checkRfidAuthrize()
 
 					for(int gun_index = 0;gun_index<AC_QUANTITY;gun_index++)
 					{
-						setLedMotion(gun_index,LED_ACTION_IDLE);
+						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_PREPARING))
+						{
+							setLedMotion(gun_index,LED_ACTION_AUTHED);
+						}
+						else
+						{
+							setLedMotion(gun_index,LED_ACTION_IDLE);
+						}
 					}
 				}
 			}