![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: Command.c
- Revision:
- 232:130a2b5003e6
- Parent:
- 231:079835d508ef
--- a/Command.c Thu Jan 25 13:59:43 2018 +0000 +++ b/Command.c Wed Jan 31 13:41:23 2018 +0000 @@ -113,7 +113,29 @@ case 1: if(Gyro.Rate1_Event ) CMD_Rate(); break; case 2: if(Gyro.Reper_Event ) CMD_Rate2(); break; case 3: if(Gyro.Event_500Hz ) CMD_Delta_PS(); break; - case 4: if(Gyro.EXT_Latch ) CMD_Delta_PS(); Gyro.EXT_Latch=0; break; + case 4: + + if(Gyro.EXT_Latch ){ + Gyro.EXT_Latch=0; + LoopOn + LoopOn + LoopOn + LoopOn + LoopOn + LoopOn + + LoopOn + LoopOn + LoopOn + LoopOn + + LoopOn + CMD_Delta_PS(); + + LoopOff + //NVIC_EnableIRQ(EINT3_IRQn); + } + break; case 5: if(Gyro.Event_500Hz ) CMD_Delta_Bins(); break; case 6: if(Gyro.EXT_Latch ) CMD_B_Delta(); Gyro.EXT_Latch=0; break; case 7: if(Gyro.Event_500Hz ) CMD_B_Delta(); break; @@ -245,46 +267,182 @@ } - return SimpleFloat.num*10000; + return SimpleFloat.num; } -void Switch(unsigned int NP) -{ - unsigned int TempTermodataHi, TempTermodataLo; - switch(NP) + +void CMD_M_Param_W(void) +{ + unsigned int NP=0; + unsigned int Param,temp,flash; + unsigned int TempTermodataHi, TempTermodataLo; + float Ttemp; + + NP = BuffTemp[3]; + Param = (BuffTemp[4]<<8); + Param |= BuffTemp[5]; + + GyroP.Array[NP] = Param; + flash=GyroP.Array[115]; + Gyro.NP=NP; + WriteCon(Time); + switch(NP) { - case 63: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_0 = GyroP.Str.TStatic_0; break; - case 64: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_1 = GyroP.Str.TStatic_1; break; - case 65: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_2 = GyroP.Str.TStatic_2; break; - case 66: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_3 = GyroP.Str.TStatic_3; break; - case 67: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_4 = GyroP.Str.TStatic_4; break; - case 68: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_5 = GyroP.Str.TStatic_5; break; - case 69: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_6 = GyroP.Str.TStatic_6; break; - case 70: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_7 = GyroP.Str.TStatic_7; break; - case 71: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_8 = GyroP.Str.TStatic_8; break; - case 72: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_9 = GyroP.Str.TStatic_9; break; - case 73: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_10 = GyroP.Str.TStatic_10; break; - case 74: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_11 = GyroP.Str.TStatic_11; break; - case 75: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_12 = GyroP.Str.TStatic_12; break; - case 76: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_13 = GyroP.Str.TStatic_13; break; - + case 63: + 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; + break; + + case 64: + 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; + break; + + case 65: + 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; + break; + + case 66: + 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; + break; + + case 67: + 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; + break; + + case 68: + 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; + break; + + case 69: + 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; + break; + + case 70: + 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; + break; + + case 71: + 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; + break; + + case 72: + 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; + break; + + case 73: + 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; + break; + + case 74: + 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; + break; + + case 75: + 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; + break; + + case 76: + 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; + break; + + + + + + + - case 160: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_0 = GyroP.Str.TDCool_0; break; - case 161: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_1 = GyroP.Str.TDCool_1; break; - case 162: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_2 = GyroP.Str.TDCool_2; break; - case 163: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_3 = GyroP.Str.TDCool_3; break; - case 164: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_4 = GyroP.Str.TDCool_4; break; - case 165: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_5 = GyroP.Str.TDCool_5; break; - case 166: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_6 = GyroP.Str.TDCool_6; break; - case 167: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_7 = GyroP.Str.TDCool_7; break; - case 168: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_8 = GyroP.Str.TDCool_8; break; - case 169: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_9 = GyroP.Str.TDCool_9; break; - case 170: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_10 = GyroP.Str.TDCool_10; break; - case 171: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_11 = GyroP.Str.TDCool_11; break; - case 172: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_12 = GyroP.Str.TDCool_12; break; - case 173: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_13 = GyroP.Str.TDCool_13; break; + case 160: + 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; + break; + + case 161: + 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; + break; + + case 162: + 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; + break; + + case 163: + 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; + break; + + case 164: + 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; + break; + + case 165: + 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; + break; + + case 166: + 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; + break; - + case 167: + 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; + break; + + case 168: + 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; + break; + + case 169: + 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; + break; + + case 170: + 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; + break; + + case 171: + 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; + break; + + case 172: + 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; + break; + + case 173: + 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; + break; + + + + + + + + + case 78: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_0 = Float(GyroP.Str.TermoDeltaStatic_0, GyroP.Str.TermoDeltaStatic_1 ); break; case 80: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_1 = Float(GyroP.Str.TermoDeltaStatic_2, GyroP.Str.TermoDeltaStatic_3 ); break; case 82: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_2 = Float(GyroP.Str.TermoDeltaStatic_4, GyroP.Str.TermoDeltaStatic_5 ); break; @@ -298,78 +456,27 @@ case 98: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_10 = Float(GyroP.Str.TermoDeltaStatic_20,GyroP.Str.TermoDeltaStatic_21); break; case 100: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_11 = Float(GyroP.Str.TermoDeltaStatic_22,GyroP.Str.TermoDeltaStatic_23); break; case 102: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_12 = Float(GyroP.Str.TermoDeltaStatic_24,GyroP.Str.TermoDeltaStatic_25); break; - case 104: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_13 = Float(GyroP.Str.TermoDeltaStatic_26,GyroP.Str.TermoDeltaStatic_27); break; - case 175: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_0 = Float(GyroP.Str.TermoDynamicDataHeat0, GyroP.Str.TermoDynamicDataHeat1 ); break; - case 177: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_1 = Float(GyroP.Str.TermoDynamicDataHeat2, GyroP.Str.TermoDynamicDataHeat3 ); break; - case 179: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_2 = Float(GyroP.Str.TermoDynamicDataHeat4, GyroP.Str.TermoDynamicDataHeat5 ); break; - case 181: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_3 = Float(GyroP.Str.TermoDynamicDataHeat6, GyroP.Str.TermoDynamicDataHeat7 ); break; - case 183: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_4 = Float(GyroP.Str.TermoDynamicDataHeat8, GyroP.Str.TermoDynamicDataHeat9 ); break; - case 185: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_5 = Float(GyroP.Str.TermoDynamicDataHeat10,GyroP.Str.TermoDynamicDataHeat11); break; - case 187: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_6 = Float(GyroP.Str.TermoDynamicDataHeat12,GyroP.Str.TermoDynamicDataHeat13); break; - case 189: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_7 = Float(GyroP.Str.TermoDynamicDataHeat14,GyroP.Str.TermoDynamicDataHeat15); break; - case 191: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_8 = Float(GyroP.Str.TermoDynamicDataHeat16,GyroP.Str.TermoDynamicDataHeat17); break; - case 193: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_9 = Float(GyroP.Str.TermoDynamicDataHeat18,GyroP.Str.TermoDynamicDataHeat19); break; - case 195: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_10 = Float(GyroP.Str.TermoDynamicDataHeat20,GyroP.Str.TermoDynamicDataHeat21); break; - case 197: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_11 = Float(GyroP.Str.TermoDynamicDataHeat22,GyroP.Str.TermoDynamicDataHeat23); break; - case 199: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_12 = Float(GyroP.Str.TermoDynamicDataHeat24,GyroP.Str.TermoDynamicDataHeat25); break; - case 201: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_13 = Float(GyroP.Str.TermoDynamicDataHeat26,GyroP.Str.TermoDynamicDataHeat27); break; - } - -} -void CMD_M_Param_W(void) -{ - unsigned int NP=0; - unsigned int Param,temp,flash; - unsigned int TempTermodataHi, TempTermodataLo; - float Ttemp; - - NP = BuffTemp[3]; - Param = (BuffTemp[4]<<8); - Param |= BuffTemp[5]; - - GyroP.Array[NP] = Param; - flash=GyroP.Array[115]; - sprintf((Time),"READ NP= <%07d> Param = <%07d> \r\n", NP, Param); - WriteCon(Time); - Gyro.NP=NP; - // Switch(NP); - - switch(NP) - { - case 63: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_0 = GyroP.Str.TStatic_0; break; - case 64: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_1 = GyroP.Str.TStatic_1; break; - case 65: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_2 = GyroP.Str.TStatic_2; break; - case 66: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_3 = GyroP.Str.TStatic_3; break; - case 67: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_4 = GyroP.Str.TStatic_4; break; - case 68: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_5 = GyroP.Str.TStatic_5; break; - case 69: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_6 = GyroP.Str.TStatic_6; break; - case 70: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_7 = GyroP.Str.TStatic_7; break; - case 71: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_8 = GyroP.Str.TStatic_8; break; - case 72: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_9 = GyroP.Str.TStatic_9; break; - case 73: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_10 = GyroP.Str.TStatic_10; break; - case 74: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_11 = GyroP.Str.TStatic_11; break; - case 75: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_12 = GyroP.Str.TStatic_12; break; - case 76: TermoCorrStatic.TermoTempStatic.Str.TermoTempStatic_13 = GyroP.Str.TStatic_13; break; - - - case 160: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_0 = GyroP.Str.TDCool_0; break; - case 161: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_1 = GyroP.Str.TDCool_1; break; - case 162: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_2 = GyroP.Str.TDCool_2; break; - case 163: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_3 = GyroP.Str.TDCool_3; break; - case 164: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_4 = GyroP.Str.TDCool_4; break; - case 165: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_5 = GyroP.Str.TDCool_5; break; - case 166: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_6 = GyroP.Str.TDCool_6; break; - case 167: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_7 = GyroP.Str.TDCool_7; break; - case 168: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_8 = GyroP.Str.TDCool_8; break; - case 169: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_9 = GyroP.Str.TDCool_9; break; - case 170: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_10 = GyroP.Str.TDCool_10; break; - case 171: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_11 = GyroP.Str.TDCool_11; break; - case 172: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_12 = GyroP.Str.TDCool_12; break; - case 173: TermoCorrDynamic.TermoTempDynamic.Str.TermoTempDynamic_13 = GyroP.Str.TDCool_13; break; - - - - //case 0: Gyro.My_Addres = GyroP.Str.My_Addres; break; + case 104: TermoCorrStatic.TermoDeltaStatic.Str.TermoDeltaStatic_13 = Float(GyroP.Str.TermoDeltaStatic_26,GyroP.Str.TermoDeltaStatic_27); break; + + case 175: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_0 = Float(GyroP.Str.TermoDynamicData_0, GyroP.Str.TermoDynamicData_1 ); break; + case 177: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_1 = Float(GyroP.Str.TermoDynamicData_2, GyroP.Str.TermoDynamicData_3 ); break; + case 179: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_2 = Float(GyroP.Str.TermoDynamicData_4, GyroP.Str.TermoDynamicData_5 ); break; + case 181: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_3 = Float(GyroP.Str.TermoDynamicData_6, GyroP.Str.TermoDynamicData_7 ); break; + case 183: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_4 = Float(GyroP.Str.TermoDynamicData_8, GyroP.Str.TermoDynamicData_9 ); break; + case 185: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_5 = Float(GyroP.Str.TermoDynamicData_10, GyroP.Str.TermoDynamicData_11); break; + case 187: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_6 = Float(GyroP.Str.TermoDynamicData_12, GyroP.Str.TermoDynamicData_13); break; + case 189: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_7 = Float(GyroP.Str.TermoDynamicData_14, GyroP.Str.TermoDynamicData_15); break; + case 191: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_8 = Float(GyroP.Str.TermoDynamicData_16, GyroP.Str.TermoDynamicData_17); break; + case 193: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_9 = Float(GyroP.Str.TermoDynamicData_18, GyroP.Str.TermoDynamicData_19); break; + case 195: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_10 = Float(GyroP.Str.TermoDynamicData_20, GyroP.Str.TermoDynamicData_21); break; + case 197: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_11 = Float(GyroP.Str.TermoDynamicData_22, GyroP.Str.TermoDynamicData_23); break; + case 199: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_12 = Float(GyroP.Str.TermoDynamicData_24, GyroP.Str.TermoDynamicData_25); break; + case 201: TermoCorrDynamic.TermoDeltaDynamic.Str.TermoDeltaDynamic_13 = Float(GyroP.Str.TermoDynamicData_26, GyroP.Str.TermoDynamicData_27); break; + + + + //case 0: Gyro.My_Addres = GyroP.Str.My_Addres; break; + case 159: Gyro.step = GyroP.Str.Step; break; case 1: Gyro.HFO_ref = (unsigned int)(GyroP.Str.HFO_ref) ; break; case 2: Gyro.HFO_Gain = GyroP.Str.HFO_Gain; break; case 3: if(Gyro.LG_Type) Gyro.HFO_Max=0xffff-GyroP.Str.DAC_current_Work; //((int)(GyroP.Str.DAC_current_Work*0.67)-2000); @@ -417,19 +524,32 @@ case 57: Gyro.Gain_Cos = GyroP.Str.Gain_Cos; Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); break; - case 60: Gyro.GLD_Serial = GyroP.Str.GLD_Serial; break; + case 60: Gyro.GLD_Serial = GyroP.Str.GLD_Serial; break; + // case 62: Gyro.TermoMod = GyroP.Str.TermoMode; break; + + case 10: Gyro.DownTreshold = (unsigned int)((GyroP.Str.DownTreshold-0x7fff)&0xffff); break; + case 11: Gyro.HighTreshold = (unsigned int)((GyroP.Str.HighTreshold-0x7fff)&0xffff); break; + + case 9: Gyro.PLCDelay = GyroP.Str.PLCDelay; break; + + case 105:Gyro.ResetLevelCool = (unsigned int)((GyroP.Str.ResetLevelCool-0x7fff)&0xffff); break; + case 116:Gyro.HFO_Gain_Reset_PLC = GyroP.Str.HFO_Gain_Reset_PLC; break; + case 55: Gyro.ResetLevelHeat = (unsigned int)((GyroP.Str.ResetLevelHeat-0x7fff)&0xffff); break; - case 10: Gyro.DownTreshold = (unsigned int)((GyroP.Str.DownTreshold-0x7fff)&0xffff); break; - case 11: Gyro.HighTreshold = (unsigned int)((GyroP.Str.HighTreshold-0x7fff)&0xffff); break; - case 9: Gyro.PLCDelay = GyroP.Str.PLCDelay; break; - case 105:Gyro.ResetLevelCool = (unsigned int)((GyroP.Str.ResetLevelCool-0x7fff)&0xffff); break; - case 55: Gyro.ResetLevelHeat = (unsigned int)((GyroP.Str.ResetLevelHeat-0x7fff)&0xffff); break; - + case 47: + if(GyroP.Str.Tmp_OffsetT4&0x8000) Gyro.Tmp_OffsetT4 = GyroP.Str.Tmp_OffsetT4 - 65536; + else Gyro.Tmp_OffsetT4 = GyroP.Str.Tmp_OffsetT4; + break; + + case 48: + if(GyroP.Str.Tmp_OffsetT5&0x8000) Gyro.Tmp_OffsetT5 = GyroP.Str.Tmp_OffsetT5 - 65536; + else Gyro.Tmp_OffsetT5 = GyroP.Str.Tmp_OffsetT5; + break; - default : Gyro.ParamFlag=1; + } @@ -500,7 +620,8 @@ } void CMD_Delta_Bins(void) -{ Gyro.Event_500Hz=0; +{ + Gyro.Event_500Hz=0; unsigned int Temp; BuffTemp[ 0] = Gyro.SOC_Out; BuffTemp[ 1] = Gyro.My_Addres; @@ -519,17 +640,15 @@ void CMD_Delta_PS(void) { int drob,Temp1; float Temp2=0; - Gyro.EXT_Latch=0; - Gyro.Event_500Hz=0; + unsigned int Temp; - - - + + Gyro.Event_500Hz=0; BuffTemp[ 0] = Gyro.SOC_Out; BuffTemp[ 1] = Gyro.My_Addres; - - Gyro.CuruAngle = Gyro.CuruAngle + OldCuruAngle; //(72 град/с) - + Gyro.CuruAngle = Gyro.CuruAngle + OldCuruAngle + Gyro.AngelCompens; + + Gyro.AngelCompens=0; OldCuruAngle=Gyro.CuruAngle & 0xf; //сохраняем 3 бит для след измирений Temp=Gyro.CuruAngle>>4; //приводим к форме вывода @@ -687,10 +806,10 @@ Check(BuffTemp, CRC_N); WriteConN (BuffTemp,CRC_N); - + if(CountParam>20)CountParam=0;//зацикливания буфера от 0 до 21 else CountParam++; - + } @@ -736,15 +855,18 @@ BuffTemp[ 0] = Gyro.SOC_Out; //1 --старт данных BuffTemp[ 1] = Gyro.My_Addres; //2 --адрес отвечающего устройствва - BuffTemp[ 2] =( Gyro.CaunPlusReper >> 8) & 0xff;//старший байт счетчика +. 3 --сарший байт счентчика + - BuffTemp[ 3] =( Gyro.CaunPlusReper >> 0) & 0xff;//младший байт счетчика +. 4 --младший байт счетчика + + BuffTemp[ 2] =( Gyro.CaunPlusReper >> 8) & 0xff;//старший байт счетчика +. 3 --сарший байт счентчика + + BuffTemp[ 3] =( Gyro.CaunPlusReper >> 0) & 0xff;//младший байт счетчика +. 4 --младший байт счетчика + BuffTemp[ 4] =( Gyro.CaunMinReper >> 8) & 0xff;//старший байт счетчика -. 5 --сарший байт счентчика - BuffTemp[ 5] =( Gyro.CaunMinReper >> 0) & 0xff;//младший байт счетчика -. 6 --младший байт счетчика - + + - Gyro.CuruAngle = Gyro.CuruAngle + OldCuruAngle; //(72 град/с) - OldCuruAngle=Gyro.CuruAngle & 0x3f; //сохраняем 5 бит для след измирений - Temp=Gyro.CuruAngle>>6; //приводим к форме вывода + Gyro.CuruAngle = Gyro.CuruAngle + OldCuruAngle + Gyro.AngelCompens; //(72 град/с) + + OldCuruAngle=Gyro.CuruAngle & 0x3f; //сохраняем 5 бит для след измирений + Temp=Gyro.CuruAngle>>6; //приводим к форме вывода Gyro.AngelCompens=0; Gyro.CuruAngle = 0; @@ -808,24 +930,24 @@ BuffTemp[26] = (Temp >> 8) & 0xff; //27 ADC 0 BuffTemp[27] = (Temp >> 0) & 0xff; //28 - Temp =0; /*Gyro.AD_Slow >> 16*/; + Temp = 0; /*Gyro.AD_Slow >> 16*/; BuffTemp[28] = (Temp >> 8) & 0xff; //29 ADC 1 BuffTemp[29] = (Temp >> 0) & 0xff; //30 - Temp1 = 0;//((Gyro.In1>>1)*0.800875)-0x3e0b; + Temp1 =Gyro.DeltaTRate;//((Gyro.In1>>1)*0.800875)-0x3e0b; BuffTemp[30] = (Temp1 >> 8) & 0xff;//in1//2 //31 ADC 2 BuffTemp[31] = (Temp1 >> 0) & 0xff; //32 - Temp1 =0;//((Gyro.In2>>1)*0.800875)-0x3e0b;// - 0x4FFF; + Temp1 =Gyro.DeltaTRate/163;//((Gyro.In2>>1)*0.800875)-0x3e0b;// - 0x4FFF; BuffTemp[32] = (Temp1 >> 8) & 0xff; //33 ADC 3 BuffTemp[33] = (Temp1 >> 0) & 0xff;//in2//3 //34 - Temp = (Gyro.DeltaT); + Temp = Gyro.Termo; BuffTemp[34] = (Temp >> 8) & 0xff;//дельта //35 ADC 4 BuffTemp[35] = (Temp >> 0) & 0xff; //36 // Temp = 000; - Temp = Gyro.Termo; + Temp = (Gyro.DeltaT); BuffTemp[36] =(Temp >> 8) & 0xff;//температура //37 ADC 5 BuffTemp[37] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 //38