![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: Global.c
- Revision:
- 209:224e7331a061
- Parent:
- 208:19150d2b528f
- Child:
- 210:b02fa166315d
--- a/Global.c Tue Feb 07 10:11:35 2017 +0000 +++ b/Global.c Thu Apr 13 14:14:45 2017 +0000 @@ -7,17 +7,21 @@ unsigned char Time[1000]; unsigned int Event1Hz; unsigned int Event100Hz; +unsigned int Event250Hz; unsigned int Event500Hz; unsigned int Event1K; +unsigned int Event2K; unsigned int Event100K; unsigned int EventVibro; - +unsigned int MODFlag=2; unsigned int Time250Hz; unsigned int Event250Hz; unsigned int Time100K; unsigned int Time1K; +unsigned int Time2K; unsigned int Time500Hz; +unsigned int Time250Hz; unsigned int Time1Hz; unsigned int Time100Hz; unsigned int Clock1Hz; @@ -70,7 +74,7 @@ Pulse_16Point = 0; Pulse_16PointD = 0; Pulse_32Point = 0; - Gyro.FlashMod=0; + Gyro.FlashMod = 0; ///////////////////////////////////////////// @@ -84,20 +88,21 @@ Gyro.DropDelayGLD = DropDelayGLD_0;//задержка на выдачу 45 микросекунд для любого адреса ГЛД Gyro.PLC_Error2Mode = 1400; Gyro.SOC_Out = 0xDD; - + + Gyro.RgConMod = 1; GyroP.Str.ParamMod=0; - ReadFlash (); + + ReadFlash (); + // GyroP.Str.ParamMod=0; if(GyroP.Str.ParamMod) { Gyro.My_Addres = GyroP.Str.My_Addres; // Gyro.My_Addres = 0; - Gyro.GLD_Serial = GyroP.Str.GLD_Serial; - - - Gyro.FrqHZ = GyroP.Str.FrqHZ; - Gyro.Frq = GyroP.Str.FrqHZ<<16; - Gyro.FrqHZmin = GyroP.Str.FrqHZmin<<16; - Gyro.FrqHZmax = GyroP.Str.FrqHZmax<<16; + Gyro.GLD_Serial = GyroP.Str.GLD_Serial; + Gyro.FrqHZ = (7680000/GyroP.Str.FrqHZ); + Gyro.Frq = ((7680000/GyroP.Str.FrqHZ)<<16); + Gyro.FrqHZmin = ((7680000/GyroP.Str.FrqHZmin)<<16); + Gyro.FrqHZmax = ((7680000/GyroP.Str.FrqHZmax)<<16); Gyro.FrqChengSpeed = GyroP.Str.FrqChengSpeed; Gyro.PLC_Gain = GyroP.Str.PLC_Gain; Gyro.PLC_Phase = GyroP.Str.PLC_Phase; @@ -114,13 +119,12 @@ Gyro.AmpPerMax = GyroP.Str.AmpPerMax; Gyro.AmpMin = GyroP.Str.AmpMin; Gyro.AmpTD = GyroP.Str.AmpTD; - Spi.DAC_A = GyroP.Str.DAC_current_Work; + 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; // Spi.DAC_A = GyroP.Str.DAC_A; - - // Spi.DAC_B = GyroP.Str.DAC_B; - + // Spi.DAC_B = GyroP.Str.DAC_B; Gyro.Gain_Sin = GyroP.Str.Gain_Sin; Gyro.Gain_Cos = GyroP.Str.Gain_Cos; Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); @@ -151,7 +155,7 @@ Gyro.PLC_Error2Mode = 1400; //для записи мод Gyro.Gain_Sin = 175; Gyro.Gain_Cos = 215; - Gyro.Firmware_Version = 0x9; //версия программы + Gyro.Firmware_Version = 0x11; //версия программы Gyro.GLD_Serial = 123; //серийный номер Gyro.My_Addres = 0; //адрес глд Gyro.Tmp_OffsetT4 = 0; @@ -164,19 +168,19 @@ } switch(Gyro.My_Addres){//смещение поджига и подсветки в зависимости от адреса ГЛД case 0: - Gyro.Discharg = StartDischarg << ShiftStart0; + Gyro.Discharg = StartDischarg << ShiftStart0; Gyro.BackLight = StartBackLight << ShiftStart0; break; case 1: - Gyro.Discharg = StartDischarg << ShiftStart1; + Gyro.Discharg = StartDischarg << ShiftStart1; Gyro.BackLight = StartBackLight << ShiftStart1; break; case 2: - Gyro.Discharg = StartDischarg << ShiftStart2; + Gyro.Discharg = StartDischarg << ShiftStart2; Gyro.BackLight = StartBackLight << ShiftStart2; break; case 3: - Gyro.Discharg = StartDischarg << ShiftStart3; + Gyro.Discharg = StartDischarg << ShiftStart3; Gyro.BackLight = StartBackLight << ShiftStart3; break; }