![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: Command.c
- Revision:
- 121:bbae560cdd43
- Parent:
- 120:9f446f1495e8
- Child:
- 122:fbacb932a30b
diff -r 9f446f1495e8 -r bbae560cdd43 Command.c --- a/Command.c Wed Apr 06 15:40:17 2016 +0000 +++ b/Command.c Thu Apr 07 10:44:23 2016 +0000 @@ -10,6 +10,7 @@ unsigned int Param3=0; unsigned int Param4=0; unsigned int Consol=123; +unsigned int TempParam=1; /* void exec_CMD(void) //r. === процедура окончательной дешифрации и исполнения команды { @@ -22,6 +23,7 @@ }*/ void CMD_Maintenance(void) { + Rate_Flag=0; BuffTemp[0] = Gyro.SOC_Out; BuffTemp[1] = Gyro .My_Addres; BuffTemp[2] = Gyro .Firmware_Version; @@ -30,8 +32,25 @@ BuffTemp[5]=0x00; Check(BuffTemp, 8); WriteConN (BuffTemp,8); + } +void CMD_Rate2(void) +{ + + BuffTemp[ 0] = Gyro.SOC_Out; + BuffTemp[ 1] = Gyro.My_Addres; + + + BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. + BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. + + BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. + BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. + + Check(BuffTemp, 44); + WriteConN (BuffTemp,44); +} void CMD_Rate(void) { @@ -130,6 +149,7 @@ BuffTemp[10] = (Temp >> 8) & 0xff;//выход регулятора гвч; BuffTemp[11] = (Temp >> 0) & 0xff;; +Temp = (Gyro.AD_Slow >> 16)- 0x7fff;; BuffTemp[12]=(Temp >> 8) & 0xff;//// BuffTemp[13]=(Temp >> 0) & 0xff;//// @@ -150,14 +170,17 @@ BuffTemp[21] = 0x00; - if (Spi.DAC_B < 0x7fff) Temp = Spi.DAC_B - 0x7fff; else Temp = 0x7fff - Spi.DAC_B ; +// if (Spi.DAC_B < 0x7fff) Temp = Spi.DAC_B - 0x7fff; else Temp = 0x7fff - Spi.DAC_B ; + Temp = Spi.DAC_B - 0x7fff; BuffTemp[22] = (Temp >> 8) & 0xff; BuffTemp[23] = (Temp >> 0) & 0xff; - BuffTemp[24] = 0x00; - BuffTemp[25] = 0x00;// ХЗ + +Temp = Gyro.PLC_Delta >> 16; + BuffTemp[24] = (Temp >> 8) & 0xff; + BuffTemp[25] = (Temp >> 0) & 0xff;// ХЗ - Temp = Gyro.PLC_Delta >> 16; + Temp = 100; BuffTemp[26] = (Temp >> 8) & 0xff; BuffTemp[27] = (Temp >> 0) & 0xff; @@ -353,7 +376,8 @@ int Getlengf(void) { - unsigned int lengf=0; + unsigned int lengf; + lengf = 1; switch(Gyro.CMD_In) { case 0x99://Gyrotainance @@ -462,8 +486,11 @@ { ReadCon1(BuffTemp); switch(Gyro.CMD_In) { + Rate_Flag=0; case 0x99: + Rate_Flag=0; CMD_Maintenance(); + break; case 0xD8: CMD_M_Control_D8(); @@ -474,7 +501,11 @@ CMD_M_Stymul(); break; case 0xDD: - Rate_Flag=1; + TempParam = BuffTemp[3]; + Rate_Flag=0; + if (TempParam==3) Rate_Flag=3; + else if(TempParam==2) Rate_Flag=2; + else Rate_Flag=1; break; case 0xE4: CMD_M_vib(); @@ -488,7 +519,13 @@ } + } +// else if(CountBuFFIn > 40 ) +// { +// ReadCon1(BuffTemp); +// } + }