瀏覽代碼

2020-01-16 / Folus wen

Actions:
1. main.c remote reservation bug fix.
2. mainc. connector location index set for OCPP.

Files:
1. As follow commit history.
FolusWen 5 年之前
父節點
當前提交
df1ef1e617
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      EVSE/Projects/AW-Regular/Apps/main.c

+ 7 - 1
EVSE/Projects/AW-Regular/Apps/main.c

@@ -1372,11 +1372,13 @@ int isReservationExpired(unsigned char gun_index)
 	{
 		expiredTime.time = mktime(&expiredDate);
 
-		if(DiffTimebWithNow(expiredTime)<0)
+		if(DiffTimebWithNow(expiredTime)>0)
 		{
 			result = YES;
 		}
 	}
+	else
+		DEBUG_WARN("Expired date parsing error\r\n");
 
 	return result;
 }
@@ -1492,6 +1494,9 @@ int main(void)
 		//==========================================
 		for(int gun_index = 0;gun_index<AC_QUANTITY;gun_index++)
 		{
+			// Assign connector location index for OCPP
+			ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].Index = gun_index;
+
 			// Alarm event check
 			if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0))
 			{
@@ -2114,6 +2119,7 @@ int main(void)
 						 * 1. LED control depend on relay status
 						 * 2. check reservation is overtime?
 						 */
+						setLedMotion(gun_index,LED_ACTION_MAINTAIN);
 					}
 
 					if(isReservationExpired(gun_index) || ShmOCPP16Data->CsMsg.bits[gun_index].CancelReservationReq)