Browse Source

【V3.1.253.65】 温度优化,合并模型更改

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
fc07afa7c1
2 changed files with 35 additions and 35 deletions
  1. 2 2
      inc/AppConfig.h
  2. 33 33
      src/AppFunc.c

+ 2 - 2
inc/AppConfig.h

@@ -2,7 +2,7 @@
  * @Author       : ChenJie
  * @Date         : 2021-10-14 09:27:15
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-12-14 11:34:14
+ * @LastEditTime : 2021-12-17 17:33:27
  * @Description  : App Config H file 配置文件,可以针对不同参数进行更改
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppConfig.h
  */
@@ -14,7 +14,7 @@
 #define DATA_MODULE_TYPE (1)           // 1表示NB模块,2表示4G cat1
 #define EOLSTATE (0)                   // 1表示下线检测跳过,使用默认值,0表示使用下线检测
 #define DEFAULT_SN "RLTEST00000000001" //默认上传的SN编码
-#define APPSWVERSION 0x0301FE41        //数据模块软件版本号
+#define APPSWVERSION 0x0301FD41        //数据模块软件版本号
 #define RELAYCONFIG 1                  //继电器配置
 #define TCP_ADD "iotp.fast-fun.cn"     //数据上传的地址
 #define TCP_PORT 8712                  //数据上传的端口

+ 33 - 33
src/AppFunc.c

@@ -3,7 +3,7 @@
  * @Date         : 2021-11-09 12:08:17
  * @Version      : V3.0
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-12-16 11:13:32
+ * @LastEditTime : 2021-12-17 17:15:33
  * @Description  : file content
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\src\AppFunc.c
  */
@@ -414,15 +414,15 @@ void BattWorkDelayFunc(UINT8 battWorkCurrentState)
  */
 UINT16 LookRT_u32u16(UINT32 u0)
 {
-	const UINT8 table[240] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
-							  24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
-							  49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
-							  84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
-							  115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
-							  142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
-							  169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
-							  196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
-							  223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239};
+	// const UINT8 table[240] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+	// 						  24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+	// 						  49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+	// 						  84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
+	// 						  115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
+	// 						  142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
+	// 						  169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
+	// 						  196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
+	// 						  223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239};
 	const UINT32 bp0[240] = {202269, 191063, 180554, 170694, 161438, 152746, 144580, 136905, 129687, 122898, 116508,
 							 110493, 104827, 99488, 94455, 89710, 85233, 81008, 77019, 73252, 69693, 66329, 63148, 60140,
 							 57293, 54599, 52049, 49633, 47343, 45174, 43117, 41166, 39315, 37558, 35891, 34307, 32802, 31373,
@@ -444,12 +444,12 @@ UINT16 LookRT_u32u16(UINT32 u0)
 	UINT32 yL_0d0 = 0;
 	UINT32 yR_0d0 = 0;
 	UINT32 maxIndex = MaxLen - 1;
-	if (u0 <= bp0[0U])
+	if (u0 >= bp0[0U])
 	{
 		iLeft = 0U;
 		iRght = 0U;
 	}
-	else if (u0 < bp0[maxIndex])
+	else if (u0 > bp0[maxIndex])
 	{
 		//对折法寻找u0的位置
 		bpIdx = maxIndex >> 1U;
@@ -457,7 +457,7 @@ UINT16 LookRT_u32u16(UINT32 u0)
 		iRght = maxIndex;
 		while ((iRght - iLeft) > 1)
 		{
-			if (u0 < bp0[bpIdx])
+			if (u0 > bp0[bpIdx])
 			{
 				iRght = bpIdx;
 			}
@@ -473,26 +473,26 @@ UINT16 LookRT_u32u16(UINT32 u0)
 		iLeft = maxIndex;
 		iRght = maxIndex;
 	}
-	//找到位置以后计算插值
-	if (iLeft != iRght)
-	{
-		//线性插值
-		yR_0d0 = table[iLeft + 1U];
-		yL_0d0 = table[iLeft];
-		if (yR_0d0 >= yL_0d0)
-		{
-			y = ((UINT16)((UINT32)(u0 - bp0[iLeft]) * (yR_0d0 - yL_0d0)) / (bp0[iLeft + 1] - bp0[iLeft]) + yL_0d0);
-		}
-		else
-		{
-			y = ((UINT16)(yL_0d0 - ((UINT32)(u0 - bp0[iLeft]) * (yL_0d0 - yR_0d0)) / (bp0[iLeft + 1] - bp0[iLeft])));
-		}
-	}
-	else
-	{
-		y = (UINT16)table[iLeft];
-	}
-	return y;
+	// //找到位置以后计算插值
+	// if (iLeft != iRght)
+	// {
+	// 	//线性插值
+	// 	yR_0d0 = table[iLeft + 1U];
+	// 	yL_0d0 = table[iLeft];
+	// 	if (yR_0d0 >= yL_0d0)
+	// 	{
+	// 		y = (UINT16)(((UINT32)(u0 - bp0[iLeft]) * (yR_0d0 - yL_0d0)) / (bp0[iLeft + 1] - bp0[iLeft]) + yL_0d0);
+	// 	}
+	// 	else
+	// 	{
+	// 		y = (UINT16)(yL_0d0 - ((UINT32)(u0 - bp0[iLeft]) * (yL_0d0 - yR_0d0)) / (bp0[iLeft + 1] - bp0[iLeft]));
+	// 	}
+	// }
+	// else
+	// {
+	// 	y = (UINT16)table[iLeft];
+	// }
+	return (UINT16)iLeft;
 }
 /**
  * @brief : tcp校验函数