Jelajahi Sumber

[Improve][AW-CCS][main.h][Module_InternalComm.c]
2022-10-20 / EASON YANG
Action:
1. Improve: Synchronize definitions on protocol.
2. Improve: isCommTimeout bit into Other_AlarmCode.

File:
1 main.h & Module_InternalComm.c
Action 1
Action 2

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

8009 2 tahun lalu
induk
melakukan
5374bbaf8a

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

@@ -822,7 +822,7 @@ unsigned char Query_AC_MCU_Alarm(unsigned char fd, unsigned char targetAddr, Ac_
 			Ret_Buf->bits.ac_leak = (((rx[6]>>6)&0x01)?1:0);
 			Ret_Buf->bits.dc_leak = (((rx[6]>>7)&0x01)?1:0);
 
-			//rx[7]
+			//rx[7] bits 1 & 5 Reserved
 			Ret_Buf->bits.mcu_selftest_fail = (((rx[7]>>0)&0x01)?1:0);
 			Ret_Buf->bits.handshaking_timeout = (((rx[7]>>1)&0x01)?1:0);
 			Ret_Buf->bits.emergency_stop = (((rx[7]>>2)&0x01)?1:0);
@@ -832,10 +832,11 @@ unsigned char Query_AC_MCU_Alarm(unsigned char fd, unsigned char targetAddr, Ac_
 			Ret_Buf->bits.locker_fault = (((rx[7]>>6)&0x01)?1:0);
 			Ret_Buf->bits.power_drop = (((rx[7]>>7)&0x01)?1:0);
 
-			//rx[8] bit 3 reserved
+			//rx[8] bit 3 Reserved
 			Ret_Buf->bits.short_circuit_L1 = (((rx[8]>>0)&0x01)?1:0);
 			Ret_Buf->bits.rotate_switch_fault = (((rx[8]>>1)&0x01)?1:0);
 			Ret_Buf->bits.relay_drive_fault = (((rx[8]>>2)&0x01)?1:0);
+			Ret_Buf->bits.ble_module_broken = (((rx[8]>>3)&0x01)?1:0);
 			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
 			{
 				Ret_Buf->bits.OVP_L2 = (((rx[8]>>4)&0x01)?1:0);
@@ -844,7 +845,7 @@ unsigned char Query_AC_MCU_Alarm(unsigned char fd, unsigned char targetAddr, Ac_
 				Ret_Buf->bits.UVP_L3 = (((rx[8]>>7)&0x01)?1:0);
 			}
 
-			//rx[9] bits 6 & 7 Reserved
+			//rx[9] bits 7 Reserved
 			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
 			{
 				Ret_Buf->bits.OCP_L2 = (((rx[9]>>0)&0x01)?1:0);
@@ -855,6 +856,7 @@ unsigned char Query_AC_MCU_Alarm(unsigned char fd, unsigned char targetAddr, Ac_
 			Ret_Buf->bits.meter_comm_timeout = (((rx[9]>>4)&0x01)?1:0);
 			Ret_Buf->bits.meter_ic_comm_timeout = (((rx[9]>>5)&0x01)?1:0);
 			Ret_Buf->bits.pilot_negative_error = (((rx[9]>>6)&0x01)?1:0);
+			Ret_Buf->bits.qca7000_flash_fail = (((rx[9]>>7)&0x01)?1:0);
 
 			result = PASS;
 		}
@@ -3472,18 +3474,18 @@ int main(void)
 				if((0 <= failCount[gun_index]%FAIL_SPEC_COMM) && (failCount[gun_index]%FAIL_SPEC_COMM < 10))
 					sleep(10);
 
-				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.comm_timeout == OFF)
+				if(ShmCharger->gun_info[gun_index].otherAlarmCode.isCommTimeout == OFF)
 				{
 					DEBUG_ERROR("Primary MCU-%d communication fault. \n", gun_index);
-					ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.comm_timeout = ON;
+					ShmCharger->gun_info[gun_index].otherAlarmCode.isCommTimeout = ON;
 				}
 			}
 			else
 			{
-				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.comm_timeout == ON)
+				if(ShmCharger->gun_info[gun_index].otherAlarmCode.isCommTimeout == ON)
 				{
 					DEBUG_ERROR("Primary MCU-%d communication recover. \n", gun_index);
-					ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.comm_timeout = OFF;
+					ShmCharger->gun_info[gun_index].otherAlarmCode.isCommTimeout = OFF;
 				}
 			}
 

+ 8 - 6
EVSE/Projects/AW-CCS/Apps/main.h

@@ -442,28 +442,29 @@ typedef struct AC_PRIMARY_MCU_ALARM
 			unsigned long ac_leak:1;
 			unsigned long dc_leak:1;
 			unsigned long mcu_selftest_fail:1;
-			unsigned long handshaking_timeout:1;
+			unsigned long handshaking_timeout:1;	//	Reserved 
 			unsigned long emergency_stop:1;
 			unsigned long relay_welding:1;
 			unsigned long leak_module_fail:1;
-			unsigned long shutter_fault:1;
+			unsigned long shutter_fault:1;			//	Reserved 
 			unsigned long locker_fault:1;
 			unsigned long power_drop:1;
-			unsigned long rotate_switch_fault:1;
 			unsigned long short_circuit_L1:1;
+			unsigned long rotate_switch_fault:1;
 			unsigned long relay_drive_fault:1;
-			unsigned long comm_timeout:1;
+			unsigned long ble_module_broken:1;		//	Reserved
 			unsigned long OVP_L2:1;
-			unsigned long UVP_L2:1;
-			unsigned long OCP_L2:1;
 			unsigned long OVP_L3:1;
+			unsigned long UVP_L2:1;
 			unsigned long UVP_L3:1;
+			unsigned long OCP_L2:1;
 			unsigned long OCP_L3:1;
 			unsigned long short_circuit_L2:1;
 			unsigned long short_circuit_L3:1;
 			unsigned long meter_comm_timeout:1;
 			unsigned long meter_ic_comm_timeout:1;
 			unsigned long pilot_negative_error:1;
+			unsigned long qca7000_flash_fail:1;		//	Reserved 
 		}bits;
 	};
 }Ac_Primary_Mcu_Alarm;
@@ -520,6 +521,7 @@ typedef struct OTHER_ALARM_CODE
 	unsigned long isHandshakingTimeOut:1;
 	unsigned long isDcLeakage:1;
 	unsigned long isACLeakage:1;
+	unsigned long isCommTimeout:1;  // Internal uart communication fail
 }Other_Alarm_Code;
 
 typedef struct PILOT_VOLTAGE