![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
Diff: Command.c
- Revision:
- 207:d1ce992f5d17
- Parent:
- 206:00341a03e05c
- Child:
- 208:19150d2b528f
--- a/Command.c Tue Dec 20 14:08:17 2016 +0000 +++ b/Command.c Fri Jan 13 08:27:28 2017 +0000 @@ -62,11 +62,11 @@ void EraseFlash(void) { Gyro.FlashMod = 0; - rr = u32IAP_PrepareSectors(8, 10); + rr = u32IAP_PrepareSectors(19, 21); sprintf((Time)," dffddfd <%07d> ",rr); WriteCon(Time); - rr = u32IAP_EraseSectors(8, 10); + rr = u32IAP_EraseSectors(19, 21); sprintf((Time)," dffddfd <%07d> ",rr); WriteCon(Time); } @@ -85,20 +85,20 @@ sprintf((Time)," dffddfd <%07d> ",&rr); WriteCon(Time); ////unsigned int address=0x0003000; - rr = u32IAP_PrepareSectors(8, 10); + rr = u32IAP_PrepareSectors(19, 21); sprintf((Time)," dffddfd <%07d> ",rr); WriteCon(Time); - rr = u32IAP_EraseSectors(8, 10); + rr = u32IAP_EraseSectors(19, 21); sprintf((Time)," dffddfd <%07d> ",rr); WriteCon(Time); - rr = u32IAP_PrepareSectors(8, 10); + rr = u32IAP_PrepareSectors(19, 21); sprintf((Time)," dffddfd <%07d> ",rr); WriteCon(Time); /// SystemInitDef(); - rr = u32IAP_CopyRAMToFlash(0x0009000, &GyroP , 1024); + rr = u32IAP_CopyRAMToFlash(0x030000, &GyroP , 1024); sprintf((Time)," dffddfd <%07d> ",rr); WriteCon(Time); // SystemInit1(); // Инициализация контроллера: установка тактовых частот @@ -119,7 +119,7 @@ Gyro.FlashMod = 0; WriteCon("\r\n Pirivet Flash"); - pDestT= (unsigned int) (0x9000); + pDestT= (unsigned int) (0x030000); Flash = (GyroParam*) pDestT; GyroP = *(Flash); @@ -456,9 +456,9 @@ /* OldCuruAngle=Gyro.CuruAngle & 0xff; //сохраняем 4 байта для след измирений Temp=Gyro.CuruAngle>>8; */ //приводим к форме вывода - /* //(9 град/с) + /* //(9 град/с) OldCuruAngle=Gyro.CuruAngle & 0x1f; //сохраняем 5 бит для след измирений -Temp=Gyro.CuruAngle>>5; */ //приводим к форме вывода +Temp=Gyro.CuruAngle>>5; */ //приводим к форме вывода Gyro.CuruAngle = 0; BuffTemp[ 6] =(Temp >> 8) & 0xff;//старший байт разности счетчиков BuffTemp[ 7] =(Temp >> 0) & 0xff;//младший байт разности счетчиков @@ -476,7 +476,7 @@ BuffTemp[13]=(Temp >> 0) & 0xff;//// - Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); + Temp = (unsigned int)((7445000*16/(Gyro.Frq>>12))); BuffTemp[14] = (Temp >> 8) & 0xff; BuffTemp[15] = (Temp >> 0) & 0xff; @@ -484,7 +484,7 @@ BuffTemp[17] = 0x02; - Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); + Temp = (unsigned int)(((7445000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); BuffTemp[18] = (Temp >> 8) & 0xff; BuffTemp[19] = (Temp >> 0) & 0xff; @@ -541,8 +541,8 @@ temp1 =((BuffTemp[4]<<8) | BuffTemp[5]); temp1=temp1&0xFFFF; - (unsigned int)((7680000*16/(Gyro.Frq>>12))); - Gyro.Frq=(122880000/temp1)<<12; + + Gyro.Frq=(119120000/temp1)<<12; temp2 =((BuffTemp[6]<<8) | BuffTemp[7]); temp2=temp2&0xFFFF; @@ -551,7 +551,7 @@ } void CMD_M_Control_D8()///установка\сброс регистров управления { - unsigned int bit,NReg,Pa; + unsigned int bit,Pa; unsigned int SR,V,A,Bit_num; SR=0; V=0; @@ -876,6 +876,7 @@ Gyro.Gain_Sin = GyroP.Str.Gain_Sin; Gyro.Gain_Cos = GyroP.Str.Gain_Cos; + Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); for(int i=0;i<26;i++) { sprintf(Time," %d=%d\r\n",i, GyroP.Array[i]);