![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: SPI.c
- Revision:
- 221:53b256368ca1
- Parent:
- 220:04c54405b82d
- Child:
- 222:7de7b3bf3a1d
- Child:
- 223:2344d5f4aa50
--- a/SPI.c Fri Oct 20 13:16:32 2017 +0000 +++ b/SPI.c Mon Oct 23 05:31:10 2017 +0000 @@ -162,7 +162,13 @@ Gyro.IN1_Accum += Spi.ADC2; Gyro.IN2_Accum += Spi.ADC3; // Gyro.DeltaT = (unsigned int)(((Spi.ADC4>>1) + Gyro.Tmp_OffsetT5) * Gyro.Tmp_scaleT5); - Gyro.DeltaT = (unsigned int)(Spi.ADC4>>1); + switch(Gyro.LG_Type) + { + case 1: Gyro.DeltaT = (unsigned int)(Spi.ADC2>>1); break; + + case 0: Gyro.DeltaT = (unsigned int)(Spi.ADC4>>1); break; + } + TempA = (0xffff - Spi.ADC5); // перевернем знак и умножим на два (было 32000...0 стало 0 ...32000 /*сдвиг(<<1) стало 0 ...64000*/) Gyro.TermLM = Spi.ADC1;