Kaynağa Gözat

Signed-off-by: zhuhongbin <kptzhu@163.com>修正在重量小于零时计算目标重量的问题

zhuhongbin 2 yıl önce
ebeveyn
işleme
afcce47268
2 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 4 4
      tmr/flash.c
  2. 3 1
      tmr/weight.c

+ 4 - 4
tmr/flash.c

@@ -9,7 +9,7 @@
 
 uint8_t  isCC = 0 ;
 uint8_t  isBLE =0;  //用蓝牙传输
-uint8_t  isNsmall =0;  //新小屏
+uint8_t  isNsmall =1;  //新小屏
 uint8_t  isnewBan =0;  //隔离主板
 const uint8_t  isTag = 0 ; //是否含识读标签
 unsigned char  isn = 0;  //是否新大屏
@@ -19,14 +19,14 @@ unsigned char eid[10];    //
 
 uint8_t XbeeConst_DeviceAddress = 0x01;         
 uint8_t XbeeConst_NetAddress = 0x00;
-uint8_t XbeeConst_UseAPI = 0x01;
+uint8_t XbeeConst_UseAPI = 0x00;
 uint8_t WeightConst_TQ = 0x05;//0x05;
 uint8_t WeightConst_BLE = 0;
 uint8_t WeightConst_ChanCheShu = 0x02;
-uint8_t WeightConst_SBType = 0x01;
+uint8_t WeightConst_SBType = 0x03;
 
 
-int16_t WeightConst_WeightBegin = 0;    //按键开始重量
+int16_t WeightConst_WeightBegin = -3000;    //按键开始重量
 
 uint8_t ad_Percent=  0x00;             //   7,    校正重量,1字节
 unsigned int  ad_Maxval=   0x00007530;       //   8,    最大称量,4字节

+ 3 - 1
tmr/weight.c

@@ -272,7 +272,9 @@ void CheckWeightthread(void) {
         }
 				if (WeightConst_WeightCount>0)
           WeightConst_WeightCur = WeightConst_WeightSum / WeightConst_WeightCount;
-		  	
+				else 
+		  	  WeightConst_WeightCur = WeightConst_WeightCurTem;
+				
 				WeightConst_WeightSum = 0;
 				WeightConst_WeightCount = 0;        //ÖØÁ¿Êý
 				WeightConst_WeightMax = -32768;         //×î´óÖØÁ¿