Sfoglia il codice sorgente

2022-09-23 / Alston Lin
Actions
1. Get the DD temp of UU module
2. Let the mpu downclock to 600M Hz
Files
1. UUpwr_PsuCommObj
2. rcS file

Alston Lin 2 anni fa
parent
commit
04cb2d0fa3

+ 25 - 6
EVSE/Modularization/UUpwr_PsuCommObj.c

@@ -357,7 +357,7 @@ void GetPsuMaxVoltage(byte group)
 	SendCmdToPsu(PwrFrameMsg.PwrMessage, data, sizeof(data));
 }
 
-void GetTemperature(byte group)
+void GetTemperature(byte group, byte type)
 {
 	byte data[8];
 	PwrFrame PwrFrameMsg;
@@ -381,7 +381,10 @@ void GetTemperature(byte group)
 	data[0] = data[0] << 4;
 	data[0] |= PSU_MSG_CMD_READ_MSG;
 	// Command Type
-	data[1] = PSU_R_TEMP;
+	if (type == UU_MODULE_TEMP_ENV)
+		data[1] = PSU_R_IN_TEMP;
+	else if (type == UU_MODULE_TEMP_DD)
+		data[1] = PSU_R_PFC_TEMP;
 
 	SendCmdToPsu(PwrFrameMsg.PwrMessage, data, sizeof(data));
 }
@@ -881,7 +884,22 @@ void ReceiveDataFromCanBus()
 						}
 					}
 						break;
-					case PSU_R_TEMP:
+					case PSU_R_IN_TEMP:
+					{
+						byte psuIndexAddr = moduleAddr;
+						float ReturnValue = ((frame.data[4] << 24 | frame.data[5] << 16 | frame.data[6] << 8 | frame.data[7])) / 1000;
+
+						if (group > 0)
+						{
+							psuIndexAddr = moduleAddr + ShmUuPowerData.uu_pow_info[group - 1].psuCount;
+						}
+
+						return_mis_info(psuIndexAddr, ReturnValue, 2);
+					}
+						break;
+					case PSU_R_PFC_TEMP:
+					case PSU_R_DD2_TEMP:
+					case PSU_R_DD3_TEMP:
 					{
 						//printf("----------PSU_R_TEMP---------- \n");
 						byte psuIndexAddr = moduleAddr;
@@ -890,8 +908,8 @@ void ReceiveDataFromCanBus()
 							psuIndexAddr = moduleAddr + ShmUuPowerData.uu_pow_info[group - 1].psuCount;
 						}
 
-						return_output_temp(psuIndexAddr, LIB_NO_USE, LIB_NO_USE, LIB_NO_USE, ((frame.data[6] << 8 | frame.data[7])) / 1000, PSU_PROTOCOL_TYPE);
-						//printf("temp = %02d \n", ((frame.data[6] << 8 | frame.data[7])) / 1000);
+						return_output_temp(psuIndexAddr, LIB_NO_USE, LIB_NO_USE, LIB_NO_USE, ((frame.data[4] << 24 | frame.data[5] << 16 | frame.data[6] << 8 | frame.data[7])) / 1000, PSU_PROTOCOL_TYPE);
+						//printf("temp = %02d \n", ((frame.data[4] << 24 | frame.data[5] << 16 | frame.data[6] << 8 | frame.data[7])) / 1000);
 					}
 						break;
 					case PSU_RW_GROUP:
@@ -1255,7 +1273,8 @@ void GetModuleOutputF(byte group)
 
 void GetDcTemperature(byte group)
 {
-	GetTemperature(group);
+	GetTemperature(group, UU_MODULE_TEMP_ENV);
+	GetTemperature(group, UU_MODULE_TEMP_DD);
 	GetInputVoltageL12(group);
 	GetInputVoltageL23(group);
 	GetInputVoltageL31(group);

+ 10 - 1
EVSE/Modularization/UUpwr_PsuCommObj.h

@@ -166,7 +166,10 @@ enum PSU_CTRL_CMD
 	PSU_R_VIN_L12 = 				0x14,	// Get L12 of Vin
 	PSU_R_VIN_L23 = 				0x15,	// Get L23 of Vin
 	PSU_R_VIN_L31 = 				0x16,	// Get L31 of Vin
-	PSU_R_TEMP = 					0x1E,	// Get PSU temperature
+	PSU_R_IN_TEMP = 				0x1E,	// Get PSU temperature
+	PSU_R_PFC_TEMP = 				0x1F,	// Get PSU temperature
+	PSU_R_DD2_TEMP = 				0x22,	// Get PSU temperature
+	PSU_R_DD3_TEMP = 				0x23,	// Get PSU temperature
 	PSU_R_FAST_OUTPUT_CUR = 		0x2F,	// Get output current (Fast)
 	PSU_RW_GROUP = 					0x59,	// Get/Set PSU group
 	PSU_W_HIGH_LOW_VOL_MODE =		0x5F,	// Set PSU high/low voltage mode
@@ -190,6 +193,12 @@ enum PSU_FLASH_CMD
 	PSU_FLASH_ON = 			1,
 };
 
+enum UU_MODULE_TEMP
+{
+	UU_MODULE_TEMP_ENV = 		0,
+	UU_MODULE_TEMP_DD = 		1,
+};
+
 /*Initialization*/
 bool InitialCommunication();
 

+ 6 - 5
EVSE/Projects/define.h

@@ -729,6 +729,7 @@ struct ChargingInfoData
     unsigned char       _TotalPsuCount;                 // Psu count for connector
     unsigned char       _TakePsuGpCount;                // Get the used psu group count
     struct DERATING_BY_OTP deratingByConnOtp;
+    unsigned char 		ParentIdTag[21];
 };
 
 typedef struct
@@ -1543,11 +1544,11 @@ char AlarmStatusCode[160][6]=
     "012350",   // reserved
     "012351",   // reserved
     "012352",   // Payment system communication timeout
-    "012353",   // reserved
-    "012354",   // reserved
-    "012355",   // reserved
-    "012356",   // reserved
-    "012357",   // reserved
+    "012353",   // Meter Slave Los Link
+    "012354",   // Meter Sync Time Error
+    "012355",   // Meter Start Transaction Error
+    "012356",   // Meter Stop Transaction Error
+    "012357",   // Meter Get Transaction Ocmf Error
     "012358",   // reserved
     "012359",   // reserved
 };

+ 9 - 6
EVSE/rootfs/etc/init.d/rcS

@@ -79,12 +79,7 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
 #/usr/sbin/telnetd -l /bin/login
 #status $? 0
 	
-echo -e " Starting SSH           	: \n"
-/sbin/dropbear
-echo -e " Starting FTPD	  		: \n"
-tcpsvd -vE 0.0.0.0 21 ftpd -w -t 30 / &
-echo -e " Starting LIGHTTPD		: \n"
-/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -m /lib
+
 
 cp /root/.tmate.conf /
 /usr/sbin/crond &
@@ -104,6 +99,7 @@ ln -sf libbz2.so.1.0.6 libbz2.so.1
 #   ---------------------------------------------
 #   Start demo app
 #   ---------------------------------------------
+run_cpu_freq_set.sh 600000
 /root/main &
 /usr/sbin/ntpd -nqp time.windows.com &
 /usr/sbin/ntpd -nqp cn.ntp.org.cn &
@@ -128,3 +124,10 @@ echo 3 > /proc/sys/kernel/panic
 #mkswap /dev/loop7
 #swapon /dev/loop7
 
+echo -e " Starting SSH           	: \n"
+/sbin/dropbear
+echo -e " Starting FTPD	  		: \n"
+tcpsvd -vE 0.0.0.0 21 ftpd -w -t 30 / &
+echo -e " Starting LIGHTTPD		: \n"
+/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -m /lib
+