ソースを参照

Signed-off-by: zhuhongbin <kptzhu@163.com>

zhuhongbin 2 年 前
コミット
10528e0af3
4 ファイル変更8 行追加9 行削除
  1. 1 0
      Src/main.c
  2. 2 2
      tmr/button.c
  3. 2 3
      tmr/flash.c
  4. 3 4
      tmr/weight.c

+ 1 - 0
Src/main.c

@@ -189,6 +189,7 @@ int main(void)
 	thread_beep_init();
 	output1_off();
 	output2_off();
+	pwr_lock_on();
 	AT_on();
 
   rt_kprintf("\n \\ | /\n");

+ 2 - 2
tmr/button.c

@@ -75,7 +75,7 @@ static void CheckMenuButton_entry(void *parameter) {
 				rt_thread_mdelay(2000);
 				if ((HAL_GPIO_ReadPin(pwr_GPIO_Port, pwr_Pin) == 0) ) {
 					beep();
-					pwr_lock_on();
+					pwr_lock_off();
 				}
 			}
 		}
@@ -471,7 +471,7 @@ static void CheckButton_entry(void *parameter) {
 						rt_thread_mdelay(2000);
 						if ((HAL_GPIO_ReadPin(pwr_GPIO_Port, pwr_Pin) == 0) ) {
 							beep();
-							pwr_lock_on();
+							pwr_lock_off();
 						}
 					}
 		  	}

+ 2 - 3
tmr/flash.c

@@ -12,7 +12,7 @@ uint8_t  isBLE =0;  //
 uint8_t  isNsmall =0;  //新小屏
 uint8_t  isnewBan =1;  //隔离主板
 const uint8_t  isTag = 0 ; //是否含识读标签
-unsigned char  isn = 0;  //是否新大屏
+unsigned char  isn = 1;  //是否新大屏
 unsigned char  remote_sumweight = 0;  //远程是否包含重量
 unsigned char  iscowweight = 0;  //是否奶牛秤
 unsigned char eid[10];    //电子耳标,0为长度
@@ -23,8 +23,7 @@ uint8_t XbeeConst_UseAPI = 0x01;
 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 = -3000;    //按键开始重量
 

+ 3 - 4
tmr/weight.c

@@ -195,7 +195,7 @@ static void setWeightSM() {  // 
 }
 
 
-signed long readnumber(unsigned char* weightbuf, unsigned char length, unsigned char idlelength,
+void readnumber(unsigned char* weightbuf, unsigned char length, unsigned char idlelength,
                        unsigned char wlength, unsigned char zfpos,unsigned char fchar,unsigned char pointpos){
     signed long WeightCurTem_ = 0;
 		unsigned char WeightCurTemZF = 0;
@@ -545,12 +545,12 @@ static void P_AWT_ZM303() {
            //3D 2D 30 30 30 30 36 34 28 6B 67 29 0D 0A				
 					 readnumber(WeightConst_RecWeightData1,WeightConst_RecWeightPoint1, 5, 6, 0x0C, 0x2d, 0xFF);                
 				} 
-				else if (WeightConst_RecWeightPoint1 == 14 && WeightConst_RecWeightData1[WeightConst_RecWeightPoint1-6]==0x20 &&
-                     WeightConst_RecWeightData1[WeightConst_RecWeightPoint1-5]==0x6B ) {
+				else if (WeightConst_RecWeightPoint1 == 14 && WeightConst_RecWeightData1[WeightConst_RecWeightPoint1-5]==0x6B ) {
           //20 20 20 20 20 31 37 34 20 6B 67 20 47 0D 0A
 				  //20 20 20 20 20 2D 31 38 20 6B 67 20 47 0D 0A
 					 readnumber(WeightConst_RecWeightData1,WeightConst_RecWeightPoint1, 6, 6, 0xFF, 0x2d, 0xFF);   							 
 				}
+
 				else if (WeightConst_RecWeightPoint1 == 43 && WeightConst_RecWeightData1[0] == 0x31) {
            //	31 2C 53 54 2C 20 20 20 20 20 20 20 2D 32 35 2C 20 20 20 20 20 20 20 20 20 20 20 30 2C 20 20 20 20 20 20 20 20 20 30 2C 6B 67 0D 0A
 				   readnumber(WeightConst_RecWeightData1,WeightConst_RecWeightPoint1, 28, 6, 0xFF, 0x2d, 0xFF);   	
@@ -914,7 +914,6 @@ static void P_ID511() {
 		}			  
 }
 
-
 static void P_AD250() {
 //	C9 20 20 20 20 33 38 3B 34 D9   38
 //  C9 20 20 C4 31 32 38 36 38 D9   -128