Переглянути джерело

Signed-off-by: zhuhongbin <kptzhu@163.com>添加启动时设定阈值,防止重启就跳转

zhuhongbin 2 роки тому
батько
коміт
184d72c2e1
7 змінених файлів з 43 додано та 27 видалено
  1. 13 13
      MDK-ARM/test.uvguix.zhuhongbin
  2. 7 7
      MDK-ARM/test.uvoptx
  3. 2 0
      Src/main.c
  4. 1 1
      syswatch/inc/syswatch_config.h
  5. 3 3
      tmr/flash.c
  6. 15 2
      tmr/plan.c
  7. 2 1
      tmr/weight.c

Різницю між файлами не показано, бо вона завелика
+ 13 - 13
MDK-ARM/test.uvguix.zhuhongbin


+ 7 - 7
MDK-ARM/test.uvoptx

@@ -238,7 +238,7 @@
 
   <Group>
     <GroupName>Application/MDK-ARM</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -258,7 +258,7 @@
 
   <Group>
     <GroupName>Application/User</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -374,7 +374,7 @@
 
   <Group>
     <GroupName>Drivers/CMSIS</GroupName>
-    <tvExp>1</tvExp>
+    <tvExp>0</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -662,7 +662,7 @@
 
   <Group>
     <GroupName>flashdb</GroupName>
-    <tvExp>1</tvExp>
+    <tvExp>0</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -718,7 +718,7 @@
 
   <Group>
     <GroupName>tmr</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -866,7 +866,7 @@
 
   <Group>
     <GroupName>syswatch</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -874,7 +874,7 @@
       <GroupNumber>9</GroupNumber>
       <FileNumber>48</FileNumber>
       <FileType>1</FileType>
-      <tvExp>0</tvExp>
+      <tvExp>1</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
       <PathWithFileName>..\syswatch\src\syswatch.c</PathWithFileName>

+ 2 - 0
Src/main.c

@@ -183,6 +183,8 @@ int main(void)
 	WeightConst_Product_Run_time= HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR3);	
 	WeightConst_DELAYON= HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR4);	
 	WeightConst_DELAYTIME= HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR5);	
+	WeightConst_WeightTargetAllowMin = 32767;  //目标重量的允许跳转范围
+  WeightConst_WeightTargetAllowMax = -32768;  //目标重量的允许跳转范围
 	pf_comp.data.delaytime= HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR6);
 	thread_beep_init();
 	output1_off();

+ 1 - 1
syswatch/inc/syswatch_config.h

@@ -24,7 +24,7 @@
  * 2--resume exception thread
  */
 #ifndef SYSWATCH_EXCEPT_RESOLVE_MODE
-#define SYSWATCH_EXCEPT_RESOLVE_MODE    2
+#define SYSWATCH_EXCEPT_RESOLVE_MODE    0
 #endif
 
 #ifndef SYSWATCH_EXCEPT_TIMEOUT

+ 3 - 3
tmr/flash.c

@@ -9,10 +9,10 @@
 
 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 = 1;  //是否新大屏
+unsigned char  isn = 0;  //是否新大屏
 unsigned char  remote_sumweight = 0;  //远程是否包含重量
 unsigned char  iscowweight = 0;  //是否奶牛秤
 unsigned char eid[10];    //电子耳标,0为长度
@@ -23,7 +23,7 @@ uint8_t XbeeConst_UseAPI = 0x01;
 uint8_t WeightConst_TQ = 0x01;//0x05;
 uint8_t WeightConst_BLE = 0;
 uint8_t WeightConst_ChanCheShu = 0x02;
-uint8_t WeightConst_SBType = 0x04;
+uint8_t WeightConst_SBType = 0x03;
 
 
 int16_t WeightConst_WeightBegin = 0;    //按键开始重量

+ 15 - 2
tmr/plan.c

@@ -606,6 +606,7 @@ void getTargetWeight(void)
 
     WeightConst_WeightTargetAllowMin = WeightConst_WeightTarget	- pf_comp.data.autozone;  //目标重量的允许跳转范围
     WeightConst_WeightTargetAllowMax = WeightConst_WeightTarget	+ pf_comp.data.autozone;
+		
     WeightConst_AutoSingleNSecondPoint=0;
     WeightConst_oksum = 0;
     WeightConst_allsum = 0;
@@ -779,11 +780,23 @@ void SendWifi_thread(void)
 }
 
 static  rt_thread_t pop_productid = RT_NULL;
+static void pop_product_thread_cleanup(struct rt_thread *tid)
+{
+    if (tid != pop_productid)
+    {
+        return ;
+    }
+        
+}
 
 void pop_product_thread(void)
 {
     pop_productid = rt_thread_create("popproduct", pop_product_entry, RT_NULL, 0x400, 5, 5);
-
+    
     /* 如果获得线程控制块,启动这个线程 */
-    if (pop_productid != RT_NULL) rt_thread_startup(pop_productid);
+    if (pop_productid != RT_NULL) 
+		{
+			pop_productid->cleanup = pop_product_thread_cleanup;
+		  rt_thread_startup(pop_productid);
+		}
 }

+ 2 - 1
tmr/weight.c

@@ -327,7 +327,8 @@ void CheckWeightthread(void) {
         if (WeightConst_autotpo > 100) WeightConst_autotpo = 0;     //对百分比进行保护
 
         if ((WeightConst_autotpo > WeightConst_WeightTargetTpo)
-                || (WeightConst_foksum>(pf_comp.data.autosecond>>1) && pf_comp.data.JMP)  
+                || ((WeightConst_foksum * 100 / WeightConst_uallsum)>WeightConst_WeightTargetTpo
+ 				                   && pf_comp.data.JMP)  
            )       //触发自动按键
         {
             for (int CheckWeight_i = 0; CheckWeight_i < 30; CheckWeight_i++) {

Деякі файли не було показано, через те що забагато файлів було змінено