![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
Diff: Global.c
- Revision:
- 225:f8fee6c586cc
- Parent:
- 222:7de7b3bf3a1d
- Child:
- 226:4a4d5bd5fcd7
diff -r 598aec95415f -r f8fee6c586cc Global.c --- a/Global.c Tue Nov 21 07:31:05 2017 +0000 +++ b/Global.c Tue Dec 12 05:53:39 2017 +0000 @@ -124,18 +124,18 @@ ReadFlash (); // GyroP.Str.ParamMod=0; - if(GyroP.Str.ParamMod) + if(GyroP.Str.ParamMod==1) { Gyro.ShowMod2=0; Gyro.TimeToJump = GyroP.Str.TimeToJump; Gyro.JumpDelta = GyroP.Str.JumpDelta; Gyro.ShiftMod = GyroP.Str.ShiftMod; 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.DownTreshold = (unsigned int)((GyroP.Str.DownTreshold-0x7fff)&0xffff); //27 + Gyro.HighTreshold = (unsigned int)((GyroP.Str.HighTreshold-0x7fff)&0xffff); + Gyro.PLCDelay = GyroP.Str.PLCDelay; + 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_ref = (unsigned int)(GyroP.Str.HFO_ref)*0.82; Gyro.LG_Type = GyroP.Str.LG_Type; @@ -170,9 +170,11 @@ LPC_MCPWM->MAT1 = T_vib_1; LPC_MCPWM->MAT2 = T_vib_2; 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); - + //Gyro.HFO_Max=((int)(GyroP.Str.DAC_current_Work*0.67)-2000); + Gyro.HFO_Max=0xffff-GyroP.Str.DAC_current_Work; + + //Gyro.HFO_Min=((int)(GyroP.Str.DAC_current_Start*0.67)-2000); + Gyro.HFO_Min= 0xffff-GyroP.Str.DAC_current_Start; } else Spi.DAC_A = ((((int)(GyroP.Str.DAC_current_Work+0x7fff) & 0xffff)+22544)*0.65); Gyro.DacIn = GyroP.Str.DAC_current_Work; @@ -188,7 +190,7 @@ { Gyro.DownTreshold = GyroP.Str.DownTreshold; //27 Gyro.HighTreshold = GyroP.Str.HighTreshold; - Gyro.PLCDelay = 30000; + Gyro.PLCDelay = 5000; Gyro.ResetLevelCool = 56000; //105 Gyro.ResetLevelHeat = 15000; Gyro.HFO_ref = 13000;