![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: SPI.c
- Revision:
- 143:2b15794a6cd2
- Parent:
- 142:7a6f68601291
- Child:
- 144:083c667ba848
diff -r 7a6f68601291 -r 2b15794a6cd2 SPI.c --- a/SPI.c Tue Apr 26 13:58:03 2016 +0000 +++ b/SPI.c Wed Apr 27 06:46:17 2016 +0000 @@ -94,52 +94,29 @@ else if ( Gyro.PLC_Delta > ( 55 * 65536)) k=64; else if ( Gyro.PLC_Delta < (-55 * 65536)) k=64; - else if ( Gyro.PLC_Delta > ( 37 * 65536)) k=20; - else if ( Gyro.PLC_Delta < (-37 * 65536)) k=20; + else if ( Gyro.PLC_Delta > ( 40 * 65536)) k=30; + else if ( Gyro.PLC_Delta < (-40 * 65536)) k=30; - else if ( Gyro.PLC_Delta > ( 25 * 65536)) k=16; - else if ( Gyro.PLC_Delta < (-25 * 65536)) k=16; + else if ( Gyro.PLC_Delta > ( 25 * 65536)) k=20; + else if ( Gyro.PLC_Delta < (-25 * 65536)) k=20; - else if ( Gyro.PLC_Delta > ( 15*65536)) k=8; - else if ( Gyro.PLC_Delta < (-15*65536)) k=8; + else if ( Gyro.PLC_Delta > ( 15*65536)) k=16; + else if ( Gyro.PLC_Delta < (-15*65536)) k=16; - else if ( Gyro.PLC_Delta > ( 5*65536)) k=6; - else if ( Gyro.PLC_Delta < (-5*65536)) k=6; + else if ( Gyro.PLC_Delta > ( 5*65536)) k=12; + else if ( Gyro.PLC_Delta < (-5*65536)) k=12; - else if ( Gyro.PLC_Delta > ( 2*65536)) k=4; - else if ( Gyro.PLC_Delta < (-2*65536)) k=4; + else if ( Gyro.PLC_Delta > ( 2*65536)) k=6; + else if ( Gyro.PLC_Delta < (-2*65536)) k=6; if (Gyro.PLC_Error2Mode > 0) {Gyro.PLC_Error2Mode --; Gyro.PLC_ADC_DOld = 0; } // если ошибка(нахожление в двух модовом) else if ( Gyro.PLC_Delta > (3000 * 65536)) {Spi.DAC_B += 2500; Gyro.PLC_Error2Mode = 5; Gyro.PLC_ADC_DOld = 0;} // проверка на двух модовость else if ( Gyro.PLC_Delta < (-3000 * 65536)) {Spi.DAC_B += 2500; Gyro.PLC_Error2Mode = 5; Gyro.PLC_ADC_DOld = 0;} - /* - else if ( Gyro.PLC_Delta > ( 1500 * 65536)) k=128; - else if ( Gyro.PLC_Delta < (-1500 * 65536)) k=128; - - else if ( Gyro.PLC_Delta > ( 1000 * 65536)) k=64; - else if ( Gyro.PLC_Delta < (-1000 * 65536)) k=64; - - else if ( Gyro.PLC_Delta > ( 500 * 65536)) k=32; - else if ( Gyro.PLC_Delta < (-500 * 65536)) k=32; - - else if ( Gyro.PLC_Delta > ( 200 * 65536)) k=16; - else if ( Gyro.PLC_Delta < (-200 * 65536)) k=16; - - else if ( Gyro.PLC_Delta > ( 100*65536)) k=8; - else if ( Gyro.PLC_Delta < (-100*65536)) k=8; - - else if ( Gyro.PLC_Delta > ( 50*65536)) k=4; - else if ( Gyro.PLC_Delta < (-50*65536)) k=4; - - else if ( Gyro.PLC_Delta > ( 10*65536)) k=2; - else if ( Gyro.PLC_Delta < (-10*65536)) k=2; - - */ else if (Gyro.PLC_DeltaADD > 0) { -// Gyro.PLC_ADC_DOld = (Gyro.PLC_DeltaADD /6553600 )+1; +// Gyro.PLC_ADC_DOld = (Gyro.PLC_DeltaADD /6553600 )+1; Gyro.PLC_ADC_DOld = 1; } else if (Gyro.PLC_DeltaADD < 0)