![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Diff: Command.c
- Revision:
- 197:7a05523bf588
- Parent:
- 196:f76dbc081e63
- Child:
- 198:fb22ba6aad54
- Child:
- 201:76f4123bf22a
- Child:
- 205:775d54fdf646
--- a/Command.c Fri Sep 23 05:34:50 2016 +0000 +++ b/Command.c Wed Oct 19 10:55:05 2016 +0000 @@ -1,4 +1,5 @@ #include "stdlib.h" +//#include "math.h" #include "LPC17xx.h" #include "Global.h" int tempNH,tempNL; @@ -14,7 +15,7 @@ unsigned int CountParam=0; int ttemp; - +int OLDDAC=0; unsigned int pDestT ; GyroParam *Flash; @@ -375,7 +376,8 @@ BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. -Temp=Gyro.CuruAngle; //(0,28/с) + Temp=Gyro.CuruAngle; //(0,28/с) + //8 байт + 4 байта от прошлых измерений //Gyro.CuruAngle = Gyro.CuruAngle + OldCuruAngle; //(72 град/с) @@ -776,7 +778,7 @@ if (Time[0] == 'B') { - sprintf((Time),"<%015d>\r\n", Gyro.tempdelta); + // sprintf((Time),"<%015d>\r\n", ModArray[7]); WriteCon(Time);} if (Time[0] == 'W') {Gyro.FlashMod=2;} if (Time[0] == 'R') {Gyro.FlashMod=3;} @@ -798,7 +800,7 @@ if (Time[0] == 'F') { // выдача технологическая sprintf(Time,"\r\n"); WriteCon(Time); - sprintf((Time)," Gyro.CuruAngle = <%015d>", Gyro.CuruAngle); + sprintf((Time)," <%015d>", Gyro.CuruAngle); WriteCon(Time); } if (Time[0] == 'q') { // внешняя защелка @@ -903,25 +905,52 @@ if (Time[0] == '6') { // выдача технологическая sprintf(Time,"\r\n"); WriteCon(Time); - for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_Restored_sin[i]); + for (int i = 0; i < 32; i++ ) + { + sprintf((Time + i * 9)," <%07d>", (Buff_Restored_Mod[i]>>20)); + } WriteCon(Time); + } + /* if (Time[0] == '7') { // выдача технологическая sprintf(Time,"\r\n"); WriteCon(Time); - for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_Restored_sin2[i]); + + for (int i = 0; i < 32; i++ )sprintf((Time + i * 13)," <%010d>", (BuffADC_64Point[i+32]>>10)); + WriteCon(Time); + } */ + /*for (int i = 32; i < 64; i++ )sprintf((Time + i *8)," <%05d> ",Buff_ADC_5[i]); + WriteCon(Time);*/ + /* + sprintf(Time,"\r\n"); + WriteCon(Time); + for (int i = 0; i < 64; i++ )sprintf((Time + i * 9)," <%05d> ",BuffADC_16Point[i]>>16); WriteCon(Time); sprintf(Time,"\r\n"); WriteCon(Time); - sprintf((Time)," %d %d \r\n ", Gyro.tempdelta2, Gyro.tempdelta); + for (int i = 0; i < 64; i++ )sprintf((Time + i * 14)," <%010d> ",BuffADC_32Point[i]); + WriteCon(Time); + sprintf(Time,"\r\n"); WriteCon(Time); - Gyro.tempdelta2=0; - Gyro.tempdelta=0; - } - if (Time[0] == '7') { // выдача технологическая + for (int i = 0; i < 64; i++ )sprintf((Time + i * 14)," <%010d> ",BuffADC_64Point[i]>>16); + WriteCon(Time); + sprintf(Time,"\r\n"); + WriteCon(Time); + for (int i = 0; i < 64; i++ )sprintf((Time + i * 14)," <%010d> ",BuffADC_32PointD[i]); + WriteCon(Time); sprintf(Time,"\r\n"); WriteCon(Time); - for (int i = 0; i < 32; i++ )sprintf((Time + i * 10)," <%05d> ", Buff_16PointD[CountV31] - Buff_32Point[CountV31]); + sprintf(Time,"\r\n"); WriteCon(Time); - } + + */ + + + /* if (Time[0] == 'm') { // выдача технологическая + sprintf(Time,"\r\n"); + WriteCon(Time); + for (int i = 0; i < 64; i++ )sprintf((Time + i * 10)," <%010d> ", ModArray[i]); + WriteCon(Time); + }*/ if (Time[0] == '9') { // выдача технологическая sprintf(Time,"\r\n"); WriteCon(Time); @@ -948,32 +977,36 @@ } if (Time[0] == 'V') { // выдача технологическая Spi.DAC_B += 200; - sprintf(Time,"%d\r\n", Spi.DAC_B); - WriteCon(Time); + /* sprintf(Time,"%d\r\n", Spi.DAC_B); + WriteCon(Time);*/ } if (Time[0] == 'v') { // выдача технологическая Spi.DAC_B -= 200; - sprintf(Time,"%d\r\n", Spi.DAC_B); - WriteCon(Time); + /* sprintf(Time,"%d\r\n", Spi.DAC_B); + WriteCon(Time);*/ } + + if (Time[0] == 'w') TypeMod=2; + if (Time[0] == 'a') TypeMod=1; + if (Time[0] == 's') TypeMod=0; //////////////////////////////////////////////////////////////////////////////// /*Запись лога регулировки частоты*/ if (Time[0] == 'y') Gyro.flag=1; //включит передачу if (Time[0] == 'u') Gyro.flag=0; //LPC_TIM1->MR0+1000 вносим помеху - if (Time[0] == 'i') Gyro.flag=2; //LPC_TIM1->MR0 убираем помеху + if (Time[0] == 'i') {Gyro.flag=2; } //LPC_TIM1->MR0 убираем помеху if (Time[0] == 'o') Gyro.flag=3; //Отключить передачу if (Time[0] == 'p') Gyro.LogHZ = 1; //Отключить передачу if (Time[0] == 'l') Gyro.LogHZ = 0; //Отключить передачу //////////////////////////////////////////////////////////////////////////////////// /*Запись лога регулировки периметра*/ - if (Time[0] == 'g') Gyro.LogPLC=1; //включит передачу - if (Time[0] == 'h') Gyro.LogPLC=2; //десперсионка - if (Time[0] == 'j') Gyro.LogPLC=0; //регулировка без выдачиж + if (Time[0] == 'g') Gyro.LogPLC=1; if(OLDDAC) Spi.DAC_B=OLDDAC; //включит передачу + if (Time[0] == 'h') {Gyro.LogPLC=2; Spi.DAC_B=19000; Gyro.PLC_Error2Mode = 1400; OLDDAC=Spi.DAC_B; Spi.DAC_B=19000;} //десперсионка + if (Time[0] == 'j') Gyro.LogPLC=0; if(OLDDAC) Spi.DAC_B=OLDDAC; //регулировка без выдачиж if (Time[0] == 'b') Gyro.StrayPLC_flag = 3; //LPC_TIM1->MR0-1000 вносим помеху - if (Time[0] == 'n') Gyro.StrayPLC_flag = 2; //LPC_TIM1->MR0+2500 большая помеха. if (Time[0] == 'k') Gyro.LogPLC = 0; //Отключить передачу - if (Time[0] == 'd') Gyro.LogPLC=1; //прыжок на воду + - if (Time[0] == 'f') Gyro.ModJump = 2; //прыжок на воду - + if (Time[0] == 'd') {Gyro.ModJump = 1; } //прыжок на воду + + if (Time[0] == 'f') {Gyro.ModJump = 2; } //прыжок на воду - //if (Time[0] == 'z') {Gyro.ModJump = 3; Spi.DAC_B = 0x3a98; } //прообежать по всем модам. ////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////