Parcourir la source

Signed-off-by: zhuhongbin <kptzhu@163.com>宿迁调试最终程序

zhuhongbin il y a 2 ans
Parent
commit
6f82414765
5 fichiers modifiés avec 20 ajouts et 14 suppressions
  1. 3 3
      tmr/Ad.c
  2. 1 2
      tmr/button.c
  3. 11 8
      tmr/flash.c
  4. 3 1
      tmr/plan.c
  5. 2 0
      tmr/weight.c

+ 3 - 3
tmr/Ad.c

@@ -542,7 +542,7 @@ void Speed(void)
         break;
     case 1:
         ad_ini_flag1=0;
-        FLT_CNT=24;
+        FLT_CNT=12;
         AVG_CNT=6;
         break;
     case 2:
@@ -552,12 +552,12 @@ void Speed(void)
         break;
     case 3:
         ad_ini_flag1=0;
-        FLT_CNT=24;
+        FLT_CNT=32;
         AVG_CNT=6;
         break;
     case 4:
         ad_ini_flag1=0;
-        FLT_CNT=24;
+        FLT_CNT=48;
         AVG_CNT=6;
         break;
     case 5:

+ 1 - 2
tmr/button.c

@@ -678,8 +678,7 @@ static void CheckButton_entry(void *parameter) {
 						button_state.b4 = 0;
 						button_state.b7 = 0;
         }
-        if ((HAL_GPIO_ReadPin(B4_GPIO_Port, B4_Pin) > 0) && button_state.b4 == 0  && iscowweight==0) {
-					  WriteTag();					
+        if ((HAL_GPIO_ReadPin(B4_GPIO_Port, B4_Pin) > 0) && button_state.b4 == 0  && iscowweight==0) {			
             if (WeightConst_SBType != 2 && WeightConst_SBType != 7) {
 							  if (isTag==1)
 								{

+ 11 - 8
tmr/flash.c

@@ -9,7 +9,7 @@
 
 uint8_t  isCC = 0 ;
 uint8_t  isBLE =0;  //用蓝牙传输
-uint8_t  isNsmall =1;  //新小屏
+uint8_t  isNsmall =0;  //新小屏
 uint8_t  isnewBan =0;  //隔离主板
 const uint8_t  isTag = 0 ; //是否含识读标签
 unsigned char  isn = 0;  //是否新大屏
@@ -19,11 +19,11 @@ unsigned char eid[10];    //
 
 uint8_t XbeeConst_DeviceAddress = 0x01;         
 uint8_t XbeeConst_NetAddress = 0x00;
-uint8_t XbeeConst_UseAPI = 0x00;
+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 = 0x03;
+uint8_t WeightConst_SBType = 0x01;
 
 
 int16_t WeightConst_WeightBegin = 0;    //按键开始重量
@@ -474,12 +474,15 @@ uint8_t ts_pushArrary(fdb_tsdb_t db, uint8_t *buf, uint8_t length)
 			findF4();
 		
 		if (foundF8==0 && foundF4==0){
-				result = fdb_tsl_append(db, fdb_blob_make(&blob, buf, length));	
-				if (result != FDB_NO_ERR)
-				{	 
+			 while (fdb_tsl_append(db, fdb_blob_make(&blob, buf, length))!= FDB_NO_ERR){
+			   rt_thread_mdelay(10);
+			 }
+				//result = fdb_tsl_append(db, fdb_blob_make(&blob, buf, length));	
+			//	if (result != FDB_NO_ERR)
+				//{	 
 //					rt_kprintf("ts_pushArrary:%02X \n", ts_planTime);		
-					return 0;
-				}
+				//	return 0;
+			//	}
 		}		
 	
 		return 1;

+ 3 - 1
tmr/plan.c

@@ -526,7 +526,8 @@ void sendkey1(int BtnType, int remote) {
     buf[16]= 0xff - CRCNum;
 
 		ts_pushArrary(&ts_keydb, buf, buf[1]+2);		
-																
+		WeightConst_WeightTargetAllowMin = 32767;  //目标重量的允许跳转范围
+		WeightConst_WeightTargetAllowMax = -32768;  //目标重量的允许跳转范围														
 		CompleteTarget_order = pf_comp.data.pfsort;
 		rt_sem_take(setTIME_lock, RT_WAITING_FOREVER);
     write_Flash("TimeConst", &TimeConst, sizeof(TimeConst));	
@@ -534,6 +535,7 @@ void sendkey1(int BtnType, int remote) {
     save_read_ts('p');			
     beep();
     alarm_off();
+		
 
     if (pf_comp.data.pfsort == 0xFE) {
 				rt_sem_take(display_lock, RT_WAITING_FOREVER);

+ 2 - 0
tmr/weight.c

@@ -247,9 +247,11 @@ void CheckWeightthread(void) {
 							write_Flash("begintime", &TimeConst, sizeof(TimeConst));											
 							WeightConst_WeightBegin = WeightConst_WeightCur;					
               write_Flash("beginweight", &WeightConst_WeightBegin, sizeof(WeightConst_WeightBegin)); 
+              
 							pf_comp.data.delaytime = 0;
 						  WeightConst_DELAYTIME = 0;
 						  WeightConst_DELAYON = 0;
+						
 					  	HAL_RTCEx_BKUPWrite(&hrtc,RTC_BKP_DR4, 0);	
 						  HAL_RTCEx_BKUPWrite(&hrtc,RTC_BKP_DR5, 0);	
 						  HAL_RTCEx_BKUPWrite(&hrtc,RTC_BKP_DR6, 0);