Dmitry Kovalev
/
LGstaandart
forkd
Fork of LG2 by
Diff: MTimer.c
- Revision:
- 108:030cdde08314
- Parent:
- 107:4d178bcc9d8a
- Child:
- 112:4a96133a1311
diff -r 4d178bcc9d8a -r 030cdde08314 MTimer.c --- a/MTimer.c Fri Apr 01 16:13:55 2016 +0000 +++ b/MTimer.c Sat Apr 02 11:15:38 2016 +0000 @@ -143,11 +143,24 @@ D_QEI(); //чтение данных по счетчику cheng(); // расчет вибропривода - Gyro.OldCuruAngle = Gyro.CuruAngle; - Gyro.CuruAngle = Gyro.CuruAngle + Buff_32Point [CountV255]; - Gyro.Num += Gyro.CuruAngle-Gyro.OldCuruAngle; + +// Gyro.CuruAngle += ((Buff_1Point [CountV255])*32)-Buff_32Point [CountV255]; +// Gyro.CuruAngle += Buff_1Point [CountV255]*32 + ((Buff_1Point [(CountV255 - 1 - 32) & 0xff] *32) - Buff_32Point [(CountV255 - 1) & 0xff]) - ((Buff_1Point [(CountV255 - 32) & 0xff] *32) - Buff_32Point [(CountV255 ) & 0xff]); +// Gyro.CuruAngle += Buff_32Point [(CountV255 + 32) & 0xff]; //- Buff_32Point [(CountV255 ) & 0xff]; + + Gyro.CuruAngle += Buff_32Point [CountV31];// - Buff_1Point [(CountV255 - 1) & 0xff]*32; + + + //Gyro.OldCuruAngle = Gyro.CuruAngle; + //Gyro.CuruAngle = Gyro.CuruAngle + Buff_32Point [CountV255]; + //Gyro.Num += Gyro.CuruAngle-Gyro.OldCuruAngle; + + + + + SPI_Exchange(); //Чтение ADS_SPI LPC_TIM1->IR = 1;