![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: Global.c
- Revision:
- 232:130a2b5003e6
- Parent:
- 231:079835d508ef
diff -r 079835d508ef -r 130a2b5003e6 Global.c --- a/Global.c Thu Jan 25 13:59:43 2018 +0000 +++ b/Global.c Wed Jan 31 13:41:23 2018 +0000 @@ -316,6 +316,12 @@ if(GyroP.Str.ParamMod==1) { Gyro.ShowMod2=0; + // Gyro.TermoMod = GyroP.Str.TermoMode; + + + + + Gyro.TimeToJump = GyroP.Str.TimeToJump; Gyro.JumpDelta = GyroP.Str.JumpDelta; Gyro.ShiftMod = GyroP.Str.ShiftMod; @@ -326,6 +332,7 @@ Gyro.ResetLevelCool = (unsigned int)((GyroP.Str.ResetLevelCool-0x7fff)&0xffff); //105 Gyro.ResetLevelHeat = (unsigned int)((GyroP.Str.ResetLevelHeat-0x7fff)&0xffff); Gyro.HFO_Gain = GyroP.Str.HFO_Gain; + Gyro.HFO_Gain_Reset_PLC = GyroP.Str.HFO_Gain_Reset_PLC; Gyro.HFO_ref = (unsigned int)(GyroP.Str.HFO_ref); Gyro.LG_Type = GyroP.Str.LG_Type; Gyro.LG_Type = 1; @@ -340,7 +347,7 @@ Gyro.PLC_Phase = GyroP.Str.PLC_Phase; Gyro.ModAmp = GyroP.Str.ModAmp; Gyro.FrqPhase = GyroP.Str.FrqPhase; - Gyro.AmpPer = 700;//GyroP.Str.AmpPer*100; + //Gyro.AmpPer = 700;//GyroP.Str.AmpPer*100; Gyro.Amp =(GyroP.Str.AmpPer<<17); Gyro.AmpSpeed = GyroP.Str.AmpSpeed; Gyro.AmpPerDel = GyroP.Str.AmpPerDel; @@ -351,6 +358,7 @@ Gyro.AmpPerMax = GyroP.Str.AmpPerMax; Gyro.AmpMin = GyroP.Str.AmpMin; Gyro.AmpTD = GyroP.Str.AmpTD; + F_vib=(103200000<<5)/((Gyro.Frq)>>10);//периуд вибро. T_vibP = F_vib/10000; T_vib_1 = Gyro.AmpPer * T_vibP; @@ -375,22 +383,59 @@ Gyro.Gain_Sin = GyroP.Str.Gain_Sin; Gyro.Gain_Cos = GyroP.Str.Gain_Cos; Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); - + + if(GyroP.Str.Tmp_OffsetT4&0x8000) Gyro.Tmp_OffsetT4 = GyroP.Str.Tmp_OffsetT4 - 65536; + else Gyro.Tmp_OffsetT4 = GyroP.Str.Tmp_OffsetT4; + + if(GyroP.Str.Tmp_OffsetT5&0x8000) Gyro.Tmp_OffsetT5 = GyroP.Str.Tmp_OffsetT5 - 65536; + else Gyro.Tmp_OffsetT5 = GyroP.Str.Tmp_OffsetT5; + + + - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_0 = GyroP.Str.TStatic_0; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_1 = GyroP.Str.TStatic_1; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_2 = GyroP.Str.TStatic_2; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_3 = GyroP.Str.TStatic_3; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_4 = GyroP.Str.TStatic_4; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_5 = GyroP.Str.TStatic_5; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_6 = GyroP.Str.TStatic_6; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_7 = GyroP.Str.TStatic_7; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_8 = GyroP.Str.TStatic_8; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_9 = GyroP.Str.TStatic_9; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_10 = GyroP.Str.TStatic_10; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_11 = GyroP.Str.TStatic_11; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_12 = GyroP.Str.TStatic_12; - TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_13 = GyroP.Str.TStatic_13; + if(GyroP.Str.TStatic_0&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_0 = GyroP.Str.TStatic_0 - 65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_0 = GyroP.Str.TStatic_0; + + if(GyroP.Str.TStatic_1&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_1 = GyroP.Str.TStatic_1 - 65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_1 = GyroP.Str.TStatic_1; + + if(GyroP.Str.TStatic_2&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_2 = GyroP.Str.TStatic_2-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_2 = GyroP.Str.TStatic_2; + + if(GyroP.Str.TStatic_3&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_3 = GyroP.Str.TStatic_3-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_3 = GyroP.Str.TStatic_3; + + if(GyroP.Str.TStatic_4&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_4 = GyroP.Str.TStatic_4-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_4 = GyroP.Str.TStatic_4; + + if(GyroP.Str.TStatic_5&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_5 = GyroP.Str.TStatic_5-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_5 = GyroP.Str.TStatic_5; + + if(GyroP.Str.TStatic_6&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_6 = GyroP.Str.TStatic_6-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_6 = GyroP.Str.TStatic_6; + + if(GyroP.Str.TStatic_7&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_7 = GyroP.Str.TStatic_7-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_7 = GyroP.Str.TStatic_7; + + if(GyroP.Str.TStatic_8&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_8 = GyroP.Str.TStatic_8-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_8 = GyroP.Str.TStatic_8; + + if(GyroP.Str.TStatic_9&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_9 = GyroP.Str.TStatic_9-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_9 = GyroP.Str.TStatic_9; + + if(GyroP.Str.TStatic_10&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_10 = GyroP.Str.TStatic_10-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_10 = GyroP.Str.TStatic_10; + + if(GyroP.Str.TStatic_11&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_11 = GyroP.Str.TStatic_11-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_11 = GyroP.Str.TStatic_11; + + if(GyroP.Str.TStatic_12&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_12 = GyroP.Str.TStatic_12-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_12 = GyroP.Str.TStatic_12; + + if(GyroP.Str.TStatic_13&0x8000) TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_13 = GyroP.Str.TStatic_13-65536; + else TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_13 = GyroP.Str.TStatic_13; + + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_0 = Float(GyroP.Str.TermoDeltaStatic_0, GyroP.Str.TermoDeltaStatic_1 ); @@ -408,8 +453,67 @@ TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_12 = Float(GyroP.Str.TermoDeltaStatic_24,GyroP.Str.TermoDeltaStatic_25); TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_13 = Float(GyroP.Str.TermoDeltaStatic_26,GyroP.Str.TermoDeltaStatic_27); - - TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_0 = GyroP.Str.TDCool_0; + + /* + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_0 = Float(GyroP.Str.TermoDeltaStatic_1, GyroP.Str.TermoDeltaStatic_0); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_1 = Float(GyroP.Str.TermoDeltaStatic_3, GyroP.Str.TermoDeltaStatic_2); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_2 = Float(GyroP.Str.TermoDeltaStatic_5, GyroP.Str.TermoDeltaStatic_4); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_3 = Float(GyroP.Str.TermoDeltaStatic_7, GyroP.Str.TermoDeltaStatic_6); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_4 = Float(GyroP.Str.TermoDeltaStatic_9, GyroP.Str.TermoDeltaStatic_8); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_5 = Float(GyroP.Str.TermoDeltaStatic_11,GyroP.Str.TermoDeltaStatic_10); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_6 = Float(GyroP.Str.TermoDeltaStatic_13,GyroP.Str.TermoDeltaStatic_12); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_7 = Float(GyroP.Str.TermoDeltaStatic_15,GyroP.Str.TermoDeltaStatic_14); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_8 = Float(GyroP.Str.TermoDeltaStatic_17,GyroP.Str.TermoDeltaStatic_16); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_9 = Float(GyroP.Str.TermoDeltaStatic_19,GyroP.Str.TermoDeltaStatic_18); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_10 = Float(GyroP.Str.TermoDeltaStatic_21,GyroP.Str.TermoDeltaStatic_20); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_11 = Float(GyroP.Str.TermoDeltaStatic_23,GyroP.Str.TermoDeltaStatic_22); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_12 = Float(GyroP.Str.TermoDeltaStatic_25,GyroP.Str.TermoDeltaStatic_24); + TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_13 = Float(GyroP.Str.TermoDeltaStatic_27,GyroP.Str.TermoDeltaStatic_26); + */ + if(GyroP.Str.TDCool_0&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_0 = GyroP.Str.TDCool_0-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_0 = GyroP.Str.TDCool_0; + + if(GyroP.Str.TDCool_1&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_1 = GyroP.Str.TDCool_1-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_1 = GyroP.Str.TDCool_1; + + if(GyroP.Str.TDCool_2&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_2 = GyroP.Str.TDCool_2-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_2 = GyroP.Str.TDCool_2; + + if(GyroP.Str.TDCool_3&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_3 = GyroP.Str.TDCool_3-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_3 = GyroP.Str.TDCool_3; + + if(GyroP.Str.TDCool_4&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_4 = GyroP.Str.TDCool_4-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_4 = GyroP.Str.TDCool_4; + + if(GyroP.Str.TDCool_5&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_5 = GyroP.Str.TDCool_5-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_5 = GyroP.Str.TDCool_5; + + if(GyroP.Str.TDCool_6&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_6 = GyroP.Str.TDCool_6-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_6 = GyroP.Str.TDCool_6; + + if(GyroP.Str.TDCool_7&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_7 = GyroP.Str.TDCool_7-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_7 = GyroP.Str.TDCool_7; + + if(GyroP.Str.TDCool_8&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_8 = GyroP.Str.TDCool_8-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_8 = GyroP.Str.TDCool_8; + + if(GyroP.Str.TDCool_9&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_9 = GyroP.Str.TDCool_9-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_9 = GyroP.Str.TDCool_9; + + if(GyroP.Str.TDCool_10&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_10 = GyroP.Str.TDCool_10-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_10 = GyroP.Str.TDCool_10; + + if(GyroP.Str.TDCool_11&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_11 = GyroP.Str.TDCool_11-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_11 = GyroP.Str.TDCool_11; + + if(GyroP.Str.TDCool_12&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_12 = GyroP.Str.TDCool_12-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_12 = GyroP.Str.TDCool_12; + + if(GyroP.Str.TDCool_13&0x8000) TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_13 = GyroP.Str.TDCool_13-65536; + else TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_13 = GyroP.Str.TDCool_13; + + /* + TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_0 = GyroP.Str.TDCool_0; TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_1 = GyroP.Str.TDCool_1; TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_2 = GyroP.Str.TDCool_2; TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_3 = GyroP.Str.TDCool_3; @@ -424,22 +528,22 @@ TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_12 = GyroP.Str.TDCool_12; TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_13 = GyroP.Str.TDCool_13; - +*/ - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_0 = Float(GyroP.Str.TermoDynamicDataHeat0, GyroP.Str.TermoDynamicDataHeat1 ); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_1 = Float(GyroP.Str.TermoDynamicDataHeat2, GyroP.Str.TermoDynamicDataHeat3 ); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_2 = Float(GyroP.Str.TermoDynamicDataHeat4, GyroP.Str.TermoDynamicDataHeat5 ); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_3 = Float(GyroP.Str.TermoDynamicDataHeat6, GyroP.Str.TermoDynamicDataHeat7 ); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_4 = Float(GyroP.Str.TermoDynamicDataHeat8, GyroP.Str.TermoDynamicDataHeat9 ); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_5 = Float(GyroP.Str.TermoDynamicDataHeat10,GyroP.Str.TermoDynamicDataHeat11); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_6 = Float(GyroP.Str.TermoDynamicDataHeat12,GyroP.Str.TermoDynamicDataHeat13); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_7 = Float(GyroP.Str.TermoDynamicDataHeat14,GyroP.Str.TermoDynamicDataHeat15); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_8 = Float(GyroP.Str.TermoDynamicDataHeat16,GyroP.Str.TermoDynamicDataHeat17); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_9 = Float(GyroP.Str.TermoDynamicDataHeat18,GyroP.Str.TermoDynamicDataHeat19); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_10 = Float(GyroP.Str.TermoDynamicDataHeat20,GyroP.Str.TermoDynamicDataHeat21); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_11 = Float(GyroP.Str.TermoDynamicDataHeat22,GyroP.Str.TermoDynamicDataHeat23); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_12 = Float(GyroP.Str.TermoDynamicDataHeat24,GyroP.Str.TermoDynamicDataHeat25); - TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_13 = Float(GyroP.Str.TermoDynamicDataHeat26,GyroP.Str.TermoDynamicDataHeat27); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_0 = Float(GyroP.Str.TermoDynamicData_0, GyroP.Str.TermoDynamicData_1 ); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_1 = Float(GyroP.Str.TermoDynamicData_2, GyroP.Str.TermoDynamicData_3 ); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_2 = Float(GyroP.Str.TermoDynamicData_4, GyroP.Str.TermoDynamicData_5 ); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_3 = Float(GyroP.Str.TermoDynamicData_6, GyroP.Str.TermoDynamicData_7 ); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_4 = Float(GyroP.Str.TermoDynamicData_8, GyroP.Str.TermoDynamicData_9 ); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_5 = Float(GyroP.Str.TermoDynamicData_10, GyroP.Str.TermoDynamicData_11); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_6 = Float(GyroP.Str.TermoDynamicData_12, GyroP.Str.TermoDynamicData_13); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_7 = Float(GyroP.Str.TermoDynamicData_14, GyroP.Str.TermoDynamicData_15); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_8 = Float(GyroP.Str.TermoDynamicData_16, GyroP.Str.TermoDynamicData_17); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_9 = Float(GyroP.Str.TermoDynamicData_18, GyroP.Str.TermoDynamicData_19); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_10 = Float(GyroP.Str.TermoDynamicData_20, GyroP.Str.TermoDynamicData_21); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_11 = Float(GyroP.Str.TermoDynamicData_22, GyroP.Str.TermoDynamicData_23); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_12 = Float(GyroP.Str.TermoDynamicData_24, GyroP.Str.TermoDynamicData_25); + TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_13 = Float(GyroP.Str.TermoDynamicData_26, GyroP.Str.TermoDynamicData_27); } else { @@ -541,11 +645,11 @@ Last_QEI=0; } void BUTTON_init(void) { - LPC_GPIO0->FIODIR &= ~(1 << 1); /* PORT2.10 defined as input */ - LPC_GPIOINT->IO0IntEnF |= (1 << 1); /* enable falling edge irq */ + if(Gyro.EXT_Latch)Gyro.EXT_Latch=0; + else Gyro.EXT_Latch=1; + LPC_GPIOINT->IO2IntClr |= (1 << 10); +} - NVIC_EnableIRQ(EINT3_IRQn); /* enable irq in nvic */ -} /*void EINT3_IRQHandler() { if(Gyro.EXT_Latch)Gyro.EXT_Latch=0;