![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
Diff: pin.c
- Revision:
- 211:ac8251b067d2
- Parent:
- 209:224e7331a061
- Child:
- 213:9953db9543d6
--- a/pin.c Mon Apr 24 05:43:54 2017 +0000 +++ b/pin.c Mon Jul 03 05:50:08 2017 +0000 @@ -38,7 +38,9 @@ if (Gyro.Discharg) { - Spi.DAC_A =(((int)(GyroP.Str.DAC_current_Start*0.98+0x7fff) & 0xffff)); + if(Gyro.LG_Type==1) Spi.DAC_A = (unsigned int)(32767-(GyroP.Str.DAC_current_Work>>1)); + else Spi.DAC_A =(((int)(GyroP.Str.DAC_current_Start*0.98+0x7fff) & 0xffff)); + Gyro.Discharg = Gyro.Discharg >> 1; if(!Gyro.LaserOn) { @@ -55,7 +57,7 @@ TimeDischarg++; if(TimeDischarg==1) { - if (Spi.ADC5>25000) + if (Spi.ADC5>35000) { if (Try<10) { @@ -74,12 +76,14 @@ if(!Gyro.LaserOn) { Gyro.LaserOn=1; - Gyro.RgConA = 0xfd; + if(Gyro.LG_Type==1) Gyro.RgConA = 0xff; + else Gyro.RgConA = 0xfd; Gyro.RgConB = 0x4; } TimeDischarg=5; Try=0; - Spi.DAC_A = ((((int)(GyroP.Str.DAC_current_Work+0x7fff) & 0xffff)+22544)*0.65); + if(Gyro.LG_Type==1) Spi.DAC_A = (unsigned int)(32767-(GyroP.Str.DAC_current_Work>>1)); + else Spi.DAC_A = ((((int)(GyroP.Str.DAC_current_Work+0x7fff) & 0xffff)+22544)*0.65); } } }