Sfoglia il codice sorgente

解决模块2结果上报异常问题

yidong 1 mese fa
parent
commit
8c0501a9ad

+ 18 - 11
DriverInterface/rgb381.c

@@ -483,20 +483,27 @@ void SystemResaultJudge(uint8_t number)
 	int nc_index = 0;	//内参
 	uint8_t *p = &result.hole1_result;	//孔结果
 	ColorSensor *pGroup = (number == 0) ? CS : CS_Slave;
+	ProcessStateMachine_t *psm=(number == 0) ? &sysinf.psmMaster : &sysinf.psmSlave; 
 	result.Devicenum = 0;
-	strcpy(result.card_num,sysinf.psmMaster.card_param_info.pid);
+	if(number == 0){	
+		strcpy(result.card_num,psm->card_param_info.pid);
+	
+	}else{	
+		strcpy(result.card_num,psm->card_param_info.pid);	
+	}
+	
 //	result.card_num = card_param_info.pid;
 
-	result.hole1_item = sysinf.psmMaster.card_param_info.hole_info[0].item;
-	result.hole2_item = sysinf.psmMaster.card_param_info.hole_info[1].item;
-	result.hole3_item = sysinf.psmMaster.card_param_info.hole_info[2].item;
-	result.hole4_item = sysinf.psmMaster.card_param_info.hole_info[3].item;
-	result.hole5_item = sysinf.psmMaster.card_param_info.hole_info[4].item;
-	result.hole6_item = sysinf.psmMaster.card_param_info.hole_info[5].item;
-	result.hole7_item = sysinf.psmMaster.card_param_info.hole_info[6].item;
-	result.hole8_item = sysinf.psmMaster.card_param_info.hole_info[7].item;
-	result.hole9_item = sysinf.psmMaster.card_param_info.hole_info[8].item;
-	result.hole10_item = sysinf.psmMaster.card_param_info.hole_info[9].item;
+	result.hole1_item = psm->card_param_info.hole_info[0].item;
+	result.hole2_item = psm->card_param_info.hole_info[1].item;
+	result.hole3_item = psm->card_param_info.hole_info[2].item;
+	result.hole4_item = psm->card_param_info.hole_info[3].item;
+	result.hole5_item = psm->card_param_info.hole_info[4].item;
+	result.hole6_item = psm->card_param_info.hole_info[5].item;
+	result.hole7_item = psm->card_param_info.hole_info[6].item;
+	result.hole8_item = psm->card_param_info.hole_info[7].item;
+	result.hole9_item = psm->card_param_info.hole_info[8].item;
+	result.hole10_item = psm->card_param_info.hole_info[9].item;
 
 	result.hole1_Tt[0] = (uint8_t)pGroup[0].Tt;
 	result.hole1_Tt[1] = (uint8_t)((pGroup[0].Tt-(uint8_t)pGroup[0].Tt)*100);

+ 4 - 2
DriverInterface/state_mini.c

@@ -168,7 +168,9 @@ void updateData(ProcessStateMachine_t *psm)
 				}
 		}else{
 			/*无数据,有结果*/
-			if(psm->updateresult){
+			if(psm->updateresult){	
+                psm->cursendok = 0;
+                psm->sendTime = 3;
 				data_send_to_pc(PC_CMD_REPORT_RESULT, (char *)&result, sizeof(test_result_struct));              				
 			}			
 		}
@@ -573,7 +575,7 @@ void usr_state_machine(ProcessStateMachine_t *sts, heat_ctrl_def *heater)
         {
             sts->statusword |= SW_result_report;
             sts->state = SW_result_report;
-             sample_calc_result(heater->number);
+            sample_calc_result(heater->number);
         	sts->updateresult = 1;
 			
         }

+ 68 - 3
MDK-ARM/mini7_V2.uvoptx

@@ -75,7 +75,7 @@
       <OPTFL>
         <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
-        <IsCurrentTarget>1</IsCurrentTarget>
+        <IsCurrentTarget>0</IsCurrentTarget>
       </OPTFL>
       <CpuCode>18</CpuCode>
       <DebugOpt>
@@ -213,6 +213,22 @@
           <ExecCommand></ExecCommand>
           <Expression></Expression>
         </Bp>
+        <Bp>
+          <Number>4</Number>
+          <Type>0</Type>
+          <LineNumber>217</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>0</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>0</BreakIfRCount>
+          <Filename>..\DriverInterface\state_mini.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression></Expression>
+        </Bp>
       </Breakpoint>
       <WatchWindow1>
         <Ww>
@@ -397,7 +413,7 @@
       <OPTFL>
         <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
-        <IsCurrentTarget>0</IsCurrentTarget>
+        <IsCurrentTarget>1</IsCurrentTarget>
       </OPTFL>
       <CpuCode>18</CpuCode>
       <DebugOpt>
@@ -470,7 +486,56 @@
           <Name>-U-O142 -O2254 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F103RE$Flash\STM32F10x_512.FLM)</Name>
         </SetRegEntry>
       </TargetDriverDllRegistry>
-      <Breakpoint/>
+      <Breakpoint>
+        <Bp>
+          <Number>0</Number>
+          <Type>0</Type>
+          <LineNumber>510</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>134246126</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>..\DriverInterface\usr_motor.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\mini7_V2\../DriverInterface/usr_motor.c\510</Expression>
+        </Bp>
+        <Bp>
+          <Number>1</Number>
+          <Type>0</Type>
+          <LineNumber>303</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>134247576</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>..\DriverInterface\usr_motor.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\mini7_V2\../DriverInterface/usr_motor.c\303</Expression>
+        </Bp>
+        <Bp>
+          <Number>2</Number>
+          <Type>0</Type>
+          <LineNumber>217</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>134261172</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>..\DriverInterface\state_mini.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\mini7_V2\../DriverInterface/state_mini.c\217</Expression>
+        </Bp>
+      </Breakpoint>
       <WatchWindow1>
         <Ww>
           <count>0</count>

+ 5 - 5
MDK-ARM/startup_stm32f103xe.lst

@@ -544,11 +544,11 @@ ARM Macro Assembler    Page 9
               00000000 
 Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interw
 ork --depend=mini7_v2\startup_stm32f103xe.d -omini7_v2\startup_stm32f103xe.o -I
-.\RTE\_mini7_V2 -IF:\Keil_v5\ARM\PACK\ARM\CMSIS\5.4.0\CMSIS\Core\Include -IF:\K
-eil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.0\Device\Include --predefine="__MICROLIB
- SETA 1" --predefine="__UVISION_VERSION SETA 526" --predefine="_RTE_ SETA 1" --
-predefine="STM32F10X_HD SETA 1" --list=startup_stm32f103xe.lst startup_stm32f10
-3xe.s
+.\RTE\_mini7_V2_debug -IF:\Keil_v5\ARM\PACK\ARM\CMSIS\5.4.0\CMSIS\Core\Include 
+-IF:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.0\Device\Include --predefine="__MI
+CROLIB SETA 1" --predefine="__UVISION_VERSION SETA 526" --predefine="_RTE_ SETA
+ 1" --predefine="STM32F10X_HD SETA 1" --list=startup_stm32f103xe.lst startup_st
+m32f103xe.s