Преглед изворни кода

2021-04-29 / Eason Ynag
Action:
1. Added : Respond to ocpp error for meter communication timeout.
2. Added : log print for meter communication timeout.
3. Added : Remove or add fault bit for meter communication timeout into inputAlarmCode.

File:
1. Module_AlarmDetect.c
Action 1

2. Module_InternalComm.c
Action 2
Action 3

Version :D0.50.XX.XXXX.XX

8009 пре 3 година
родитељ
комит
b31c324b3f

+ 5 - 0
EVSE/Projects/AW-CCS/Apps/Module_AlarmDetect.c

@@ -1105,6 +1105,11 @@ int main(void)
 				sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
 				sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "RelayDriveFault");
 			}
+			else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_METER_TIMEOUT)
+			{
+				sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
+				sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "MeterCommTimeout");
+			}
 			else
 			{
 				sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "NoError");

+ 7 - 1
EVSE/Projects/AW-CCS/Apps/Module_InternalComm.c

@@ -2147,7 +2147,12 @@ int main(void)
 					if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L3 == 0x01)
 						ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode |= 1<<27;
 					else
-						ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode &= ~(1<<27);							
+						ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode &= ~(1<<27);
+
+					if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_comm_timeout == 0x01)
+						ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode |= 1<<28;
+					else
+						ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode &= ~(1<<28);
 
 					failCount[gun_index] = 0;
 					
@@ -2370,6 +2375,7 @@ int main(void)
 							DEBUG_INFO("MCU-%d get short_circuit_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L3);
 						}
 						DEBUG_INFO("MCU-%d get relay_drive_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_drive_fault);
+						DEBUG_INFO("MCU-%d get meter_comm_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_comm_timeout);
 						DEBUG_INFO("MCU-%d get InputAlarmCode : %x\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode);
 					}