![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: Global.c
- Revision:
- 206:00341a03e05c
- Parent:
- 205:775d54fdf646
- Child:
- 207:d1ce992f5d17
--- a/Global.c Mon Dec 19 14:08:31 2016 +0000 +++ b/Global.c Tue Dec 20 14:08:17 2016 +0000 @@ -33,6 +33,7 @@ void Param_init(void) { InitMOD(); + Gyro.RgConA = 0xffff; Gyro.RgConB = 0xffff; Global_Time = 0; @@ -68,7 +69,7 @@ Pulse_32Point = 0; Gyro.FlashMod=0; - Gyro.DropDelayGLD = DropDelayGLD_0;//задержка на выдачу 45 микросекунд для любого адреса ГЛД + ///////////////////////////////////////////// ///////////инициализация таймеров//////////// @@ -77,33 +78,74 @@ Init_TIM2(); //Timer 2: CCLK / 4 / 250 = 100kHz ///////////////////////////////////////////// /////////////инициализация переменных в структ вибро///////////////// + + Gyro.DropDelayGLD = DropDelayGLD_0;//задержка на выдачу 45 микросекунд для любого адреса ГЛД + Gyro.PLC_Error2Mode = 1400; + Gyro.SOC_Out = 0xDD; + + + GyroP.Str.ParamMod=0; + ReadFlash (); + if(GyroP.Str.ParamMod==11223) + { + Gyro.My_Addres = GyroP.Str.My_Addres; // Gyro.My_Addres = 0; + Gyro.GLD_Serial = GyroP.Str.GLD_Serial; + Gyro.Firmware_Version = GyroP.Str.Firmware_Version; - Gyro.FrqHZ = 388; - Gyro.Frq = Gyro.FrqHZ<<16; - Gyro.FrqHZmin = 350<<16; - Gyro.FrqHZmax = 450<<16; - Gyro.FrqChengSpeed = 100; - Gyro.ModAmp = 250; - Gyro.AmpPer = 40; - Gyro.AmpPerMin = 1; - Gyro.AmpPerMax = 90; - Gyro.AmpSpeed = 1; - Gyro.AmpPerDel = 5; - Gyro.AmpTarget = 5800;// целевая амплитуда ВП - Gyro.Amp = 30*65535; - Gyro.AmpMin = 15;// минимальное значение AmpT;5 - Gyro.AmpTD = 30;//////////////////////////////////////////////////////// - Gyro.TermoNKU = 44700;//48824*0,0061-273=25 С° - Spi.DAC_A = 41000; - Spi.DAC_B = 35220; - Gyro.PLC_Error2Mode = 1400; //для записи мод - Gyro.Gain_Sin = 115; - Gyro.Gain_Cos = 175; - Gyro.SOC_Out = 0xDD; + Gyro.FrqHZ = GyroP.Str.FrqHZ; + Gyro.Frq = GyroP.Str.FrqHZ<<16; + Gyro.FrqHZmin = GyroP.Str.FrqHZmin<<16; + Gyro.FrqHZmax = GyroP.Str.FrqHZmax<<16; + Gyro.FrqChengSpeed = GyroP.Str.FrqChengSpeed; + + Gyro.ModAmp = GyroP.Str.ModAmp; + + Gyro.AmpPer = GyroP.Str.AmpPer; + Gyro.Amp = GyroP.Str.AmpPer<<16; + Gyro.AmpSpeed = GyroP.Str.AmpSpeed; + Gyro.AmpPerDel = GyroP.Str.AmpPerDel; + Gyro.AmpTarget = GyroP.Str.AmpTarget; + Gyro.AmpPerMin = GyroP.Str.AmpPerMin; + Gyro.AmpPerMax = GyroP.Str.AmpPerMax; + Gyro.AmpMin = GyroP.Str.AmpMin; + Gyro.AmpTD = GyroP.Str.AmpTD; + + Gyro.TermoNKU = GyroP.Str.TermoNKU<<2; + + Spi.DAC_A = GyroP.Str.DAC_A<<2; + Spi.DAC_B = GyroP.Str.DAC_B<<2; + + Gyro.Gain_Sin = GyroP.Str.Gain_Sin; + Gyro.Gain_Cos = GyroP.Str.Gain_Cos; + } + else + { + + Gyro.FrqHZ = 388; + Gyro.Frq = Gyro.FrqHZ<<16; + Gyro.FrqHZmin = 350<<16; + Gyro.FrqHZmax = 450<<16; + Gyro.FrqChengSpeed = 100; + Gyro.ModAmp = 250; + Gyro.AmpPer = 40; + Gyro.AmpPerMin = 1; + Gyro.AmpPerMax = 90; + Gyro.AmpSpeed = 1; + Gyro.AmpPerDel = 5; + Gyro.AmpTarget = 5800;// целевая амплитуда ВП + Gyro.Amp = 30*65535; + Gyro.AmpMin = 15;// минимальное значение AmpT;5 + Gyro.AmpTD = 30;//////////////////////////////////////////////////////// + Gyro.TermoNKU = 44700;//48824*0,0061-273=25 С° + Spi.DAC_A = 41000; + Spi.DAC_B = 35220; + Gyro.PLC_Error2Mode = 1400; //для записи мод + Gyro.Gain_Sin = 115; + Gyro.Gain_Cos = 175; Gyro.Firmware_Version = 0x9; //версия программы Gyro.GLD_Serial = 123; //серийный номер Gyro.My_Addres = 0; //адрес глд - + } switch(Gyro.My_Addres){//смещение поджига и подсветки в зависимости от адреса ГЛД case 0: Gyro.Discharg = StartDischarg << ShiftStart0;