Ver código fonte

[Added][Noodoe][main.c]
2022-03-30 / Eason Yang
Action
1. Added: Creat ShmOCPP20Data memory.

File
1. main.c
Action 1

FIRMWARE VERSION: V0.53.XX.XXXX.NX

8009 3 anos atrás
pai
commit
992c34b093
1 arquivos alterados com 18 adições e 0 exclusões
  1. 18 0
      EVSE/Projects/Noodoe/Apps/main.c

+ 18 - 0
EVSE/Projects/Noodoe/Apps/main.c

@@ -81,6 +81,7 @@ struct PrimaryMcuData			*ShmPrimaryMcuData;
 struct FanModuleData			*ShmFanModuleData;
 struct RelayModuleData			*ShmRelayModuleData;
 struct OCPP16Data				*ShmOCPP16Data;
+struct OCPP20Data				*ShmOCPP20Data;
 struct Charger					*ShmCharger;
 
 struct timeb					startTime[AC_QUANTITY][10];
@@ -1185,6 +1186,23 @@ int CreatShareMemory()
    	}
    	memset(ShmOCPP16Data,0,sizeof(struct OCPP16Data));
 
+	//creat ShmOCPP20Data
+	if ((MeterSMId = shmget(ShmOcpp20ModuleKey, sizeof(struct OCPP20Data), IPC_CREAT | 0777)) < 0)
+	{
+
+		DEBUG_ERROR("shmget OCPP20Data NG\n");
+
+		result = FAIL;
+	}
+	else if ((ShmOCPP20Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
+	{
+
+		DEBUG_ERROR("shmat OCPP20Data NG\n");
+
+		result = FAIL;
+	}
+	memset(ShmOCPP20Data,0,sizeof(struct OCPP20Data));
+
 	//creat ShmCharger
    	if ((MeterSMId = shmget(ShmChargerKey, sizeof(struct Charger), IPC_CREAT | 0777)) < 0)
     {