![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: SPI.c
- Revision:
- 121:bbae560cdd43
- Parent:
- 116:66f1f0ff2dab
- Child:
- 122:fbacb932a30b
--- a/SPI.c Wed Apr 06 15:40:17 2016 +0000 +++ b/SPI.c Thu Apr 07 10:44:23 2016 +0000 @@ -81,21 +81,20 @@ if(Gyro.RgConA&0x2) { if (Gyro.PLC_Znak > 1) {Gyro.PLC_Znak --;} - else if ( Gyro.PLC_Delta > (1000 * 65536)) {Gyro.PLC_Regul += 1000 << 16; Gyro.PLC_Znak = 5;} - else if ( Gyro.PLC_Delta < (-1000 * 65536)) {Gyro.PLC_Regul += 1000 << 16; Gyro.PLC_Znak = 5;} + else if ( Gyro.PLC_Delta > (1000 * 65536)) {Spi.DAC_B += 2500; Gyro.PLC_Znak = 5;} + else if ( Gyro.PLC_Delta < (-1000 * 65536)) {Spi.DAC_B += 2500; Gyro.PLC_Znak = 5;} else if ((Gyro.PLC_Delta * Gyro.PLC_Znak) > 0) { Gyro.PLC_Znak = 1; - Gyro.PLC_Regul -= ((Gyro.PLC_Delta * Gyro.PLC_Znak)/100); - Spi.DAC_B -= ((Gyro.PLC_Delta * Gyro.PLC_Znak)/655360); +// Gyro.PLC_Regul -= ((Gyro.PLC_Delta * Gyro.PLC_Znak)/100); + Spi.DAC_B += (((Gyro.PLC_Delta * Gyro.PLC_Znak)/65536))*16; } else { Gyro.PLC_Znak = -1; - Gyro.PLC_Regul -= ((Gyro.PLC_Delta * Gyro.PLC_Znak)/100); - Spi.DAC_B -= ((Gyro.PLC_Delta * Gyro.PLC_Znak)/655360); - +// Gyro.PLC_Regul -= ((Gyro.PLC_Delta * Gyro.PLC_Znak)/100); + Spi.DAC_B -= (((Gyro.PLC_Delta * Gyro.PLC_Znak)/65536))*16; } // Spi.DAC_B = (Gyro.PLC_Regul + 0x1fffffff)/65536;