![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Diff: Global.c
- Revision:
- 211:ac8251b067d2
- Parent:
- 210:b02fa166315d
- Child:
- 214:4c70e452c491
diff -r b02fa166315d -r ac8251b067d2 Global.c --- a/Global.c Mon Apr 24 05:43:54 2017 +0000 +++ b/Global.c Mon Jul 03 05:50:08 2017 +0000 @@ -13,7 +13,7 @@ unsigned int Event2K; unsigned int Event100K; unsigned int EventVibro; -unsigned int MODFlag=2; +unsigned int MODFlag=0; unsigned int Time250Hz; unsigned int Event250Hz; @@ -42,7 +42,7 @@ InitMOD(); - +Gyro.CuruAngleLog=0; Global_Time = 0; Time_UART = 0; Time_Sec = 0; @@ -96,7 +96,17 @@ ReadFlash (); // GyroP.Str.ParamMod=0; if(GyroP.Str.ParamMod) - { + { + + Gyro.PLC_Start = 0x7fff+GyroP.Str.PLC_Start; + Gyro.DownTreshold = 0x7fff+GyroP.Str.DownTreshold; //27 + Gyro.HighTreshold = 0x7fff+GyroP.Str.HighTreshold; + Gyro.PLCDelay = GyroP.Str.PLCDelay/10; + Gyro.ResetLevelCool = 0x7fff+GyroP.Str.ResetLevelCool; //105 + Gyro.ResetLevelHeat = 0x7fff+GyroP.Str.ResetLevelHeat; + Gyro.HFO_Gain = GyroP.Str.HFO_Gain; + Gyro.HFO_ref = (unsigned int)(GyroP.Str.HFO_ref)*0.82; + Gyro.LG_Type = GyroP.Str.LG_Type; Gyro.My_Addres = GyroP.Str.My_Addres; // Gyro.My_Addres = 0; Gyro.GLD_Serial = GyroP.Str.GLD_Serial; Gyro.FrqHZ = (7680000/GyroP.Str.FrqHZ); @@ -119,7 +129,14 @@ Gyro.AmpPerMax = GyroP.Str.AmpPerMax; Gyro.AmpMin = GyroP.Str.AmpMin; Gyro.AmpTD = GyroP.Str.AmpTD; - Spi.DAC_A = ((((int)(GyroP.Str.DAC_current_Work+0x7fff) & 0xffff)+22544)*0.65); + + + if(Gyro.LG_Type==1){ + Gyro.HFO_Max=((int)(GyroP.Str.DAC_current_Work*0.67)-2000); + Gyro.HFO_Min=((int)(GyroP.Str.DAC_current_Start*0.67)-2000); + + } + else Spi.DAC_A = ((((int)(GyroP.Str.DAC_current_Work+0x7fff) & 0xffff)+22544)*0.65); Gyro.DacIn = GyroP.Str.DAC_current_Work; // Gyro.TermoNKU = GyroP.Str.TermoNKU<<2; Gyro.Firmware_Version = 0x11; @@ -131,7 +148,13 @@ } else { - + Gyro.DownTreshold = GyroP.Str.DownTreshold; //27 + Gyro.HighTreshold = GyroP.Str.HighTreshold; + Gyro.PLCDelay = 30000; + Gyro.ResetLevelCool = 56000; //105 + Gyro.ResetLevelHeat = 15000; + Gyro.HFO_ref = 13000; + Gyro.LG_Type = 0; Gyro.PLC_Phase = 3; Gyro.PLC_Gain = 3; Gyro.FrqPhase = 8; @@ -151,7 +174,7 @@ Gyro.AmpMin = 20;// минимальное значение AmpT;5 Gyro.AmpTD = 20;//////////////////////////////////////////////////////// Gyro.TermoNKU = 44700;//48824*0,0061-273=25 С° - Spi.DAC_B = 32220; + Spi.DAC_B = Gyro.PLC_Start; Gyro.PLC_Error2Mode = 1400; //для записи мод Gyro.Gain_Sin = 175; Gyro.Gain_Cos = 215; @@ -165,7 +188,9 @@ Gyro.DAC_current_Work =50000; //3 Gyro.DAC_current_Start =41000; + } + Spi.DAC_B=Gyro.PLC_Start; switch(Gyro.My_Addres){//смещение поджига и подсветки в зависимости от адреса ГЛД case 0: Gyro.Discharg = StartDischarg << ShiftStart0;