123
Fork of LG by
Command.c@189:8a16378724c4, 2016-08-22 (annotated)
- Committer:
- Kovalev_D
- Date:
- Mon Aug 22 10:39:08 2016 +0000
- Revision:
- 189:8a16378724c4
- Parent:
- 188:4c523cc373cc
- Child:
- 190:289514f730ee
?????? ?? ??????????? ??????? ? ????????? ?????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #include "stdlib.h" |
igor_v | 0:8ad47e2b6f00 | 2 | #include "LPC17xx.h" |
igor_v | 0:8ad47e2b6f00 | 3 | #include "Global.h" |
Kovalev_D | 106:250ddd8629c6 | 4 | int tempNH,tempNL; |
igor_v | 0:8ad47e2b6f00 | 5 | unsigned int Rate_Flag; |
igor_v | 0:8ad47e2b6f00 | 6 | unsigned int CountBuFFIn; |
igor_v | 21:bc8c1cec3da6 | 7 | unsigned int N=0,CRC_N; |
igor_v | 21:bc8c1cec3da6 | 8 | unsigned int Param1=0; |
igor_v | 21:bc8c1cec3da6 | 9 | unsigned int Param2=0; |
igor_v | 21:bc8c1cec3da6 | 10 | unsigned int Param3=0; |
igor_v | 21:bc8c1cec3da6 | 11 | unsigned int Param4=0; |
Kovalev_D | 102:4270092be987 | 12 | unsigned int Consol=123; |
Kovalev_D | 121:bbae560cdd43 | 13 | unsigned int TempParam=1; |
Kovalev_D | 124:9ae09249f842 | 14 | unsigned int CountParam=0; |
Kovalev_D | 129:406995a91322 | 15 | |
Kovalev_D | 148:7ce8c1fd00f7 | 16 | int ttemp; |
Kovalev_D | 136:19b9e6abb86f | 17 | |
Kovalev_D | 136:19b9e6abb86f | 18 | |
Kovalev_D | 136:19b9e6abb86f | 19 | unsigned int pDestT ; |
Kovalev_D | 136:19b9e6abb86f | 20 | GyroParam *Flash; |
Kovalev_D | 147:1aed74f19a8f | 21 | ///////////////flah and boot/////////// |
Kovalev_D | 147:1aed74f19a8f | 22 | void GoBoot(void) |
Kovalev_D | 147:1aed74f19a8f | 23 | { |
Kovalev_D | 147:1aed74f19a8f | 24 | /* Prepare Sectors to be flashed */ |
Kovalev_D | 147:1aed74f19a8f | 25 | NVIC_DisableIRQ(TIMER1_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 26 | NVIC_DisableIRQ(TIMER2_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 27 | NVIC_DisableIRQ(TIMER3_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 28 | NVIC_DisableIRQ(EINT3_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 29 | SystemInitDef(); |
Kovalev_D | 147:1aed74f19a8f | 30 | vIAP_ReinvokeISP(); |
Kovalev_D | 147:1aed74f19a8f | 31 | } |
Kovalev_D | 181:0b022246c43c | 32 | |
Kovalev_D | 181:0b022246c43c | 33 | void DropDelay(void) |
Kovalev_D | 181:0b022246c43c | 34 | { |
Kovalev_D | 181:0b022246c43c | 35 | Gyro.DropDelayGLD = DropDelayGLD_0; |
Kovalev_D | 181:0b022246c43c | 36 | if (Gyro.My_Addres==1) Gyro.DropDelayGLD = DropDelayGLD_1; |
Kovalev_D | 181:0b022246c43c | 37 | else if(Gyro.My_Addres==2) Gyro.DropDelayGLD = DropDelayGLD_2; |
Kovalev_D | 181:0b022246c43c | 38 | else if(Gyro.My_Addres==3) Gyro.DropDelayGLD = DropDelayGLD_3; |
Kovalev_D | 181:0b022246c43c | 39 | } |
Kovalev_D | 181:0b022246c43c | 40 | |
Kovalev_D | 147:1aed74f19a8f | 41 | void WriteFlash(void) |
Kovalev_D | 147:1aed74f19a8f | 42 | { |
Kovalev_D | 147:1aed74f19a8f | 43 | |
Kovalev_D | 147:1aed74f19a8f | 44 | NVIC_DisableIRQ(TIMER1_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 45 | NVIC_DisableIRQ(TIMER2_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 46 | NVIC_DisableIRQ(TIMER3_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 47 | NVIC_DisableIRQ(EINT3_IRQn); |
Kovalev_D | 147:1aed74f19a8f | 48 | |
Kovalev_D | 147:1aed74f19a8f | 49 | SystemInitDef(); |
Kovalev_D | 147:1aed74f19a8f | 50 | WriteCon("\r\n Start Prepare Sectors"); |
Kovalev_D | 147:1aed74f19a8f | 51 | if(u32IAP_PrepareSectors(18, 21) == IAP_STA_CMD_SUCCESS) |
Kovalev_D | 147:1aed74f19a8f | 52 | { |
Kovalev_D | 147:1aed74f19a8f | 53 | WriteCon("\r\nPrepare Sectors OK"); |
Kovalev_D | 147:1aed74f19a8f | 54 | WriteCon("\r\n Start Erase"); |
Kovalev_D | 147:1aed74f19a8f | 55 | u32IAP_EraseSectors(IMG_START_SECTOR, IMG_END_SECTOR); |
Kovalev_D | 147:1aed74f19a8f | 56 | WriteCon("\r\n AND Erase"); |
Kovalev_D | 147:1aed74f19a8f | 57 | } |
Kovalev_D | 147:1aed74f19a8f | 58 | else WriteCon("\r\nPrepare Sectors ERROR"); |
Kovalev_D | 147:1aed74f19a8f | 59 | SystemInit1(); |
Kovalev_D | 147:1aed74f19a8f | 60 | Gyro.FlashMod = 0; |
Kovalev_D | 169:140743e3bb96 | 61 | } |
Kovalev_D | 136:19b9e6abb86f | 62 | |
Kovalev_D | 136:19b9e6abb86f | 63 | void ReadFlash ( void) |
Kovalev_D | 136:19b9e6abb86f | 64 | { |
Kovalev_D | 147:1aed74f19a8f | 65 | Gyro.FlashMod = 0; |
Kovalev_D | 136:19b9e6abb86f | 66 | WriteCon("\r\n Pirivet Flash"); |
Kovalev_D | 136:19b9e6abb86f | 67 | pDestT= (unsigned int) (0x10000); |
Kovalev_D | 136:19b9e6abb86f | 68 | Flash = (GyroParam*) pDestT; |
Kovalev_D | 136:19b9e6abb86f | 69 | GyroP = *(Flash); |
Kovalev_D | 136:19b9e6abb86f | 70 | sprintf((Time)," dffddfd <%07d> ", GyroP.Str.K_WP_rst_heating); |
Kovalev_D | 136:19b9e6abb86f | 71 | WriteCon(Time); |
Kovalev_D | 169:140743e3bb96 | 72 | } |
Kovalev_D | 169:140743e3bb96 | 73 | ///////////////end flah and boot/////////// |
Kovalev_D | 136:19b9e6abb86f | 74 | |
Kovalev_D | 129:406995a91322 | 75 | void CMD_M_Param_R(void) |
igor_v | 0:8ad47e2b6f00 | 76 | { |
Kovalev_D | 129:406995a91322 | 77 | unsigned int NP; |
Kovalev_D | 129:406995a91322 | 78 | unsigned int Param; |
Kovalev_D | 129:406995a91322 | 79 | BuffTemp[0] = Gyro.SOC_Out; |
Kovalev_D | 129:406995a91322 | 80 | BuffTemp[1] = Gyro.My_Addres; |
Kovalev_D | 129:406995a91322 | 81 | |
Kovalev_D | 129:406995a91322 | 82 | NP = BuffTemp[3]; |
Kovalev_D | 129:406995a91322 | 83 | |
Kovalev_D | 129:406995a91322 | 84 | Param = GyroP.Array[NP]; |
Kovalev_D | 129:406995a91322 | 85 | |
Kovalev_D | 129:406995a91322 | 86 | BuffTemp[2] =(Param >> 8) & 0xff;//старший байт требуемого параметра |
Kovalev_D | 129:406995a91322 | 87 | BuffTemp[3] =(Param >> 0) & 0xff;//младший байт требуемого параметра |
Kovalev_D | 129:406995a91322 | 88 | |
Kovalev_D | 129:406995a91322 | 89 | Check(BuffTemp, 6); |
Kovalev_D | 129:406995a91322 | 90 | WriteConN (BuffTemp,6); |
Kovalev_D | 129:406995a91322 | 91 | } |
Kovalev_D | 129:406995a91322 | 92 | void CMD_M_Param_W(void) |
Kovalev_D | 129:406995a91322 | 93 | { |
Kovalev_D | 129:406995a91322 | 94 | unsigned int NP; |
Kovalev_D | 129:406995a91322 | 95 | unsigned int Param; |
Kovalev_D | 129:406995a91322 | 96 | |
Kovalev_D | 129:406995a91322 | 97 | NP = BuffTemp[3]; |
Kovalev_D | 129:406995a91322 | 98 | Param = (BuffTemp[4]<<8); |
Kovalev_D | 129:406995a91322 | 99 | Param |= BuffTemp[5]; |
Kovalev_D | 129:406995a91322 | 100 | |
Kovalev_D | 129:406995a91322 | 101 | GyroP.Array[NP] = Param; |
Kovalev_D | 129:406995a91322 | 102 | |
Kovalev_D | 129:406995a91322 | 103 | |
Kovalev_D | 129:406995a91322 | 104 | BuffTemp[0] = Gyro.SOC_Out; |
Kovalev_D | 129:406995a91322 | 105 | BuffTemp[1] = Gyro.My_Addres; |
Kovalev_D | 129:406995a91322 | 106 | BuffTemp[2] = Gyro.CMD_In; |
Kovalev_D | 129:406995a91322 | 107 | BuffTemp[3] = 0x00;//старший байт требуемого параметра |
Kovalev_D | 129:406995a91322 | 108 | |
Kovalev_D | 129:406995a91322 | 109 | Check(BuffTemp, 6); |
Kovalev_D | 129:406995a91322 | 110 | WriteConN (BuffTemp,6); |
Kovalev_D | 129:406995a91322 | 111 | } |
igor_v | 0:8ad47e2b6f00 | 112 | void CMD_Maintenance(void) |
igor_v | 0:8ad47e2b6f00 | 113 | { |
Kovalev_D | 188:4c523cc373cc | 114 | |
Kovalev_D | 185:7e200f4d9b16 | 115 | Gyro.DropDelayGLD = DropDelayGLD_0;//задержка на выдачу 45 микросекунд для любого адреса ГЛД |
Kovalev_D | 122:fbacb932a30b | 116 | BuffTemp[0] = Gyro.SOC_Out; |
Kovalev_D | 124:9ae09249f842 | 117 | BuffTemp[1] = Gyro.My_Addres; |
Kovalev_D | 124:9ae09249f842 | 118 | BuffTemp[2] = Gyro.Firmware_Version; |
Kovalev_D | 169:140743e3bb96 | 119 | BuffTemp[3] = Gyro.GLD_Serial; |
igor_v | 21:bc8c1cec3da6 | 120 | BuffTemp[4]=0x00; |
igor_v | 21:bc8c1cec3da6 | 121 | BuffTemp[5]=0x00; |
igor_v | 21:bc8c1cec3da6 | 122 | Check(BuffTemp, 8); |
igor_v | 21:bc8c1cec3da6 | 123 | WriteConN (BuffTemp,8); |
Kovalev_D | 121:bbae560cdd43 | 124 | |
igor_v | 0:8ad47e2b6f00 | 125 | } |
Kovalev_D | 165:b2bd0c810a4f | 126 | |
Kovalev_D | 124:9ae09249f842 | 127 | void CMD_Delta_500Hz(void) |
Kovalev_D | 124:9ae09249f842 | 128 | { |
Kovalev_D | 165:b2bd0c810a4f | 129 | |
Kovalev_D | 124:9ae09249f842 | 130 | Gyro.Delta500_Event=0; |
Kovalev_D | 122:fbacb932a30b | 131 | unsigned int Temp; |
Kovalev_D | 124:9ae09249f842 | 132 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 122:fbacb932a30b | 133 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 124:9ae09249f842 | 134 | |
Kovalev_D | 124:9ae09249f842 | 135 | Temp = Gyro.CuruAngle; |
Kovalev_D | 124:9ae09249f842 | 136 | Gyro.CuruAngle = 0; |
Kovalev_D | 124:9ae09249f842 | 137 | |
Kovalev_D | 124:9ae09249f842 | 138 | BuffTemp[ 2] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 139 | BuffTemp[ 3] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 140 | |
Kovalev_D | 124:9ae09249f842 | 141 | BuffTemp[ 4] = CountParam; |
Kovalev_D | 124:9ae09249f842 | 142 | switch(CountParam) { |
Kovalev_D | 184:ebcd2bc3be8f | 143 | |
Kovalev_D | 124:9ae09249f842 | 144 | //F_ras |
Kovalev_D | 124:9ae09249f842 | 145 | case 0: |
Kovalev_D | 124:9ae09249f842 | 146 | Temp = Gyro.F_ras; |
Kovalev_D | 124:9ae09249f842 | 147 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 148 | break; |
Kovalev_D | 124:9ae09249f842 | 149 | |
Kovalev_D | 124:9ae09249f842 | 150 | case 1: |
Kovalev_D | 124:9ae09249f842 | 151 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 152 | break; |
Kovalev_D | 124:9ae09249f842 | 153 | |
Kovalev_D | 124:9ae09249f842 | 154 | |
Kovalev_D | 124:9ae09249f842 | 155 | |
Kovalev_D | 124:9ae09249f842 | 156 | //HFO |
Kovalev_D | 124:9ae09249f842 | 157 | case 2: |
Kovalev_D | 124:9ae09249f842 | 158 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 159 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 160 | break; |
Kovalev_D | 124:9ae09249f842 | 161 | |
Kovalev_D | 124:9ae09249f842 | 162 | case 3: |
Kovalev_D | 124:9ae09249f842 | 163 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 164 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 165 | break; |
Kovalev_D | 124:9ae09249f842 | 166 | |
Kovalev_D | 124:9ae09249f842 | 167 | |
Kovalev_D | 124:9ae09249f842 | 168 | |
Kovalev_D | 124:9ae09249f842 | 169 | //T_Vibro |
Kovalev_D | 124:9ae09249f842 | 170 | case 4: |
Kovalev_D | 124:9ae09249f842 | 171 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 172 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 173 | break; |
Kovalev_D | 124:9ae09249f842 | 174 | |
Kovalev_D | 124:9ae09249f842 | 175 | case 5: |
Kovalev_D | 124:9ae09249f842 | 176 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 177 | break; |
Kovalev_D | 124:9ae09249f842 | 178 | |
Kovalev_D | 124:9ae09249f842 | 179 | |
Kovalev_D | 124:9ae09249f842 | 180 | |
Kovalev_D | 124:9ae09249f842 | 181 | //L_Vibro |
Kovalev_D | 124:9ae09249f842 | 182 | case 6: |
Kovalev_D | 124:9ae09249f842 | 183 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 184 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 185 | |
Kovalev_D | 124:9ae09249f842 | 186 | break; |
Kovalev_D | 124:9ae09249f842 | 187 | |
Kovalev_D | 124:9ae09249f842 | 188 | case 7: |
Kovalev_D | 124:9ae09249f842 | 189 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 190 | break; |
Kovalev_D | 124:9ae09249f842 | 191 | |
Kovalev_D | 124:9ae09249f842 | 192 | |
Kovalev_D | 124:9ae09249f842 | 193 | |
Kovalev_D | 124:9ae09249f842 | 194 | //Напряжение на регуляторе периметра |
Kovalev_D | 124:9ae09249f842 | 195 | case 8: |
Kovalev_D | 165:b2bd0c810a4f | 196 | Temp = Spi.DAC_B /*- 0x7fff*/; |
Kovalev_D | 124:9ae09249f842 | 197 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 198 | |
Kovalev_D | 124:9ae09249f842 | 199 | break; |
Kovalev_D | 124:9ae09249f842 | 200 | |
Kovalev_D | 124:9ae09249f842 | 201 | case 9: |
Kovalev_D | 124:9ae09249f842 | 202 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 203 | break; |
Kovalev_D | 124:9ae09249f842 | 204 | |
Kovalev_D | 124:9ae09249f842 | 205 | |
Kovalev_D | 124:9ae09249f842 | 206 | |
Kovalev_D | 124:9ae09249f842 | 207 | //темпкратурный канал 0 |
Kovalev_D | 124:9ae09249f842 | 208 | case 10: |
Kovalev_D | 124:9ae09249f842 | 209 | Temp = 100; |
Kovalev_D | 124:9ae09249f842 | 210 | BuffTemp[5] = (Temp >> 8) & 0xff; |
igor_v | 0:8ad47e2b6f00 | 211 | |
Kovalev_D | 124:9ae09249f842 | 212 | break; |
Kovalev_D | 124:9ae09249f842 | 213 | |
Kovalev_D | 124:9ae09249f842 | 214 | case 11: |
Kovalev_D | 124:9ae09249f842 | 215 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 216 | break; |
Kovalev_D | 124:9ae09249f842 | 217 | |
Kovalev_D | 124:9ae09249f842 | 218 | |
Kovalev_D | 124:9ae09249f842 | 219 | |
Kovalev_D | 178:1666a83d88a5 | 220 | //f |
Kovalev_D | 124:9ae09249f842 | 221 | case 12: |
Kovalev_D | 124:9ae09249f842 | 222 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 124:9ae09249f842 | 223 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 224 | |
Kovalev_D | 124:9ae09249f842 | 225 | break; |
Kovalev_D | 124:9ae09249f842 | 226 | |
Kovalev_D | 124:9ae09249f842 | 227 | case 13: |
Kovalev_D | 124:9ae09249f842 | 228 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 229 | break; |
Kovalev_D | 124:9ae09249f842 | 230 | |
Kovalev_D | 124:9ae09249f842 | 231 | |
Kovalev_D | 124:9ae09249f842 | 232 | |
Kovalev_D | 124:9ae09249f842 | 233 | //ток 1 |
Kovalev_D | 124:9ae09249f842 | 234 | case 14: |
Kovalev_D | 124:9ae09249f842 | 235 | Temp = Gyro.In1; |
Kovalev_D | 124:9ae09249f842 | 236 | BuffTemp[5] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 124:9ae09249f842 | 237 | |
Kovalev_D | 124:9ae09249f842 | 238 | break; |
Kovalev_D | 124:9ae09249f842 | 239 | |
Kovalev_D | 124:9ae09249f842 | 240 | case 15: |
Kovalev_D | 124:9ae09249f842 | 241 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 242 | break; |
Kovalev_D | 124:9ae09249f842 | 243 | |
Kovalev_D | 124:9ae09249f842 | 244 | |
Kovalev_D | 124:9ae09249f842 | 245 | |
Kovalev_D | 124:9ae09249f842 | 246 | //ток 2 |
Kovalev_D | 124:9ae09249f842 | 247 | case 16: |
Kovalev_D | 124:9ae09249f842 | 248 | Temp = Gyro.In2; |
Kovalev_D | 124:9ae09249f842 | 249 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 250 | break; |
Kovalev_D | 124:9ae09249f842 | 251 | |
Kovalev_D | 124:9ae09249f842 | 252 | case 17: |
Kovalev_D | 124:9ae09249f842 | 253 | BuffTemp[5] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 124:9ae09249f842 | 254 | break; |
Kovalev_D | 124:9ae09249f842 | 255 | |
Kovalev_D | 124:9ae09249f842 | 256 | |
Kovalev_D | 124:9ae09249f842 | 257 | |
Kovalev_D | 124:9ae09249f842 | 258 | //разностный температурный канал Delta Temp |
Kovalev_D | 124:9ae09249f842 | 259 | case 18: |
Kovalev_D | 124:9ae09249f842 | 260 | Temp = Gyro.DeltaT; |
Kovalev_D | 124:9ae09249f842 | 261 | BuffTemp[5] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 124:9ae09249f842 | 262 | break; |
Kovalev_D | 124:9ae09249f842 | 263 | |
Kovalev_D | 124:9ae09249f842 | 264 | case 19: |
Kovalev_D | 124:9ae09249f842 | 265 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 266 | break; |
Kovalev_D | 124:9ae09249f842 | 267 | |
Kovalev_D | 124:9ae09249f842 | 268 | |
Kovalev_D | 124:9ae09249f842 | 269 | |
Kovalev_D | 124:9ae09249f842 | 270 | //температурный канал 5 |
Kovalev_D | 124:9ae09249f842 | 271 | case 20: |
Kovalev_D | 124:9ae09249f842 | 272 | Temp = Gyro.Termo;//0xa4=164 |
Kovalev_D | 124:9ae09249f842 | 273 | BuffTemp[5] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 124:9ae09249f842 | 274 | |
Kovalev_D | 124:9ae09249f842 | 275 | break; |
Kovalev_D | 124:9ae09249f842 | 276 | |
Kovalev_D | 124:9ae09249f842 | 277 | case 21: |
Kovalev_D | 124:9ae09249f842 | 278 | BuffTemp[5] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
Kovalev_D | 124:9ae09249f842 | 279 | break; |
Kovalev_D | 124:9ae09249f842 | 280 | } |
Kovalev_D | 162:44e4ded32c6a | 281 | Check(BuffTemp, CRC_N); |
Kovalev_D | 162:44e4ded32c6a | 282 | WriteConN (BuffTemp,CRC_N); |
Kovalev_D | 128:1e4675a36c93 | 283 | |
Kovalev_D | 165:b2bd0c810a4f | 284 | |
Kovalev_D | 165:b2bd0c810a4f | 285 | if(CountParam>20)CountParam=0;//зацикливания буфера от 0 до 21 |
Kovalev_D | 165:b2bd0c810a4f | 286 | else CountParam++; |
Kovalev_D | 124:9ae09249f842 | 287 | |
Kovalev_D | 124:9ae09249f842 | 288 | } |
Kovalev_D | 124:9ae09249f842 | 289 | void CMD_Delta_Ext(void) |
Kovalev_D | 124:9ae09249f842 | 290 | { |
Kovalev_D | 124:9ae09249f842 | 291 | unsigned int Temp; |
Kovalev_D | 128:1e4675a36c93 | 292 | Gyro.EXT_Latch=0; |
Kovalev_D | 124:9ae09249f842 | 293 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 124:9ae09249f842 | 294 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 124:9ae09249f842 | 295 | Temp = Gyro.CuruAngle; |
Kovalev_D | 124:9ae09249f842 | 296 | Gyro.CuruAngle = 0; |
Kovalev_D | 124:9ae09249f842 | 297 | |
Kovalev_D | 124:9ae09249f842 | 298 | BuffTemp[ 2] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 299 | BuffTemp[ 3] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 124:9ae09249f842 | 300 | |
Kovalev_D | 124:9ae09249f842 | 301 | BuffTemp[ 4] = CountParam; |
Kovalev_D | 184:ebcd2bc3be8f | 302 | switch(CountParam) { |
Kovalev_D | 124:9ae09249f842 | 303 | //F_ras |
Kovalev_D | 124:9ae09249f842 | 304 | case 0: |
Kovalev_D | 124:9ae09249f842 | 305 | Temp = Gyro.F_ras; |
Kovalev_D | 124:9ae09249f842 | 306 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 307 | |
Kovalev_D | 124:9ae09249f842 | 308 | break; |
Kovalev_D | 124:9ae09249f842 | 309 | |
Kovalev_D | 124:9ae09249f842 | 310 | case 1: |
Kovalev_D | 124:9ae09249f842 | 311 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 312 | |
Kovalev_D | 124:9ae09249f842 | 313 | break; |
Kovalev_D | 124:9ae09249f842 | 314 | |
Kovalev_D | 124:9ae09249f842 | 315 | |
Kovalev_D | 124:9ae09249f842 | 316 | |
Kovalev_D | 124:9ae09249f842 | 317 | //HFO |
Kovalev_D | 124:9ae09249f842 | 318 | case 2: |
Kovalev_D | 124:9ae09249f842 | 319 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 320 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 321 | |
Kovalev_D | 124:9ae09249f842 | 322 | break; |
Kovalev_D | 124:9ae09249f842 | 323 | |
Kovalev_D | 124:9ae09249f842 | 324 | case 3: |
Kovalev_D | 124:9ae09249f842 | 325 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 326 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 327 | |
Kovalev_D | 124:9ae09249f842 | 328 | break; |
Kovalev_D | 124:9ae09249f842 | 329 | |
Kovalev_D | 124:9ae09249f842 | 330 | |
Kovalev_D | 124:9ae09249f842 | 331 | |
Kovalev_D | 124:9ae09249f842 | 332 | //T_Vibro |
Kovalev_D | 124:9ae09249f842 | 333 | case 4: |
Kovalev_D | 124:9ae09249f842 | 334 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 335 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 336 | |
Kovalev_D | 124:9ae09249f842 | 337 | break; |
Kovalev_D | 124:9ae09249f842 | 338 | |
Kovalev_D | 124:9ae09249f842 | 339 | case 5: |
Kovalev_D | 124:9ae09249f842 | 340 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 128:1e4675a36c93 | 341 | |
Kovalev_D | 124:9ae09249f842 | 342 | break; |
Kovalev_D | 124:9ae09249f842 | 343 | |
Kovalev_D | 124:9ae09249f842 | 344 | |
Kovalev_D | 124:9ae09249f842 | 345 | |
Kovalev_D | 124:9ae09249f842 | 346 | //L_Vibro |
Kovalev_D | 124:9ae09249f842 | 347 | case 6: |
Kovalev_D | 124:9ae09249f842 | 348 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 349 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 122:fbacb932a30b | 350 | |
Kovalev_D | 124:9ae09249f842 | 351 | break; |
Kovalev_D | 124:9ae09249f842 | 352 | |
Kovalev_D | 124:9ae09249f842 | 353 | case 7: |
Kovalev_D | 124:9ae09249f842 | 354 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 355 | break; |
Kovalev_D | 124:9ae09249f842 | 356 | |
Kovalev_D | 124:9ae09249f842 | 357 | |
Kovalev_D | 124:9ae09249f842 | 358 | |
Kovalev_D | 124:9ae09249f842 | 359 | //Напряжение на регуляторе периметра |
Kovalev_D | 124:9ae09249f842 | 360 | case 8: |
Kovalev_D | 165:b2bd0c810a4f | 361 | Temp = Spi.DAC_B /*- 0x7fff*/; |
Kovalev_D | 124:9ae09249f842 | 362 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 363 | |
Kovalev_D | 124:9ae09249f842 | 364 | break; |
Kovalev_D | 124:9ae09249f842 | 365 | |
Kovalev_D | 124:9ae09249f842 | 366 | case 9: |
Kovalev_D | 124:9ae09249f842 | 367 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 368 | break; |
Kovalev_D | 124:9ae09249f842 | 369 | |
Kovalev_D | 124:9ae09249f842 | 370 | |
Kovalev_D | 124:9ae09249f842 | 371 | |
Kovalev_D | 124:9ae09249f842 | 372 | //темпкратурный канал 0 |
Kovalev_D | 124:9ae09249f842 | 373 | case 10: |
Kovalev_D | 124:9ae09249f842 | 374 | Temp = 100; |
Kovalev_D | 124:9ae09249f842 | 375 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 376 | |
Kovalev_D | 124:9ae09249f842 | 377 | break; |
Kovalev_D | 124:9ae09249f842 | 378 | |
Kovalev_D | 124:9ae09249f842 | 379 | case 11: |
Kovalev_D | 124:9ae09249f842 | 380 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 381 | break; |
Kovalev_D | 124:9ae09249f842 | 382 | |
Kovalev_D | 124:9ae09249f842 | 383 | |
Kovalev_D | 124:9ae09249f842 | 384 | |
Kovalev_D | 124:9ae09249f842 | 385 | //темпкратурный канал 1 |
Kovalev_D | 124:9ae09249f842 | 386 | case 12: |
Kovalev_D | 124:9ae09249f842 | 387 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 124:9ae09249f842 | 388 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 389 | |
Kovalev_D | 124:9ae09249f842 | 390 | break; |
Kovalev_D | 124:9ae09249f842 | 391 | |
Kovalev_D | 124:9ae09249f842 | 392 | case 13: |
Kovalev_D | 124:9ae09249f842 | 393 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 394 | break; |
Kovalev_D | 124:9ae09249f842 | 395 | |
Kovalev_D | 124:9ae09249f842 | 396 | |
Kovalev_D | 124:9ae09249f842 | 397 | |
Kovalev_D | 124:9ae09249f842 | 398 | //ток 1 |
Kovalev_D | 124:9ae09249f842 | 399 | case 14: |
Kovalev_D | 124:9ae09249f842 | 400 | Temp = Gyro.In1; |
Kovalev_D | 124:9ae09249f842 | 401 | BuffTemp[5] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 124:9ae09249f842 | 402 | |
Kovalev_D | 124:9ae09249f842 | 403 | break; |
Kovalev_D | 124:9ae09249f842 | 404 | |
Kovalev_D | 124:9ae09249f842 | 405 | case 15: |
Kovalev_D | 124:9ae09249f842 | 406 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 407 | break; |
Kovalev_D | 124:9ae09249f842 | 408 | |
Kovalev_D | 124:9ae09249f842 | 409 | |
Kovalev_D | 124:9ae09249f842 | 410 | |
Kovalev_D | 124:9ae09249f842 | 411 | //ток 2 |
Kovalev_D | 124:9ae09249f842 | 412 | case 16: |
Kovalev_D | 124:9ae09249f842 | 413 | Temp = Gyro.In2; |
Kovalev_D | 124:9ae09249f842 | 414 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 415 | break; |
Kovalev_D | 124:9ae09249f842 | 416 | |
Kovalev_D | 124:9ae09249f842 | 417 | case 17: |
Kovalev_D | 124:9ae09249f842 | 418 | BuffTemp[5] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 124:9ae09249f842 | 419 | break; |
Kovalev_D | 124:9ae09249f842 | 420 | |
Kovalev_D | 124:9ae09249f842 | 421 | |
Kovalev_D | 124:9ae09249f842 | 422 | |
Kovalev_D | 124:9ae09249f842 | 423 | //разностный температурный канал Delta Temp |
Kovalev_D | 124:9ae09249f842 | 424 | case 18: |
Kovalev_D | 124:9ae09249f842 | 425 | Temp = Gyro.DeltaT; |
Kovalev_D | 124:9ae09249f842 | 426 | BuffTemp[5] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 124:9ae09249f842 | 427 | break; |
Kovalev_D | 124:9ae09249f842 | 428 | |
Kovalev_D | 124:9ae09249f842 | 429 | case 19: |
Kovalev_D | 124:9ae09249f842 | 430 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 431 | break; |
Kovalev_D | 124:9ae09249f842 | 432 | |
Kovalev_D | 124:9ae09249f842 | 433 | |
Kovalev_D | 124:9ae09249f842 | 434 | |
Kovalev_D | 124:9ae09249f842 | 435 | //температурный канал 5 |
Kovalev_D | 124:9ae09249f842 | 436 | case 20: |
Kovalev_D | 124:9ae09249f842 | 437 | Temp = Gyro.Termo;//0xa4=164 |
Kovalev_D | 124:9ae09249f842 | 438 | BuffTemp[5] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 124:9ae09249f842 | 439 | break; |
Kovalev_D | 124:9ae09249f842 | 440 | |
Kovalev_D | 124:9ae09249f842 | 441 | case 21: |
Kovalev_D | 124:9ae09249f842 | 442 | BuffTemp[5] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
Kovalev_D | 124:9ae09249f842 | 443 | break; |
Kovalev_D | 124:9ae09249f842 | 444 | } |
Kovalev_D | 162:44e4ded32c6a | 445 | Check(BuffTemp, CRC_N); |
Kovalev_D | 162:44e4ded32c6a | 446 | WriteConN (BuffTemp,CRC_N); |
Kovalev_D | 124:9ae09249f842 | 447 | CountParam++; |
Kovalev_D | 124:9ae09249f842 | 448 | if(CountParam>21)CountParam=0;//зацикливания буфера от 0 до 21 |
Kovalev_D | 122:fbacb932a30b | 449 | } |
Kovalev_D | 124:9ae09249f842 | 450 | |
Kovalev_D | 121:bbae560cdd43 | 451 | void CMD_Rate2(void) |
Kovalev_D | 121:bbae560cdd43 | 452 | { |
Kovalev_D | 124:9ae09249f842 | 453 | Gyro.Rate2_Event=0; |
Kovalev_D | 121:bbae560cdd43 | 454 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 121:bbae560cdd43 | 455 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 121:bbae560cdd43 | 456 | |
Kovalev_D | 121:bbae560cdd43 | 457 | |
Kovalev_D | 121:bbae560cdd43 | 458 | BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. |
Kovalev_D | 121:bbae560cdd43 | 459 | BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. |
Kovalev_D | 121:bbae560cdd43 | 460 | |
Kovalev_D | 121:bbae560cdd43 | 461 | BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. |
Kovalev_D | 121:bbae560cdd43 | 462 | BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. |
Kovalev_D | 124:9ae09249f842 | 463 | |
Kovalev_D | 122:fbacb932a30b | 464 | Check(BuffTemp, 8); |
Kovalev_D | 122:fbacb932a30b | 465 | WriteConN (BuffTemp,8); |
Kovalev_D | 121:bbae560cdd43 | 466 | } |
Kovalev_D | 124:9ae09249f842 | 467 | |
igor_v | 0:8ad47e2b6f00 | 468 | void CMD_Rate(void) |
igor_v | 21:bc8c1cec3da6 | 469 | { |
Kovalev_D | 124:9ae09249f842 | 470 | |
Kovalev_D | 124:9ae09249f842 | 471 | Gyro.Rate1_Event=0; |
Kovalev_D | 108:030cdde08314 | 472 | unsigned int Temp; |
Kovalev_D | 107:4d178bcc9d8a | 473 | |
igor_v | 28:17c84ed091b3 | 474 | Gyro.Firmware_Version=0xff; /// промежуточная затычка |
Kovalev_D | 122:fbacb932a30b | 475 | |
igor_v | 0:8ad47e2b6f00 | 476 | |
igor_v | 28:17c84ed091b3 | 477 | BuffTemp[ 0] = Gyro.SOC_Out; |
igor_v | 28:17c84ed091b3 | 478 | BuffTemp[ 1] = Gyro.My_Addres; |
igor_v | 21:bc8c1cec3da6 | 479 | |
Kovalev_D | 108:030cdde08314 | 480 | |
Kovalev_D | 112:4a96133a1311 | 481 | BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. |
Kovalev_D | 112:4a96133a1311 | 482 | BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. |
Kovalev_D | 108:030cdde08314 | 483 | |
Kovalev_D | 112:4a96133a1311 | 484 | BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. |
Kovalev_D | 112:4a96133a1311 | 485 | BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. |
Kovalev_D | 108:030cdde08314 | 486 | |
Kovalev_D | 113:8be429494918 | 487 | |
Kovalev_D | 108:030cdde08314 | 488 | Temp = Gyro.CuruAngle; |
Kovalev_D | 108:030cdde08314 | 489 | Gyro.CuruAngle = 0; |
Kovalev_D | 162:44e4ded32c6a | 490 | //Temp = Gyro.AD_Fast >> 16; |
Kovalev_D | 108:030cdde08314 | 491 | BuffTemp[ 6] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 108:030cdde08314 | 492 | BuffTemp[ 7] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 108:030cdde08314 | 493 | |
Kovalev_D | 108:030cdde08314 | 494 | |
Kovalev_D | 122:fbacb932a30b | 495 | Temp = Gyro.F_ras; |
Kovalev_D | 122:fbacb932a30b | 496 | BuffTemp[ 8] = (Temp >> 8) & 0xff;//расщипление частота |
Kovalev_D | 122:fbacb932a30b | 497 | BuffTemp[ 9] = (Temp >> 0) & 0xff;// |
igor_v | 21:bc8c1cec3da6 | 498 | |
Kovalev_D | 108:030cdde08314 | 499 | BuffTemp[10] = (Temp >> 8) & 0xff;//выход регулятора гвч; |
Kovalev_D | 122:fbacb932a30b | 500 | BuffTemp[11] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 501 | |
Kovalev_D | 145:f023b2f18b82 | 502 | Temp = (Gyro.AD_Slow >> 16)- 0x7fff; |
Kovalev_D | 108:030cdde08314 | 503 | BuffTemp[12]=(Temp >> 8) & 0xff;//// |
Kovalev_D | 108:030cdde08314 | 504 | BuffTemp[13]=(Temp >> 0) & 0xff;//// |
igor_v | 21:bc8c1cec3da6 | 505 | |
Kovalev_D | 108:030cdde08314 | 506 | |
Kovalev_D | 108:030cdde08314 | 507 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 108:030cdde08314 | 508 | BuffTemp[14] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 509 | BuffTemp[15] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 510 | |
Kovalev_D | 107:4d178bcc9d8a | 511 | BuffTemp[16] = 0xf; |
Kovalev_D | 106:250ddd8629c6 | 512 | BuffTemp[17] = 0x02; |
Kovalev_D | 108:030cdde08314 | 513 | |
igor_v | 21:bc8c1cec3da6 | 514 | |
Kovalev_D | 108:030cdde08314 | 515 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 108:030cdde08314 | 516 | BuffTemp[18] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 517 | BuffTemp[19] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 518 | |
Kovalev_D | 106:250ddd8629c6 | 519 | BuffTemp[20] = 0x00; |
Kovalev_D | 106:250ddd8629c6 | 520 | BuffTemp[21] = 0x00; |
Kovalev_D | 120:9f446f1495e8 | 521 | |
Kovalev_D | 119:4d7fcece9e8e | 522 | |
Kovalev_D | 125:9400e64d0636 | 523 | |
Kovalev_D | 178:1666a83d88a5 | 524 | Temp = Spi.DAC_B - 0x7fff; |
Kovalev_D | 108:030cdde08314 | 525 | BuffTemp[22] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 526 | BuffTemp[23] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 527 | |
Kovalev_D | 121:bbae560cdd43 | 528 | |
Kovalev_D | 178:1666a83d88a5 | 529 | Temp = Gyro.PLC_Delta >> 16; |
Kovalev_D | 121:bbae560cdd43 | 530 | BuffTemp[24] = (Temp >> 8) & 0xff; |
Kovalev_D | 178:1666a83d88a5 | 531 | BuffTemp[25] = (Temp >> 0) & 0xff;// |
Kovalev_D | 113:8be429494918 | 532 | |
Kovalev_D | 178:1666a83d88a5 | 533 | |
Kovalev_D | 178:1666a83d88a5 | 534 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 113:8be429494918 | 535 | BuffTemp[26] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 536 | BuffTemp[27] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 537 | |
Kovalev_D | 113:8be429494918 | 538 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 113:8be429494918 | 539 | BuffTemp[28] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 540 | BuffTemp[29] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 541 | |
Kovalev_D | 113:8be429494918 | 542 | Temp = Gyro.In1; |
Kovalev_D | 113:8be429494918 | 543 | BuffTemp[30] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 113:8be429494918 | 544 | BuffTemp[31] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 545 | |
Kovalev_D | 113:8be429494918 | 546 | Temp = Gyro.In2; |
Kovalev_D | 113:8be429494918 | 547 | BuffTemp[32] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 548 | BuffTemp[33] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 113:8be429494918 | 549 | |
Kovalev_D | 113:8be429494918 | 550 | Temp = Gyro.DeltaT; |
Kovalev_D | 113:8be429494918 | 551 | BuffTemp[34] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 113:8be429494918 | 552 | BuffTemp[35] = (Temp >> 0) & 0xff; |
Kovalev_D | 115:e5a230e5af52 | 553 | |
Kovalev_D | 172:ef7bf1663645 | 554 | Temp = Gyro.Termo; |
Kovalev_D | 184:ebcd2bc3be8f | 555 | // Temp = (0x7fff + Temp)/164; |
Kovalev_D | 184:ebcd2bc3be8f | 556 | Temp = 0x7fff+Temp; |
Kovalev_D | 113:8be429494918 | 557 | BuffTemp[36] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 115:e5a230e5af52 | 558 | BuffTemp[37] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
igor_v | 21:bc8c1cec3da6 | 559 | |
Kovalev_D | 106:250ddd8629c6 | 560 | BuffTemp[38] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 561 | BuffTemp[39] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 562 | BuffTemp[40] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 563 | BuffTemp[41] =0x00; |
igor_v | 21:bc8c1cec3da6 | 564 | |
igor_v | 21:bc8c1cec3da6 | 565 | |
igor_v | 21:bc8c1cec3da6 | 566 | Check(BuffTemp, 44); |
igor_v | 21:bc8c1cec3da6 | 567 | WriteConN (BuffTemp,44); |
Kovalev_D | 92:c892f0311aa7 | 568 | |
igor_v | 0:8ad47e2b6f00 | 569 | } |
Kovalev_D | 179:2b4e6bc277df | 570 | void CMD_M_vib() |
Kovalev_D | 179:2b4e6bc277df | 571 | { |
Kovalev_D | 179:2b4e6bc277df | 572 | unsigned int temp1,temp2; |
igor_v | 0:8ad47e2b6f00 | 573 | |
Kovalev_D | 179:2b4e6bc277df | 574 | temp1 =((BuffTemp[4]<<8) | BuffTemp[5]); |
Kovalev_D | 179:2b4e6bc277df | 575 | temp1=temp1&0xFFFF; |
Kovalev_D | 180:375dcd9c0cb6 | 576 | (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 180:375dcd9c0cb6 | 577 | Gyro.Frq=(122880000/temp1)<<12; |
Kovalev_D | 179:2b4e6bc277df | 578 | |
Kovalev_D | 179:2b4e6bc277df | 579 | temp2 =((BuffTemp[6]<<8) | BuffTemp[7]); |
Kovalev_D | 179:2b4e6bc277df | 580 | temp2=temp2&0xFFFF; |
Kovalev_D | 179:2b4e6bc277df | 581 | |
Kovalev_D | 179:2b4e6bc277df | 582 | Gyro.AmpPer=(((((Gyro.Frq>>12)*200)/16)*temp2)/7680000); |
Kovalev_D | 179:2b4e6bc277df | 583 | |
Kovalev_D | 179:2b4e6bc277df | 584 | // Gyro.AmpPer = ((unsigned int) ((7680000*16/temp1)))*16*16*16; |
Kovalev_D | 179:2b4e6bc277df | 585 | Consol=Gyro.Frq ; |
Kovalev_D | 179:2b4e6bc277df | 586 | } |
igor_v | 21:bc8c1cec3da6 | 587 | void CMD_M_Control_D8()///установка\сброс регистров управления |
igor_v | 21:bc8c1cec3da6 | 588 | { |
Kovalev_D | 104:ab1cb4ff56b2 | 589 | unsigned int bit,NReg,Pa; |
Kovalev_D | 104:ab1cb4ff56b2 | 590 | unsigned int SR,V,A,Bit_num; |
Kovalev_D | 104:ab1cb4ff56b2 | 591 | SR=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 592 | V=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 593 | A=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 594 | Bit_num=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 595 | |
igor_v | 28:17c84ed091b3 | 596 | BuffTemp[0] = Gyro.SOC_Out; //DD |
igor_v | 28:17c84ed091b3 | 597 | BuffTemp[1] = Gyro.My_Addres; //00 |
igor_v | 28:17c84ed091b3 | 598 | BuffTemp[2] = Gyro.CMD_In; //D8 |
Kovalev_D | 104:ab1cb4ff56b2 | 599 | |
Kovalev_D | 104:ab1cb4ff56b2 | 600 | /* |
Kovalev_D | 104:ab1cb4ff56b2 | 601 | |
Kovalev_D | 104:ab1cb4ff56b2 | 602 | FrqON |
Kovalev_D | 104:ab1cb4ff56b2 | 603 | PlcON |
Kovalev_D | 104:ab1cb4ff56b2 | 604 | HFOOFF |
Kovalev_D | 104:ab1cb4ff56b2 | 605 | HFOON |
igor_v | 21:bc8c1cec3da6 | 606 | |
Kovalev_D | 104:ab1cb4ff56b2 | 607 | PlcOFF |
Kovalev_D | 104:ab1cb4ff56b2 | 608 | PlcON |
Kovalev_D | 104:ab1cb4ff56b2 | 609 | */ |
Kovalev_D | 104:ab1cb4ff56b2 | 610 | Pa = BuffTemp[3]; |
Kovalev_D | 104:ab1cb4ff56b2 | 611 | |
Kovalev_D | 104:ab1cb4ff56b2 | 612 | SR = Pa >> 0x7; |
Kovalev_D | 104:ab1cb4ff56b2 | 613 | |
Kovalev_D | 104:ab1cb4ff56b2 | 614 | V = Pa >> 0x5; |
Kovalev_D | 104:ab1cb4ff56b2 | 615 | V = V & 0x3; |
Kovalev_D | 104:ab1cb4ff56b2 | 616 | |
Kovalev_D | 104:ab1cb4ff56b2 | 617 | A = Pa >> 0x4; |
Kovalev_D | 104:ab1cb4ff56b2 | 618 | A = A & 0x1; |
Kovalev_D | 104:ab1cb4ff56b2 | 619 | |
Kovalev_D | 104:ab1cb4ff56b2 | 620 | Bit_num = Pa & 0xf; |
Kovalev_D | 104:ab1cb4ff56b2 | 621 | |
Kovalev_D | 104:ab1cb4ff56b2 | 622 | if(SR) { |
Kovalev_D | 104:ab1cb4ff56b2 | 623 | switch (Bit_num){ |
Kovalev_D | 105:bd01d8d20fb6 | 624 | |
Kovalev_D | 104:ab1cb4ff56b2 | 625 | case 0x06: |
Kovalev_D | 104:ab1cb4ff56b2 | 626 | FrqON |
Kovalev_D | 105:bd01d8d20fb6 | 627 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 628 | |
Kovalev_D | 171:d227a6045305 | 629 | case 0x05: |
Kovalev_D | 171:d227a6045305 | 630 | AVibON |
Kovalev_D | 171:d227a6045305 | 631 | break; |
Kovalev_D | 171:d227a6045305 | 632 | |
Kovalev_D | 171:d227a6045305 | 633 | case 0x01: |
Kovalev_D | 105:bd01d8d20fb6 | 634 | HFOON |
Kovalev_D | 105:bd01d8d20fb6 | 635 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 636 | |
Kovalev_D | 171:d227a6045305 | 637 | case 0x03: |
Kovalev_D | 105:bd01d8d20fb6 | 638 | PlcON |
Kovalev_D | 105:bd01d8d20fb6 | 639 | break; |
Kovalev_D | 104:ab1cb4ff56b2 | 640 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 641 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 642 | else{ |
Kovalev_D | 104:ab1cb4ff56b2 | 643 | switch (Bit_num){ |
Kovalev_D | 105:bd01d8d20fb6 | 644 | |
Kovalev_D | 105:bd01d8d20fb6 | 645 | case 0x06: |
Kovalev_D | 171:d227a6045305 | 646 | FrqOFF |
Kovalev_D | 171:d227a6045305 | 647 | break; |
Kovalev_D | 171:d227a6045305 | 648 | |
Kovalev_D | 171:d227a6045305 | 649 | case 0x05: |
Kovalev_D | 171:d227a6045305 | 650 | AVibOFF |
Kovalev_D | 171:d227a6045305 | 651 | break; |
Kovalev_D | 171:d227a6045305 | 652 | |
Kovalev_D | 171:d227a6045305 | 653 | case 0x01: |
Kovalev_D | 171:d227a6045305 | 654 | HFOOFF |
Kovalev_D | 105:bd01d8d20fb6 | 655 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 656 | |
Kovalev_D | 105:bd01d8d20fb6 | 657 | case 0x03: |
Kovalev_D | 105:bd01d8d20fb6 | 658 | PlcOFF |
Kovalev_D | 105:bd01d8d20fb6 | 659 | break; |
Kovalev_D | 104:ab1cb4ff56b2 | 660 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 661 | } |
Kovalev_D | 129:406995a91322 | 662 | BuffTemp[0] = Gyro.SOC_Out; //DD |
Kovalev_D | 129:406995a91322 | 663 | BuffTemp[1] = Gyro.My_Addres; //00 |
Kovalev_D | 129:406995a91322 | 664 | BuffTemp[2] = Gyro.CMD_In; //D8 |
Kovalev_D | 129:406995a91322 | 665 | BuffTemp[3] = A<<4; |
Kovalev_D | 129:406995a91322 | 666 | BuffTemp[4] = 0x0; |
Kovalev_D | 129:406995a91322 | 667 | BuffTemp[5] = 0x0; |
Kovalev_D | 129:406995a91322 | 668 | Check(BuffTemp, CRC_N); |
Kovalev_D | 129:406995a91322 | 669 | WriteConN (BuffTemp,CRC_N); |
igor_v | 0:8ad47e2b6f00 | 670 | } |
igor_v | 0:8ad47e2b6f00 | 671 | |
igor_v | 21:bc8c1cec3da6 | 672 | void CMD_M_Control_D9()///чтение регистров управления |
igor_v | 21:bc8c1cec3da6 | 673 | { |
igor_v | 21:bc8c1cec3da6 | 674 | int bit,NReg; |
igor_v | 28:17c84ed091b3 | 675 | BuffTemp[0] = Gyro.SOC_Out; //DD |
igor_v | 28:17c84ed091b3 | 676 | BuffTemp[1] = Gyro.My_Addres; //00 |
igor_v | 28:17c84ed091b3 | 677 | BuffTemp[2] = Gyro.CMD_In; //D9 |
igor_v | 21:bc8c1cec3da6 | 678 | if ((Param1 & 0x10) == 0) { |
igor_v | 21:bc8c1cec3da6 | 679 | BuffTemp[3]=0<<4; |
igor_v | 28:17c84ed091b3 | 680 | BuffTemp[4] = (Gyro.RgConA>>8 )& 0xff; |
igor_v | 28:17c84ed091b3 | 681 | BuffTemp[5] = Gyro.RgConA & 0xff; |
igor_v | 21:bc8c1cec3da6 | 682 | } else { |
igor_v | 21:bc8c1cec3da6 | 683 | BuffTemp[3]=1<<4; |
igor_v | 28:17c84ed091b3 | 684 | BuffTemp[4] = (Gyro.RgConB>>8 ) & 0xff; |
igor_v | 28:17c84ed091b3 | 685 | BuffTemp[5] = Gyro.RgConB & 0xff; |
igor_v | 21:bc8c1cec3da6 | 686 | } |
igor_v | 21:bc8c1cec3da6 | 687 | Check(BuffTemp, CRC_N); |
igor_v | 21:bc8c1cec3da6 | 688 | WriteConN (BuffTemp,CRC_N); |
igor_v | 21:bc8c1cec3da6 | 689 | } |
igor_v | 21:bc8c1cec3da6 | 690 | // (номер (код) ЦАПа 0...3, старший байт требуемого ЦАПа, младший байт треб ЦАПа) |
igor_v | 0:8ad47e2b6f00 | 691 | void CMD_M_Stymul() |
igor_v | 0:8ad47e2b6f00 | 692 | { |
igor_v | 21:bc8c1cec3da6 | 693 | int temp; |
Kovalev_D | 102:4270092be987 | 694 | int HFO; |
Kovalev_D | 102:4270092be987 | 695 | temp=BuffTemp[3]; |
Kovalev_D | 102:4270092be987 | 696 | Consol = temp&0x3; |
Kovalev_D | 103:e96f08947def | 697 | HFO = temp&0x3;// // (номер (код) ЦАПа 0...3, HFO - 3dac, PLC - 0DAC |
igor_v | 21:bc8c1cec3da6 | 698 | temp =((BuffTemp[4]<<8) | BuffTemp[5]); |
igor_v | 21:bc8c1cec3da6 | 699 | // temp=0; |
igor_v | 21:bc8c1cec3da6 | 700 | temp=temp&0xFFFF; |
Kovalev_D | 102:4270092be987 | 701 | |
Kovalev_D | 102:4270092be987 | 702 | if(HFO) |
Kovalev_D | 102:4270092be987 | 703 | { |
Kovalev_D | 102:4270092be987 | 704 | Spi.DAC_A=(unsigned int)temp; |
Kovalev_D | 102:4270092be987 | 705 | } |
Kovalev_D | 102:4270092be987 | 706 | else{ |
igor_v | 21:bc8c1cec3da6 | 707 | DACF =(temp*K_DAC)+deltaDAC; |
igor_v | 21:bc8c1cec3da6 | 708 | Spi.DAC_B =(unsigned int)(DACF) /*(unsigned int)(temp*K_DAC+deltaDAC)*/; // K_DAC); |
igor_v | 21:bc8c1cec3da6 | 709 | } |
igor_v | 0:8ad47e2b6f00 | 710 | } |
Kovalev_D | 103:e96f08947def | 711 | void Gph_W() |
Kovalev_D | 103:e96f08947def | 712 | { |
Kovalev_D | 172:ef7bf1663645 | 713 | Gyro.flagGph_W=3; |
Kovalev_D | 172:ef7bf1663645 | 714 | Out_G_photo(BuffTemp[4],BuffTemp[5]); |
Kovalev_D | 172:ef7bf1663645 | 715 | |
Kovalev_D | 103:e96f08947def | 716 | } |
igor_v | 0:8ad47e2b6f00 | 717 | |
Kovalev_D | 102:4270092be987 | 718 | |
igor_v | 0:8ad47e2b6f00 | 719 | unsigned int Check(char *c, unsigned int Count) |
igor_v | 0:8ad47e2b6f00 | 720 | { |
igor_v | 21:bc8c1cec3da6 | 721 | int i=1; |
igor_v | 21:bc8c1cec3da6 | 722 | unsigned int temp,CRC; |
igor_v | 21:bc8c1cec3da6 | 723 | |
igor_v | 21:bc8c1cec3da6 | 724 | |
igor_v | 21:bc8c1cec3da6 | 725 | temp=1; |
igor_v | 21:bc8c1cec3da6 | 726 | CRC=0; |
igor_v | 21:bc8c1cec3da6 | 727 | |
igor_v | 21:bc8c1cec3da6 | 728 | |
igor_v | 21:bc8c1cec3da6 | 729 | for(; i<Count-2; i++) { |
igor_v | 21:bc8c1cec3da6 | 730 | CRC+=c[i]; |
igor_v | 21:bc8c1cec3da6 | 731 | } |
igor_v | 0:8ad47e2b6f00 | 732 | |
igor_v | 21:bc8c1cec3da6 | 733 | if(c[Count-2]!=((CRC>>8)&0xFF)) { |
igor_v | 21:bc8c1cec3da6 | 734 | temp=0; |
igor_v | 28:17c84ed091b3 | 735 | Gyro.RsErrLine = (Gyro.RsErrLine)&=0x2; |
igor_v | 21:bc8c1cec3da6 | 736 | } |
igor_v | 0:8ad47e2b6f00 | 737 | |
igor_v | 21:bc8c1cec3da6 | 738 | if(c[Count-1]!=((CRC>>0)&0xFF)) { |
igor_v | 21:bc8c1cec3da6 | 739 | temp=0; |
igor_v | 28:17c84ed091b3 | 740 | // Gyro.RsErrLine= (Gyro.RsErrLine)=0x2; |
igor_v | 21:bc8c1cec3da6 | 741 | } |
igor_v | 21:bc8c1cec3da6 | 742 | |
igor_v | 21:bc8c1cec3da6 | 743 | c[Count-2]=(CRC>>8)&0xFF; |
igor_v | 21:bc8c1cec3da6 | 744 | c[Count-1]=(CRC>>0)&0xFF; |
igor_v | 21:bc8c1cec3da6 | 745 | |
igor_v | 21:bc8c1cec3da6 | 746 | |
igor_v | 21:bc8c1cec3da6 | 747 | |
igor_v | 21:bc8c1cec3da6 | 748 | return temp; |
igor_v | 0:8ad47e2b6f00 | 749 | } |
igor_v | 0:8ad47e2b6f00 | 750 | |
igor_v | 0:8ad47e2b6f00 | 751 | int Getlengf(void) |
igor_v | 0:8ad47e2b6f00 | 752 | { |
Kovalev_D | 121:bbae560cdd43 | 753 | unsigned int lengf; |
Kovalev_D | 121:bbae560cdd43 | 754 | lengf = 1; |
igor_v | 28:17c84ed091b3 | 755 | switch(Gyro.CMD_In) { |
igor_v | 28:17c84ed091b3 | 756 | case 0x99://Gyrotainance |
Kovalev_D | 92:c892f0311aa7 | 757 | |
igor_v | 21:bc8c1cec3da6 | 758 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 759 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 760 | break; |
igor_v | 0:8ad47e2b6f00 | 761 | |
igor_v | 21:bc8c1cec3da6 | 762 | case 0x0A: //m_stymul |
igor_v | 21:bc8c1cec3da6 | 763 | lengf=8; |
igor_v | 21:bc8c1cec3da6 | 764 | break; |
igor_v | 21:bc8c1cec3da6 | 765 | |
Kovalev_D | 129:406995a91322 | 766 | case 0xE9://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 767 | |
igor_v | 21:bc8c1cec3da6 | 768 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 769 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 770 | break; |
Kovalev_D | 129:406995a91322 | 771 | case 0xE8://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 772 | |
Kovalev_D | 129:406995a91322 | 773 | lengf=6; |
Kovalev_D | 129:406995a91322 | 774 | CRC_N=8; |
Kovalev_D | 129:406995a91322 | 775 | break; |
Kovalev_D | 129:406995a91322 | 776 | |
Kovalev_D | 129:406995a91322 | 777 | case 0xA5://DeviceMode |
Kovalev_D | 129:406995a91322 | 778 | |
Kovalev_D | 129:406995a91322 | 779 | lengf=6; |
Kovalev_D | 129:406995a91322 | 780 | CRC_N=8; |
Kovalev_D | 129:406995a91322 | 781 | break; |
Kovalev_D | 129:406995a91322 | 782 | |
igor_v | 21:bc8c1cec3da6 | 783 | case 0xDD://m_rate |
igor_v | 21:bc8c1cec3da6 | 784 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 785 | CRC_N=44; |
igor_v | 21:bc8c1cec3da6 | 786 | break; |
Kovalev_D | 162:44e4ded32c6a | 787 | |
Kovalev_D | 162:44e4ded32c6a | 788 | |
Kovalev_D | 124:9ae09249f842 | 789 | case 0xA0://Delta_PS |
Kovalev_D | 124:9ae09249f842 | 790 | lengf=6; |
Kovalev_D | 124:9ae09249f842 | 791 | CRC_N=8; |
Kovalev_D | 124:9ae09249f842 | 792 | break; |
Kovalev_D | 124:9ae09249f842 | 793 | |
Kovalev_D | 124:9ae09249f842 | 794 | |
igor_v | 21:bc8c1cec3da6 | 795 | case 0xB0://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 796 | |
igor_v | 21:bc8c1cec3da6 | 797 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 798 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 799 | break; |
igor_v | 21:bc8c1cec3da6 | 800 | |
igor_v | 21:bc8c1cec3da6 | 801 | case 0xD8://m_control |
igor_v | 0:8ad47e2b6f00 | 802 | |
igor_v | 21:bc8c1cec3da6 | 803 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 804 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 805 | break; |
igor_v | 21:bc8c1cec3da6 | 806 | |
igor_v | 21:bc8c1cec3da6 | 807 | case 0xD9://m_control |
igor_v | 0:8ad47e2b6f00 | 808 | |
igor_v | 21:bc8c1cec3da6 | 809 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 810 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 811 | break; |
Kovalev_D | 102:4270092be987 | 812 | |
Kovalev_D | 102:4270092be987 | 813 | case 0xE4: |
Kovalev_D | 98:95b8e79f13e1 | 814 | lengf=8; |
Kovalev_D | 98:95b8e79f13e1 | 815 | break; |
Kovalev_D | 103:e96f08947def | 816 | |
Kovalev_D | 103:e96f08947def | 817 | |
Kovalev_D | 103:e96f08947def | 818 | case 0xE6: |
Kovalev_D | 103:e96f08947def | 819 | lengf=8; |
Kovalev_D | 103:e96f08947def | 820 | break; |
Kovalev_D | 103:e96f08947def | 821 | |
igor_v | 21:bc8c1cec3da6 | 822 | } |
Kovalev_D | 98:95b8e79f13e1 | 823 | |
igor_v | 21:bc8c1cec3da6 | 824 | return lengf; |
igor_v | 0:8ad47e2b6f00 | 825 | } |
igor_v | 0:8ad47e2b6f00 | 826 | |
igor_v | 0:8ad47e2b6f00 | 827 | void Read_CMD(void) |
igor_v | 21:bc8c1cec3da6 | 828 | { |
Kovalev_D | 188:4c523cc373cc | 829 | |
Kovalev_D | 147:1aed74f19a8f | 830 | Gyro.RsErrLine = (Gyro.RsErrLine)& 0xffff;//для сброса ошибки |
Kovalev_D | 188:4c523cc373cc | 831 | CountBuFFIn=ReadChekCon1(BuffTemp); |
Kovalev_D | 188:4c523cc373cc | 832 | // чтение данных из консоли |
Kovalev_D | 188:4c523cc373cc | 833 | if(CountBuFFIn==1) { |
Kovalev_D | 188:4c523cc373cc | 834 | LoopOn // если есть первый байт |
Kovalev_D | 147:1aed74f19a8f | 835 | if (BuffTemp[0] != SOC_In) { |
Kovalev_D | 147:1aed74f19a8f | 836 | ReadCon1(BuffTemp); |
Kovalev_D | 147:1aed74f19a8f | 837 | Gyro.RsErrLine += 0x100;//WriteCon("\n\r ...Error.... "); |
Kovalev_D | 147:1aed74f19a8f | 838 | BuffTemp[99]=Gyro.RsErrLine; |
Kovalev_D | 147:1aed74f19a8f | 839 | } |
Kovalev_D | 147:1aed74f19a8f | 840 | } |
Kovalev_D | 147:1aed74f19a8f | 841 | else if(CountBuFFIn==2) //если второй ,fqn |
Kovalev_D | 147:1aed74f19a8f | 842 | { |
Kovalev_D | 147:1aed74f19a8f | 843 | if (BuffTemp[1] != Gyro.My_Addres) { |
Kovalev_D | 93:b3803774f110 | 844 | ReadCon1(BuffTemp); |
Diletant | 149:abbf7663d27d | 845 | Gyro.RsErrLine += 0x1;WriteCon("\n\r ...Error_ADDRES.... "); |
Kovalev_D | 188:4c523cc373cc | 846 | } |
Kovalev_D | 147:1aed74f19a8f | 847 | } |
Kovalev_D | 147:1aed74f19a8f | 848 | else if(CountBuFFIn==3) // если ьоетий байт |
Kovalev_D | 147:1aed74f19a8f | 849 | { |
igor_v | 28:17c84ed091b3 | 850 | Gyro.CMD_In=BuffTemp[2]; |
Kovalev_D | 92:c892f0311aa7 | 851 | N=Getlengf(); |
Kovalev_D | 92:c892f0311aa7 | 852 | } |
Kovalev_D | 92:c892f0311aa7 | 853 | else if(CountBuFFIn==4 && (N==6)) |
Kovalev_D | 92:c892f0311aa7 | 854 | { // N - длина посылки аскглд(для записи параметров). определяется по коду команды в Getlengf(); |
igor_v | 21:bc8c1cec3da6 | 855 | Param1=BuffTemp[3]; |
Kovalev_D | 92:c892f0311aa7 | 856 | } |
Kovalev_D | 92:c892f0311aa7 | 857 | else if((CountBuFFIn==5)&&(N==7)) |
Kovalev_D | 92:c892f0311aa7 | 858 | { |
igor_v | 21:bc8c1cec3da6 | 859 | Param1=BuffTemp[3]; |
igor_v | 21:bc8c1cec3da6 | 860 | Param2=BuffTemp[4]; |
igor_v | 0:8ad47e2b6f00 | 861 | |
Kovalev_D | 92:c892f0311aa7 | 862 | } |
Kovalev_D | 92:c892f0311aa7 | 863 | else if((CountBuFFIn==6)&&(N==8)) |
Kovalev_D | 147:1aed74f19a8f | 864 | { |
igor_v | 21:bc8c1cec3da6 | 865 | Param1=BuffTemp[3]; |
igor_v | 21:bc8c1cec3da6 | 866 | Param2=BuffTemp[4]; |
igor_v | 21:bc8c1cec3da6 | 867 | Param3=BuffTemp[5]; |
Kovalev_D | 92:c892f0311aa7 | 868 | } |
Kovalev_D | 102:4270092be987 | 869 | else if((CountBuFFIn==8)&&(N==10)) |
Kovalev_D | 147:1aed74f19a8f | 870 | { |
Kovalev_D | 102:4270092be987 | 871 | Param1=BuffTemp[4]; |
Kovalev_D | 102:4270092be987 | 872 | Param2=BuffTemp[5]; |
Kovalev_D | 102:4270092be987 | 873 | Param3=BuffTemp[6]; |
Kovalev_D | 102:4270092be987 | 874 | Param4=BuffTemp[7]; |
Kovalev_D | 102:4270092be987 | 875 | } |
Kovalev_D | 98:95b8e79f13e1 | 876 | |
Kovalev_D | 92:c892f0311aa7 | 877 | else if(CountBuFFIn > (N-1)) |
Kovalev_D | 92:c892f0311aa7 | 878 | { |
Kovalev_D | 147:1aed74f19a8f | 879 | ReadCon1(BuffTemp); |
Kovalev_D | 147:1aed74f19a8f | 880 | switch(Gyro.CMD_In) { |
Kovalev_D | 147:1aed74f19a8f | 881 | Rate_Flag=0; |
Kovalev_D | 92:c892f0311aa7 | 882 | case 0x99: |
Kovalev_D | 124:9ae09249f842 | 883 | Gyro.ModeOut=0; |
Kovalev_D | 185:7e200f4d9b16 | 884 | CMD_Maintenance(); |
Kovalev_D | 124:9ae09249f842 | 885 | break; |
Kovalev_D | 129:406995a91322 | 886 | |
Kovalev_D | 124:9ae09249f842 | 887 | case 0xA0: |
Kovalev_D | 185:7e200f4d9b16 | 888 | DropDelay();//выставка задержки для мультидропа сбрасывается в команде CMD_Maintenance() на 45 микросекунд; |
Kovalev_D | 124:9ae09249f842 | 889 | TempParam=(BuffTemp[3]) & 0x90; |
Kovalev_D | 165:b2bd0c810a4f | 890 | if (TempParam==Delta_500) {CMD_Delta_500Hz();} |
Kovalev_D | 165:b2bd0c810a4f | 891 | else if (TempParam==Delta_EXT) {CMD_Delta_Ext(); } |
Kovalev_D | 184:ebcd2bc3be8f | 892 | else if (TempParam==PDelta_500) { Gyro.ModeOut=3; Gyro.Delta500_Event=0; /*WriteCon("Delta500");*/ } |
Kovalev_D | 184:ebcd2bc3be8f | 893 | else if (TempParam==PDelta_EXT) { Gyro.ModeOut=4; Gyro.DeltaEXT_Event=0;/* WriteCon("deltaEXT"); */} |
Kovalev_D | 147:1aed74f19a8f | 894 | break; |
Kovalev_D | 129:406995a91322 | 895 | |
igor_v | 21:bc8c1cec3da6 | 896 | case 0xD8: |
igor_v | 21:bc8c1cec3da6 | 897 | CMD_M_Control_D8(); |
Kovalev_D | 147:1aed74f19a8f | 898 | break; |
Kovalev_D | 129:406995a91322 | 899 | |
Kovalev_D | 129:406995a91322 | 900 | case 0xE9://чтение параметров |
Kovalev_D | 129:406995a91322 | 901 | CMD_M_Param_R(); |
Kovalev_D | 147:1aed74f19a8f | 902 | break; |
Kovalev_D | 129:406995a91322 | 903 | |
Kovalev_D | 129:406995a91322 | 904 | case 0xE8://запись параметра |
Kovalev_D | 129:406995a91322 | 905 | CMD_M_Param_W(); |
Kovalev_D | 147:1aed74f19a8f | 906 | break; |
Kovalev_D | 188:4c523cc373cc | 907 | case 0xDA: |
Kovalev_D | 188:4c523cc373cc | 908 | switch(Gyro.My_Addres){//смещение поджига и подсветки в зависимости от адреса ГЛД |
Kovalev_D | 188:4c523cc373cc | 909 | case 0: |
Kovalev_D | 188:4c523cc373cc | 910 | Gyro.Discharg = StartDischarg << ShiftStart0; |
Kovalev_D | 188:4c523cc373cc | 911 | Gyro.BackLight = StartBackLight << ShiftStart0; |
Kovalev_D | 188:4c523cc373cc | 912 | break; |
Kovalev_D | 188:4c523cc373cc | 913 | case 1: |
Kovalev_D | 188:4c523cc373cc | 914 | Gyro.Discharg = StartDischarg << ShiftStart1; |
Kovalev_D | 188:4c523cc373cc | 915 | Gyro.BackLight = StartBackLight << ShiftStart1; |
Kovalev_D | 188:4c523cc373cc | 916 | break; |
Kovalev_D | 188:4c523cc373cc | 917 | case 2: |
Kovalev_D | 188:4c523cc373cc | 918 | Gyro.Discharg = StartDischarg << ShiftStart2; |
Kovalev_D | 188:4c523cc373cc | 919 | Gyro.BackLight = StartBackLight << ShiftStart2; |
Kovalev_D | 188:4c523cc373cc | 920 | break; |
Kovalev_D | 188:4c523cc373cc | 921 | case 3: |
Kovalev_D | 188:4c523cc373cc | 922 | Gyro.Discharg = StartDischarg << ShiftStart3; |
Kovalev_D | 188:4c523cc373cc | 923 | Gyro.BackLight = StartBackLight << ShiftStart3; |
Kovalev_D | 188:4c523cc373cc | 924 | break; |
Kovalev_D | 188:4c523cc373cc | 925 | } |
Kovalev_D | 188:4c523cc373cc | 926 | break; |
igor_v | 21:bc8c1cec3da6 | 927 | case 0xD9: |
igor_v | 21:bc8c1cec3da6 | 928 | CMD_M_Control_D9(); |
Kovalev_D | 147:1aed74f19a8f | 929 | break; |
Kovalev_D | 129:406995a91322 | 930 | |
igor_v | 21:bc8c1cec3da6 | 931 | case 0x0A: |
Kovalev_D | 45:cbc955aecebe | 932 | CMD_M_Stymul(); |
Kovalev_D | 147:1aed74f19a8f | 933 | break; |
Kovalev_D | 129:406995a91322 | 934 | |
igor_v | 21:bc8c1cec3da6 | 935 | case 0xDD: |
Kovalev_D | 185:7e200f4d9b16 | 936 | |
Kovalev_D | 147:1aed74f19a8f | 937 | TempParam=(BuffTemp[3]) & 0x9f; |
Kovalev_D | 147:1aed74f19a8f | 938 | if (TempParam == Rate1) { CMD_Rate(); WriteCon("Rate11");} |
Kovalev_D | 165:b2bd0c810a4f | 939 | else if (TempParam == Rate2) { CMD_Rate2(); WriteCon("Rate21");} |
Kovalev_D | 147:1aed74f19a8f | 940 | else if (TempParam == PRate1) { Gyro.ModeOut=1; Gyro.Rate1_Event=0; WriteCon("Rate12");} |
Kovalev_D | 147:1aed74f19a8f | 941 | else if (TempParam == PRate2) { Gyro.ModeOut=2; Gyro.Rate2_Event=0; WriteCon("Rate22");} |
Kovalev_D | 147:1aed74f19a8f | 942 | break; |
Kovalev_D | 129:406995a91322 | 943 | |
Kovalev_D | 147:1aed74f19a8f | 944 | case 0xE4: |
Kovalev_D | 102:4270092be987 | 945 | CMD_M_vib(); |
Kovalev_D | 147:1aed74f19a8f | 946 | break; |
Kovalev_D | 129:406995a91322 | 947 | |
Kovalev_D | 103:e96f08947def | 948 | case 0xE6: |
Kovalev_D | 103:e96f08947def | 949 | Gph_W(); |
Kovalev_D | 147:1aed74f19a8f | 950 | break; |
Kovalev_D | 147:1aed74f19a8f | 951 | Gyro.RsErrLine = 0; |
Kovalev_D | 147:1aed74f19a8f | 952 | } |
Kovalev_D | 102:4270092be987 | 953 | } |
Kovalev_D | 147:1aed74f19a8f | 954 | } |
Kovalev_D | 147:1aed74f19a8f | 955 | void TechLog(void) |
Kovalev_D | 147:1aed74f19a8f | 956 | { |
Kovalev_D | 147:1aed74f19a8f | 957 | if (ReadCon (Time)) { |
Kovalev_D | 147:1aed74f19a8f | 958 | ///////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 959 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 960 | //////////////////////Выбор FlashMod/////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 961 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 121:bbae560cdd43 | 962 | |
Kovalev_D | 147:1aed74f19a8f | 963 | if (Time[0] == 'B') {Gyro.FlashMod=1;} |
Kovalev_D | 147:1aed74f19a8f | 964 | if (Time[0] == 'W') {Gyro.FlashMod=2;} |
Kovalev_D | 147:1aed74f19a8f | 965 | if (Time[0] == 'R') {Gyro.FlashMod=3;} |
Kovalev_D | 147:1aed74f19a8f | 966 | /////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 967 | /////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 968 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 969 | if (Time[0] == 'H') { // если ввели буквц h то выдать подсказку. сделанно через принф ОЧЕНЬ плохо в работе не использовать |
Kovalev_D | 147:1aed74f19a8f | 970 | sprintf(Time,"\r\nCompiled: %s %s.",__DATE__, __TIME__ ); //Подготовка даты и времени компиляции |
Kovalev_D | 147:1aed74f19a8f | 971 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 972 | sprintf(Time,"--%d.%3.d.%2.d.",Time1Hz,Time1K,Time100K); //Временно выдачпа временни из трех чисел |
Kovalev_D | 147:1aed74f19a8f | 973 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 974 | } |
Kovalev_D | 147:1aed74f19a8f | 975 | if (Time[0] == 'D') { |
Kovalev_D | 147:1aed74f19a8f | 976 | Gyro.Discharg = StartDischarg; |
Kovalev_D | 147:1aed74f19a8f | 977 | } |
Kovalev_D | 147:1aed74f19a8f | 978 | if (Time[0] == 'L') { |
Kovalev_D | 147:1aed74f19a8f | 979 | Gyro.BackLight = StartBackLight; |
Kovalev_D | 147:1aed74f19a8f | 980 | } |
Kovalev_D | 147:1aed74f19a8f | 981 | if (Time[0] == 'F') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 982 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 983 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 984 | sprintf((Time)," Gyro.Termo = <%07d> Spi.ADC1 = <%07d> Spi.ADC1_Accum = <%07d>",Spi.ADC4,Spi.ADC4,Spi.ADC4_Accum ); |
Kovalev_D | 147:1aed74f19a8f | 985 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 986 | } |
Kovalev_D | 147:1aed74f19a8f | 987 | if (Time[0] == 'q') { // внешняя защелка |
Kovalev_D | 147:1aed74f19a8f | 988 | Gyro.EXT_Latch=1; |
Kovalev_D | 147:1aed74f19a8f | 989 | } |
Kovalev_D | 147:1aed74f19a8f | 990 | if (Time[0] == '1') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 991 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 992 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 993 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_1Point[i]); |
Kovalev_D | 147:1aed74f19a8f | 994 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 995 | } |
Kovalev_D | 147:1aed74f19a8f | 996 | if (Time[0] == '2') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 997 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 998 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 999 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_8Point[i]); |
Kovalev_D | 147:1aed74f19a8f | 1000 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1001 | } |
Kovalev_D | 147:1aed74f19a8f | 1002 | if (Time[0] == '3') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1003 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1004 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1005 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_16Point[i]); |
Kovalev_D | 147:1aed74f19a8f | 1006 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1007 | } |
Kovalev_D | 147:1aed74f19a8f | 1008 | if (Time[0] == '4') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1009 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1010 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1011 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_16PointD[i]); |
Kovalev_D | 147:1aed74f19a8f | 1012 | WriteCon(Time); |
Kovalev_D | 175:daffcc97d532 | 1013 | } |
Kovalev_D | 147:1aed74f19a8f | 1014 | if (Time[0] == 'z'){ // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1015 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1016 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1017 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 147:1aed74f19a8f | 1018 | { |
Kovalev_D | 175:daffcc97d532 | 1019 | ttemp=(Buff_Restored_sin[i]); |
Kovalev_D | 175:daffcc97d532 | 1020 | if (ttemp > 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 147:1aed74f19a8f | 1021 | } |
Kovalev_D | 175:daffcc97d532 | 1022 | } |
Kovalev_D | 147:1aed74f19a8f | 1023 | if (Time[0] == '6') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1024 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1025 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1026 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_Restored_sin[i]); |
Kovalev_D | 147:1aed74f19a8f | 1027 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1028 | } |
Kovalev_D | 147:1aed74f19a8f | 1029 | if (Time[0] == '7') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1030 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1031 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1032 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 10)," <%07d> ",Buff_AMP64P[i]-(Buff_AMP[i])); |
Kovalev_D | 147:1aed74f19a8f | 1033 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1034 | } |
Kovalev_D | 147:1aed74f19a8f | 1035 | if (Time[0] == '9') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1036 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1037 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1038 | for (int i = 0; i < 32; i++ )sprintf((Time)," <%07d> ",Gyro.Frq); |
Kovalev_D | 147:1aed74f19a8f | 1039 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1040 | } |
Kovalev_D | 147:1aed74f19a8f | 1041 | if (Time[0] == 'p') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1042 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1043 | WriteCon(Time); |
Kovalev_D | 185:7e200f4d9b16 | 1044 | for (int i = 0; i < 32; i++ )sprintf((Time)," <%07d> ",Gyro.MaxAmp); |
Kovalev_D | 147:1aed74f19a8f | 1045 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1046 | } |
Kovalev_D | 179:2b4e6bc277df | 1047 | if (Time[0] == 'x') { // выдача технологическая |
Kovalev_D | 179:2b4e6bc277df | 1048 | sprintf(Time,"\r\n"); |
Kovalev_D | 179:2b4e6bc277df | 1049 | WriteCon(Time); |
Kovalev_D | 179:2b4e6bc277df | 1050 | sprintf((Time)," Gyro.MaxAmp = <%07d> Gyro.CaunPlus = <%07d> Gyro.CaunMin= <%07d> Gyro.CaunPlus+Gyro.CaunMin-5000 <%07d> ",Gyro.MaxAmp, Gyro.CaunPlus, Gyro.CaunMin, ((Gyro.CaunPlus + Gyro.CaunMin)-5000)); |
Kovalev_D | 179:2b4e6bc277df | 1051 | WriteCon(Time); |
Kovalev_D | 179:2b4e6bc277df | 1052 | } |
Kovalev_D | 147:1aed74f19a8f | 1053 | if (Time[0] == 'm') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1054 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1055 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1056 | sprintf((Time),"PLC_Delta <%07d> ", Gyro.PLC_Delta); WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1057 | sprintf((Time),"PLC_DeltaADD <%07d> ", Gyro.PLC_DeltaADD); WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1058 | } |
Kovalev_D | 147:1aed74f19a8f | 1059 | if (Time[0] == 'V') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1060 | Spi.DAC_B += 200; |
Kovalev_D | 147:1aed74f19a8f | 1061 | } |
Kovalev_D | 147:1aed74f19a8f | 1062 | if (Time[0] == 'v') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1063 | Spi.DAC_B -= 200; |
Kovalev_D | 147:1aed74f19a8f | 1064 | } |
Kovalev_D | 147:1aed74f19a8f | 1065 | //////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 150:29c9f7671bac | 1066 | /*Запись лога регулировки частоты*/ |
Kovalev_D | 147:1aed74f19a8f | 1067 | if (Time[0] == 'y') Gyro.LogHZ=1; //включит передачу |
Kovalev_D | 147:1aed74f19a8f | 1068 | if (Time[0] == 'u') Gyro.StrayHZ_flag = 1; //LPC_TIM1->MR0+1000 вносим помеху |
Kovalev_D | 147:1aed74f19a8f | 1069 | if (Time[0] == 'i') Gyro.StrayHZ_flag = 0; //LPC_TIM1->MR0 убираем помеху |
Kovalev_D | 147:1aed74f19a8f | 1070 | if (Time[0] == 'o') Gyro.LogHZ=0; //Отключить передачу |
Kovalev_D | 147:1aed74f19a8f | 1071 | //////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 150:29c9f7671bac | 1072 | /*Запись лога регулировки периметра*/ |
Kovalev_D | 151:d565ce4d58c8 | 1073 | if (Time[0] == 'g') {Gyro.LogPLC=1; Gyro.PLC_Lern=0;} //включит передачу |
Kovalev_D | 150:29c9f7671bac | 1074 | if (Time[0] == 'h') Gyro.StrayPLC_flag = 1; //LPC_TIM1->MR0+1000 вносим помеху + |
Kovalev_D | 150:29c9f7671bac | 1075 | if (Time[0] == 'j') Gyro.StrayPLC_flag = 0; //LPC_TIM1->MR0 убираем помеху |
Kovalev_D | 150:29c9f7671bac | 1076 | if (Time[0] == 'b') Gyro.StrayPLC_flag = 3; //LPC_TIM1->MR0-1000 вносим помеху - |
Kovalev_D | 150:29c9f7671bac | 1077 | if (Time[0] == 'n') Gyro.StrayPLC_flag = 2; //LPC_TIM1->MR0+2500 большая помеха. |
Kovalev_D | 168:f4a6abb18358 | 1078 | if (Time[0] == 'k') Gyro.LogPLC = 0; //Отключить передачу |
Kovalev_D | 168:f4a6abb18358 | 1079 | if (Time[0] == 'd') Gyro.ModJump = 1; //прыжок на воду + |
Kovalev_D | 168:f4a6abb18358 | 1080 | if (Time[0] == 'f') Gyro.ModJump = 2; //прыжок на воду - |
Kovalev_D | 175:daffcc97d532 | 1081 | //if (Time[0] == 'z') {Gyro.ModJump = 3; Spi.DAC_B = 0x3a98; } //прообежать по всем модам. |
Kovalev_D | 189:8a16378724c4 | 1082 | ////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1083 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1084 | ////////////////////////////////////////////////////выдача частоты в терминал длля записи лога/////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1085 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1086 | //////G=1,K=0 в терменале |
Kovalev_D | 189:8a16378724c4 | 1087 | |
Kovalev_D | 189:8a16378724c4 | 1088 | if((Gyro.LogHZ == 1)&&(Gyro.Event_500Hz==1)) //Запись для Ориджина. |
Kovalev_D | 189:8a16378724c4 | 1089 | { |
Kovalev_D | 189:8a16378724c4 | 1090 | Gyro.Event_500Hz=0; |
Kovalev_D | 189:8a16378724c4 | 1091 | sprintf((Time),"%d \r\n",LPC_TIM1->MR0); |
Kovalev_D | 189:8a16378724c4 | 1092 | WriteCon(Time); |
Kovalev_D | 189:8a16378724c4 | 1093 | } |
Kovalev_D | 189:8a16378724c4 | 1094 | |
Kovalev_D | 189:8a16378724c4 | 1095 | |
Kovalev_D | 147:1aed74f19a8f | 1096 | if (Time[0] == '8') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1097 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1098 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1099 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 147:1aed74f19a8f | 1100 | { |
Kovalev_D | 147:1aed74f19a8f | 1101 | ttemp=(Buff_AMP64P[i]-(Buff_AMP[i])); |
Kovalev_D | 147:1aed74f19a8f | 1102 | if (ttemp < 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 147:1aed74f19a8f | 1103 | } |
Kovalev_D | 147:1aed74f19a8f | 1104 | } |
Kovalev_D | 168:f4a6abb18358 | 1105 | if (Time[0] == 'q') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1106 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1107 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1108 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 147:1aed74f19a8f | 1109 | { |
Kovalev_D | 147:1aed74f19a8f | 1110 | ttemp=(Buff_Restored_sin[i]); |
Kovalev_D | 147:1aed74f19a8f | 1111 | if (ttemp < 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 147:1aed74f19a8f | 1112 | } |
Kovalev_D | 147:1aed74f19a8f | 1113 | } |
Kovalev_D | 147:1aed74f19a8f | 1114 | if (Gyro.PLC_Error2Mode) { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1115 | sprintf(Time,"\r\nPLC_Error2Mode"); |
Kovalev_D | 147:1aed74f19a8f | 1116 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1117 | } |
Kovalev_D | 147:1aed74f19a8f | 1118 | } |
igor_v | 0:8ad47e2b6f00 | 1119 | } |
igor_v | 0:8ad47e2b6f00 | 1120 | |
igor_v | 0:8ad47e2b6f00 | 1121 |