![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Command.c@190:289514f730ee, 2016-08-23 (annotated)
- Committer:
- Kovalev_D
- Date:
- Tue Aug 23 14:03:16 2016 +0000
- Revision:
- 190:289514f730ee
- Parent:
- 189:8a16378724c4
- Child:
- 191:40028201ddad
PLC
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 | 183: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 | 182: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 | 177: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 | 182: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 | 124:9ae09249f842 | 307 | break; |
Kovalev_D | 124:9ae09249f842 | 308 | |
Kovalev_D | 124:9ae09249f842 | 309 | case 1: |
Kovalev_D | 124:9ae09249f842 | 310 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 311 | break; |
Kovalev_D | 124:9ae09249f842 | 312 | |
Kovalev_D | 124:9ae09249f842 | 313 | |
Kovalev_D | 124:9ae09249f842 | 314 | |
Kovalev_D | 124:9ae09249f842 | 315 | //HFO |
Kovalev_D | 124:9ae09249f842 | 316 | case 2: |
Kovalev_D | 124:9ae09249f842 | 317 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 318 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 319 | break; |
Kovalev_D | 124:9ae09249f842 | 320 | |
Kovalev_D | 124:9ae09249f842 | 321 | case 3: |
Kovalev_D | 124:9ae09249f842 | 322 | Temp = 0;//HFO |
Kovalev_D | 124:9ae09249f842 | 323 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 324 | break; |
Kovalev_D | 124:9ae09249f842 | 325 | |
Kovalev_D | 124:9ae09249f842 | 326 | |
Kovalev_D | 124:9ae09249f842 | 327 | |
Kovalev_D | 124:9ae09249f842 | 328 | //T_Vibro |
Kovalev_D | 124:9ae09249f842 | 329 | case 4: |
Kovalev_D | 124:9ae09249f842 | 330 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 331 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 332 | break; |
Kovalev_D | 124:9ae09249f842 | 333 | |
Kovalev_D | 124:9ae09249f842 | 334 | case 5: |
Kovalev_D | 124:9ae09249f842 | 335 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 336 | break; |
Kovalev_D | 124:9ae09249f842 | 337 | |
Kovalev_D | 124:9ae09249f842 | 338 | |
Kovalev_D | 124:9ae09249f842 | 339 | |
Kovalev_D | 124:9ae09249f842 | 340 | //L_Vibro |
Kovalev_D | 124:9ae09249f842 | 341 | case 6: |
Kovalev_D | 124:9ae09249f842 | 342 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 124:9ae09249f842 | 343 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 344 | break; |
Kovalev_D | 124:9ae09249f842 | 345 | |
Kovalev_D | 124:9ae09249f842 | 346 | case 7: |
Kovalev_D | 124:9ae09249f842 | 347 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 348 | break; |
Kovalev_D | 124:9ae09249f842 | 349 | |
Kovalev_D | 124:9ae09249f842 | 350 | |
Kovalev_D | 124:9ae09249f842 | 351 | |
Kovalev_D | 124:9ae09249f842 | 352 | //Напряжение на регуляторе периметра |
Kovalev_D | 124:9ae09249f842 | 353 | case 8: |
Kovalev_D | 165:b2bd0c810a4f | 354 | Temp = Spi.DAC_B /*- 0x7fff*/; |
Kovalev_D | 124:9ae09249f842 | 355 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 356 | break; |
Kovalev_D | 124:9ae09249f842 | 357 | |
Kovalev_D | 124:9ae09249f842 | 358 | case 9: |
Kovalev_D | 124:9ae09249f842 | 359 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 360 | break; |
Kovalev_D | 124:9ae09249f842 | 361 | |
Kovalev_D | 124:9ae09249f842 | 362 | |
Kovalev_D | 124:9ae09249f842 | 363 | |
Kovalev_D | 124:9ae09249f842 | 364 | //темпкратурный канал 0 |
Kovalev_D | 124:9ae09249f842 | 365 | case 10: |
Kovalev_D | 124:9ae09249f842 | 366 | Temp = 100; |
Kovalev_D | 124:9ae09249f842 | 367 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 368 | break; |
Kovalev_D | 124:9ae09249f842 | 369 | |
Kovalev_D | 124:9ae09249f842 | 370 | case 11: |
Kovalev_D | 124:9ae09249f842 | 371 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 372 | break; |
Kovalev_D | 124:9ae09249f842 | 373 | |
Kovalev_D | 124:9ae09249f842 | 374 | |
Kovalev_D | 124:9ae09249f842 | 375 | |
Kovalev_D | 124:9ae09249f842 | 376 | //темпкратурный канал 1 |
Kovalev_D | 124:9ae09249f842 | 377 | case 12: |
Kovalev_D | 124:9ae09249f842 | 378 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 124:9ae09249f842 | 379 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 380 | break; |
Kovalev_D | 124:9ae09249f842 | 381 | |
Kovalev_D | 124:9ae09249f842 | 382 | case 13: |
Kovalev_D | 124:9ae09249f842 | 383 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 384 | break; |
Kovalev_D | 124:9ae09249f842 | 385 | |
Kovalev_D | 124:9ae09249f842 | 386 | |
Kovalev_D | 124:9ae09249f842 | 387 | |
Kovalev_D | 124:9ae09249f842 | 388 | //ток 1 |
Kovalev_D | 124:9ae09249f842 | 389 | case 14: |
Kovalev_D | 124:9ae09249f842 | 390 | Temp = Gyro.In1; |
Kovalev_D | 124:9ae09249f842 | 391 | BuffTemp[5] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 124:9ae09249f842 | 392 | break; |
Kovalev_D | 124:9ae09249f842 | 393 | |
Kovalev_D | 124:9ae09249f842 | 394 | case 15: |
Kovalev_D | 124:9ae09249f842 | 395 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 396 | break; |
Kovalev_D | 124:9ae09249f842 | 397 | |
Kovalev_D | 124:9ae09249f842 | 398 | |
Kovalev_D | 124:9ae09249f842 | 399 | |
Kovalev_D | 124:9ae09249f842 | 400 | //ток 2 |
Kovalev_D | 124:9ae09249f842 | 401 | case 16: |
Kovalev_D | 124:9ae09249f842 | 402 | Temp = Gyro.In2; |
Kovalev_D | 124:9ae09249f842 | 403 | BuffTemp[5] = (Temp >> 8) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 404 | break; |
Kovalev_D | 124:9ae09249f842 | 405 | |
Kovalev_D | 124:9ae09249f842 | 406 | case 17: |
Kovalev_D | 124:9ae09249f842 | 407 | BuffTemp[5] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 124:9ae09249f842 | 408 | break; |
Kovalev_D | 124:9ae09249f842 | 409 | |
Kovalev_D | 124:9ae09249f842 | 410 | |
Kovalev_D | 124:9ae09249f842 | 411 | |
Kovalev_D | 124:9ae09249f842 | 412 | //разностный температурный канал Delta Temp |
Kovalev_D | 124:9ae09249f842 | 413 | case 18: |
Kovalev_D | 124:9ae09249f842 | 414 | Temp = Gyro.DeltaT; |
Kovalev_D | 124:9ae09249f842 | 415 | BuffTemp[5] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 124:9ae09249f842 | 416 | break; |
Kovalev_D | 124:9ae09249f842 | 417 | |
Kovalev_D | 124:9ae09249f842 | 418 | case 19: |
Kovalev_D | 124:9ae09249f842 | 419 | BuffTemp[5] = (Temp >> 0) & 0xff; |
Kovalev_D | 124:9ae09249f842 | 420 | break; |
Kovalev_D | 124:9ae09249f842 | 421 | |
Kovalev_D | 124:9ae09249f842 | 422 | |
Kovalev_D | 124:9ae09249f842 | 423 | |
Kovalev_D | 124:9ae09249f842 | 424 | //температурный канал 5 |
Kovalev_D | 124:9ae09249f842 | 425 | case 20: |
Kovalev_D | 124:9ae09249f842 | 426 | Temp = Gyro.Termo;//0xa4=164 |
Kovalev_D | 124:9ae09249f842 | 427 | BuffTemp[5] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 124:9ae09249f842 | 428 | break; |
Kovalev_D | 124:9ae09249f842 | 429 | |
Kovalev_D | 124:9ae09249f842 | 430 | case 21: |
Kovalev_D | 124:9ae09249f842 | 431 | BuffTemp[5] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
Kovalev_D | 124:9ae09249f842 | 432 | break; |
Kovalev_D | 124:9ae09249f842 | 433 | } |
Kovalev_D | 162:44e4ded32c6a | 434 | Check(BuffTemp, CRC_N); |
Kovalev_D | 162:44e4ded32c6a | 435 | WriteConN (BuffTemp,CRC_N); |
Kovalev_D | 124:9ae09249f842 | 436 | CountParam++; |
Kovalev_D | 124:9ae09249f842 | 437 | if(CountParam>21)CountParam=0;//зацикливания буфера от 0 до 21 |
Kovalev_D | 122:fbacb932a30b | 438 | } |
Kovalev_D | 124:9ae09249f842 | 439 | |
Kovalev_D | 121:bbae560cdd43 | 440 | void CMD_Rate2(void) |
Kovalev_D | 121:bbae560cdd43 | 441 | { |
Kovalev_D | 124:9ae09249f842 | 442 | Gyro.Rate2_Event=0; |
Kovalev_D | 121:bbae560cdd43 | 443 | BuffTemp[ 0] = Gyro.SOC_Out; |
Kovalev_D | 121:bbae560cdd43 | 444 | BuffTemp[ 1] = Gyro.My_Addres; |
Kovalev_D | 121:bbae560cdd43 | 445 | |
Kovalev_D | 121:bbae560cdd43 | 446 | |
Kovalev_D | 121:bbae560cdd43 | 447 | BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. |
Kovalev_D | 121:bbae560cdd43 | 448 | BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. |
Kovalev_D | 121:bbae560cdd43 | 449 | |
Kovalev_D | 121:bbae560cdd43 | 450 | BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. |
Kovalev_D | 121:bbae560cdd43 | 451 | BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. |
Kovalev_D | 124:9ae09249f842 | 452 | |
Kovalev_D | 122:fbacb932a30b | 453 | Check(BuffTemp, 8); |
Kovalev_D | 122:fbacb932a30b | 454 | WriteConN (BuffTemp,8); |
Kovalev_D | 121:bbae560cdd43 | 455 | } |
Kovalev_D | 124:9ae09249f842 | 456 | |
igor_v | 0:8ad47e2b6f00 | 457 | void CMD_Rate(void) |
Kovalev_D | 190:289514f730ee | 458 | { |
Kovalev_D | 124:9ae09249f842 | 459 | Gyro.Rate1_Event=0; |
Kovalev_D | 108:030cdde08314 | 460 | unsigned int Temp; |
Kovalev_D | 107:4d178bcc9d8a | 461 | |
igor_v | 30:17c84ed091b3 | 462 | Gyro.Firmware_Version=0xff; /// промежуточная затычка |
Kovalev_D | 122:fbacb932a30b | 463 | |
igor_v | 0:8ad47e2b6f00 | 464 | |
igor_v | 30:17c84ed091b3 | 465 | BuffTemp[ 0] = Gyro.SOC_Out; |
igor_v | 30:17c84ed091b3 | 466 | BuffTemp[ 1] = Gyro.My_Addres; |
igor_v | 21:bc8c1cec3da6 | 467 | |
Kovalev_D | 108:030cdde08314 | 468 | |
Kovalev_D | 112:4a96133a1311 | 469 | BuffTemp[ 2] =(Gyro.CaunPlus >> 8) & 0xff;//старший байт счетчика +. |
Kovalev_D | 112:4a96133a1311 | 470 | BuffTemp[ 3] =(Gyro.CaunPlus >> 0) & 0xff;//младший байт счетчика +. |
Kovalev_D | 108:030cdde08314 | 471 | |
Kovalev_D | 112:4a96133a1311 | 472 | BuffTemp[ 4] =(Gyro.CaunMin >> 8) & 0xff;//старший байт счетчика -. |
Kovalev_D | 112:4a96133a1311 | 473 | BuffTemp[ 5] =(Gyro.CaunMin >> 0) & 0xff;//младший байт счетчика -. |
Kovalev_D | 108:030cdde08314 | 474 | |
Kovalev_D | 113:8be429494918 | 475 | |
Kovalev_D | 108:030cdde08314 | 476 | Temp = Gyro.CuruAngle; |
Kovalev_D | 108:030cdde08314 | 477 | Gyro.CuruAngle = 0; |
Kovalev_D | 162:44e4ded32c6a | 478 | //Temp = Gyro.AD_Fast >> 16; |
Kovalev_D | 108:030cdde08314 | 479 | BuffTemp[ 6] =(Temp >> 8) & 0xff;//старший байт разности счетчиков |
Kovalev_D | 108:030cdde08314 | 480 | BuffTemp[ 7] =(Temp >> 0) & 0xff;//младший байт разности счетчиков |
Kovalev_D | 108:030cdde08314 | 481 | |
Kovalev_D | 108:030cdde08314 | 482 | |
Kovalev_D | 122:fbacb932a30b | 483 | Temp = Gyro.F_ras; |
Kovalev_D | 122:fbacb932a30b | 484 | BuffTemp[ 8] = (Temp >> 8) & 0xff;//расщипление частота |
Kovalev_D | 122:fbacb932a30b | 485 | BuffTemp[ 9] = (Temp >> 0) & 0xff;// |
igor_v | 21:bc8c1cec3da6 | 486 | |
Kovalev_D | 108:030cdde08314 | 487 | BuffTemp[10] = (Temp >> 8) & 0xff;//выход регулятора гвч; |
Kovalev_D | 122:fbacb932a30b | 488 | BuffTemp[11] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 489 | |
Kovalev_D | 145:f023b2f18b82 | 490 | Temp = (Gyro.AD_Slow >> 16)- 0x7fff; |
Kovalev_D | 108:030cdde08314 | 491 | BuffTemp[12]=(Temp >> 8) & 0xff;//// |
Kovalev_D | 108:030cdde08314 | 492 | BuffTemp[13]=(Temp >> 0) & 0xff;//// |
igor_v | 21:bc8c1cec3da6 | 493 | |
Kovalev_D | 108:030cdde08314 | 494 | |
Kovalev_D | 108:030cdde08314 | 495 | Temp = (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 108:030cdde08314 | 496 | BuffTemp[14] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 497 | BuffTemp[15] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 498 | |
Kovalev_D | 107:4d178bcc9d8a | 499 | BuffTemp[16] = 0xf; |
Kovalev_D | 106:250ddd8629c6 | 500 | BuffTemp[17] = 0x02; |
Kovalev_D | 108:030cdde08314 | 501 | |
igor_v | 21:bc8c1cec3da6 | 502 | |
Kovalev_D | 108:030cdde08314 | 503 | Temp = (unsigned int)(((7680000*16/200) *Gyro.AmpPer /(Gyro.Frq>>12))); |
Kovalev_D | 108:030cdde08314 | 504 | BuffTemp[18] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 505 | BuffTemp[19] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 506 | |
Kovalev_D | 106:250ddd8629c6 | 507 | BuffTemp[20] = 0x00; |
Kovalev_D | 106:250ddd8629c6 | 508 | BuffTemp[21] = 0x00; |
Kovalev_D | 120:9f446f1495e8 | 509 | |
Kovalev_D | 119:4d7fcece9e8e | 510 | |
Kovalev_D | 125:9400e64d0636 | 511 | |
Kovalev_D | 177:1666a83d88a5 | 512 | Temp = Spi.DAC_B - 0x7fff; |
Kovalev_D | 108:030cdde08314 | 513 | BuffTemp[22] = (Temp >> 8) & 0xff; |
Kovalev_D | 108:030cdde08314 | 514 | BuffTemp[23] = (Temp >> 0) & 0xff; |
igor_v | 21:bc8c1cec3da6 | 515 | |
Kovalev_D | 121:bbae560cdd43 | 516 | |
Kovalev_D | 177:1666a83d88a5 | 517 | Temp = Gyro.PLC_Delta >> 16; |
Kovalev_D | 121:bbae560cdd43 | 518 | BuffTemp[24] = (Temp >> 8) & 0xff; |
Kovalev_D | 177:1666a83d88a5 | 519 | BuffTemp[25] = (Temp >> 0) & 0xff;// |
Kovalev_D | 113:8be429494918 | 520 | |
Kovalev_D | 177:1666a83d88a5 | 521 | |
Kovalev_D | 177:1666a83d88a5 | 522 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 113:8be429494918 | 523 | BuffTemp[26] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 524 | BuffTemp[27] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 525 | |
Kovalev_D | 113:8be429494918 | 526 | Temp = Gyro.AD_Slow >> 16; |
Kovalev_D | 113:8be429494918 | 527 | BuffTemp[28] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 528 | BuffTemp[29] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 529 | |
Kovalev_D | 113:8be429494918 | 530 | Temp = Gyro.In1; |
Kovalev_D | 113:8be429494918 | 531 | BuffTemp[30] = (Temp >> 8) & 0xff;//in1//2 |
Kovalev_D | 113:8be429494918 | 532 | BuffTemp[31] = (Temp >> 0) & 0xff; |
Kovalev_D | 113:8be429494918 | 533 | |
Kovalev_D | 113:8be429494918 | 534 | Temp = Gyro.In2; |
Kovalev_D | 113:8be429494918 | 535 | BuffTemp[32] = (Temp >> 8) & 0xff; |
Kovalev_D | 113:8be429494918 | 536 | BuffTemp[33] = (Temp >> 0) & 0xff;//in2//3 |
Kovalev_D | 113:8be429494918 | 537 | |
Kovalev_D | 113:8be429494918 | 538 | Temp = Gyro.DeltaT; |
Kovalev_D | 113:8be429494918 | 539 | BuffTemp[34] = (Temp >> 8) & 0xff;//дельта |
Kovalev_D | 113:8be429494918 | 540 | BuffTemp[35] = (Temp >> 0) & 0xff; |
Kovalev_D | 115:e5a230e5af52 | 541 | |
Kovalev_D | 172:ef7bf1663645 | 542 | Temp = Gyro.Termo; |
Kovalev_D | 182:ebcd2bc3be8f | 543 | // Temp = (0x7fff + Temp)/164; |
Kovalev_D | 182:ebcd2bc3be8f | 544 | Temp = 0x7fff+Temp; |
Kovalev_D | 113:8be429494918 | 545 | BuffTemp[36] =(Temp >> 8) & 0xff;//температура |
Kovalev_D | 115:e5a230e5af52 | 546 | BuffTemp[37] =(Temp >> 0) & 0xff;//ADC6 sesnsor 5 |
igor_v | 21:bc8c1cec3da6 | 547 | |
Kovalev_D | 106:250ddd8629c6 | 548 | BuffTemp[38] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 549 | BuffTemp[39] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 550 | BuffTemp[40] =0x00; |
Kovalev_D | 106:250ddd8629c6 | 551 | BuffTemp[41] =0x00; |
igor_v | 21:bc8c1cec3da6 | 552 | |
igor_v | 21:bc8c1cec3da6 | 553 | |
igor_v | 21:bc8c1cec3da6 | 554 | Check(BuffTemp, 44); |
igor_v | 21:bc8c1cec3da6 | 555 | WriteConN (BuffTemp,44); |
Kovalev_D | 92:c892f0311aa7 | 556 | |
igor_v | 0:8ad47e2b6f00 | 557 | } |
Kovalev_D | 179:2b4e6bc277df | 558 | void CMD_M_vib() |
Kovalev_D | 179:2b4e6bc277df | 559 | { |
Kovalev_D | 179:2b4e6bc277df | 560 | unsigned int temp1,temp2; |
igor_v | 0:8ad47e2b6f00 | 561 | |
Kovalev_D | 179:2b4e6bc277df | 562 | temp1 =((BuffTemp[4]<<8) | BuffTemp[5]); |
Kovalev_D | 179:2b4e6bc277df | 563 | temp1=temp1&0xFFFF; |
Kovalev_D | 180:375dcd9c0cb6 | 564 | (unsigned int)((7680000*16/(Gyro.Frq>>12))); |
Kovalev_D | 180:375dcd9c0cb6 | 565 | Gyro.Frq=(122880000/temp1)<<12; |
Kovalev_D | 179:2b4e6bc277df | 566 | |
Kovalev_D | 179:2b4e6bc277df | 567 | temp2 =((BuffTemp[6]<<8) | BuffTemp[7]); |
Kovalev_D | 179:2b4e6bc277df | 568 | temp2=temp2&0xFFFF; |
Kovalev_D | 179:2b4e6bc277df | 569 | |
Kovalev_D | 179:2b4e6bc277df | 570 | Gyro.AmpPer=(((((Gyro.Frq>>12)*200)/16)*temp2)/7680000); |
Kovalev_D | 179:2b4e6bc277df | 571 | |
Kovalev_D | 179:2b4e6bc277df | 572 | // Gyro.AmpPer = ((unsigned int) ((7680000*16/temp1)))*16*16*16; |
Kovalev_D | 179:2b4e6bc277df | 573 | Consol=Gyro.Frq ; |
Kovalev_D | 179:2b4e6bc277df | 574 | } |
igor_v | 21:bc8c1cec3da6 | 575 | void CMD_M_Control_D8()///установка\сброс регистров управления |
igor_v | 21:bc8c1cec3da6 | 576 | { |
Kovalev_D | 104:ab1cb4ff56b2 | 577 | unsigned int bit,NReg,Pa; |
Kovalev_D | 104:ab1cb4ff56b2 | 578 | unsigned int SR,V,A,Bit_num; |
Kovalev_D | 104:ab1cb4ff56b2 | 579 | SR=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 580 | V=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 581 | A=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 582 | Bit_num=0; |
Kovalev_D | 104:ab1cb4ff56b2 | 583 | |
igor_v | 30:17c84ed091b3 | 584 | BuffTemp[0] = Gyro.SOC_Out; //DD |
igor_v | 30:17c84ed091b3 | 585 | BuffTemp[1] = Gyro.My_Addres; //00 |
igor_v | 30:17c84ed091b3 | 586 | BuffTemp[2] = Gyro.CMD_In; //D8 |
Kovalev_D | 104:ab1cb4ff56b2 | 587 | |
Kovalev_D | 104:ab1cb4ff56b2 | 588 | /* |
Kovalev_D | 104:ab1cb4ff56b2 | 589 | |
Kovalev_D | 104:ab1cb4ff56b2 | 590 | FrqON |
Kovalev_D | 104:ab1cb4ff56b2 | 591 | PlcON |
Kovalev_D | 104:ab1cb4ff56b2 | 592 | HFOOFF |
Kovalev_D | 104:ab1cb4ff56b2 | 593 | HFOON |
igor_v | 21:bc8c1cec3da6 | 594 | |
Kovalev_D | 104:ab1cb4ff56b2 | 595 | PlcOFF |
Kovalev_D | 104:ab1cb4ff56b2 | 596 | PlcON |
Kovalev_D | 104:ab1cb4ff56b2 | 597 | */ |
Kovalev_D | 104:ab1cb4ff56b2 | 598 | Pa = BuffTemp[3]; |
Kovalev_D | 104:ab1cb4ff56b2 | 599 | |
Kovalev_D | 104:ab1cb4ff56b2 | 600 | SR = Pa >> 0x7; |
Kovalev_D | 104:ab1cb4ff56b2 | 601 | |
Kovalev_D | 104:ab1cb4ff56b2 | 602 | V = Pa >> 0x5; |
Kovalev_D | 104:ab1cb4ff56b2 | 603 | V = V & 0x3; |
Kovalev_D | 104:ab1cb4ff56b2 | 604 | |
Kovalev_D | 104:ab1cb4ff56b2 | 605 | A = Pa >> 0x4; |
Kovalev_D | 104:ab1cb4ff56b2 | 606 | A = A & 0x1; |
Kovalev_D | 104:ab1cb4ff56b2 | 607 | |
Kovalev_D | 104:ab1cb4ff56b2 | 608 | Bit_num = Pa & 0xf; |
Kovalev_D | 104:ab1cb4ff56b2 | 609 | |
Kovalev_D | 104:ab1cb4ff56b2 | 610 | if(SR) { |
Kovalev_D | 104:ab1cb4ff56b2 | 611 | switch (Bit_num){ |
Kovalev_D | 105:bd01d8d20fb6 | 612 | |
Kovalev_D | 104:ab1cb4ff56b2 | 613 | case 0x06: |
Kovalev_D | 104:ab1cb4ff56b2 | 614 | FrqON |
Kovalev_D | 105:bd01d8d20fb6 | 615 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 616 | |
Kovalev_D | 171:d227a6045305 | 617 | case 0x05: |
Kovalev_D | 171:d227a6045305 | 618 | AVibON |
Kovalev_D | 171:d227a6045305 | 619 | break; |
Kovalev_D | 171:d227a6045305 | 620 | |
Kovalev_D | 171:d227a6045305 | 621 | case 0x01: |
Kovalev_D | 105:bd01d8d20fb6 | 622 | HFOON |
Kovalev_D | 105:bd01d8d20fb6 | 623 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 624 | |
Kovalev_D | 171:d227a6045305 | 625 | case 0x03: |
Kovalev_D | 105:bd01d8d20fb6 | 626 | PlcON |
Kovalev_D | 105:bd01d8d20fb6 | 627 | break; |
Kovalev_D | 104:ab1cb4ff56b2 | 628 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 629 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 630 | else{ |
Kovalev_D | 104:ab1cb4ff56b2 | 631 | switch (Bit_num){ |
Kovalev_D | 105:bd01d8d20fb6 | 632 | |
Kovalev_D | 105:bd01d8d20fb6 | 633 | case 0x06: |
Kovalev_D | 171:d227a6045305 | 634 | FrqOFF |
Kovalev_D | 171:d227a6045305 | 635 | break; |
Kovalev_D | 171:d227a6045305 | 636 | |
Kovalev_D | 171:d227a6045305 | 637 | case 0x05: |
Kovalev_D | 171:d227a6045305 | 638 | AVibOFF |
Kovalev_D | 171:d227a6045305 | 639 | break; |
Kovalev_D | 171:d227a6045305 | 640 | |
Kovalev_D | 171:d227a6045305 | 641 | case 0x01: |
Kovalev_D | 171:d227a6045305 | 642 | HFOOFF |
Kovalev_D | 105:bd01d8d20fb6 | 643 | break; |
Kovalev_D | 105:bd01d8d20fb6 | 644 | |
Kovalev_D | 105:bd01d8d20fb6 | 645 | case 0x03: |
Kovalev_D | 105:bd01d8d20fb6 | 646 | PlcOFF |
Kovalev_D | 105:bd01d8d20fb6 | 647 | break; |
Kovalev_D | 104:ab1cb4ff56b2 | 648 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 649 | } |
Kovalev_D | 129:406995a91322 | 650 | BuffTemp[0] = Gyro.SOC_Out; //DD |
Kovalev_D | 129:406995a91322 | 651 | BuffTemp[1] = Gyro.My_Addres; //00 |
Kovalev_D | 129:406995a91322 | 652 | BuffTemp[2] = Gyro.CMD_In; //D8 |
Kovalev_D | 129:406995a91322 | 653 | BuffTemp[3] = A<<4; |
Kovalev_D | 129:406995a91322 | 654 | BuffTemp[4] = 0x0; |
Kovalev_D | 129:406995a91322 | 655 | BuffTemp[5] = 0x0; |
Kovalev_D | 129:406995a91322 | 656 | Check(BuffTemp, CRC_N); |
Kovalev_D | 129:406995a91322 | 657 | WriteConN (BuffTemp,CRC_N); |
igor_v | 0:8ad47e2b6f00 | 658 | } |
igor_v | 0:8ad47e2b6f00 | 659 | |
igor_v | 21:bc8c1cec3da6 | 660 | void CMD_M_Control_D9()///чтение регистров управления |
igor_v | 21:bc8c1cec3da6 | 661 | { |
igor_v | 21:bc8c1cec3da6 | 662 | int bit,NReg; |
igor_v | 30:17c84ed091b3 | 663 | BuffTemp[0] = Gyro.SOC_Out; //DD |
igor_v | 30:17c84ed091b3 | 664 | BuffTemp[1] = Gyro.My_Addres; //00 |
igor_v | 30:17c84ed091b3 | 665 | BuffTemp[2] = Gyro.CMD_In; //D9 |
igor_v | 21:bc8c1cec3da6 | 666 | if ((Param1 & 0x10) == 0) { |
igor_v | 21:bc8c1cec3da6 | 667 | BuffTemp[3]=0<<4; |
igor_v | 30:17c84ed091b3 | 668 | BuffTemp[4] = (Gyro.RgConA>>8 )& 0xff; |
igor_v | 30:17c84ed091b3 | 669 | BuffTemp[5] = Gyro.RgConA & 0xff; |
igor_v | 21:bc8c1cec3da6 | 670 | } else { |
igor_v | 21:bc8c1cec3da6 | 671 | BuffTemp[3]=1<<4; |
igor_v | 30:17c84ed091b3 | 672 | BuffTemp[4] = (Gyro.RgConB>>8 ) & 0xff; |
igor_v | 30:17c84ed091b3 | 673 | BuffTemp[5] = Gyro.RgConB & 0xff; |
igor_v | 21:bc8c1cec3da6 | 674 | } |
igor_v | 21:bc8c1cec3da6 | 675 | Check(BuffTemp, CRC_N); |
igor_v | 21:bc8c1cec3da6 | 676 | WriteConN (BuffTemp,CRC_N); |
igor_v | 21:bc8c1cec3da6 | 677 | } |
igor_v | 21:bc8c1cec3da6 | 678 | // (номер (код) ЦАПа 0...3, старший байт требуемого ЦАПа, младший байт треб ЦАПа) |
igor_v | 0:8ad47e2b6f00 | 679 | void CMD_M_Stymul() |
igor_v | 0:8ad47e2b6f00 | 680 | { |
igor_v | 21:bc8c1cec3da6 | 681 | int temp; |
Kovalev_D | 102:4270092be987 | 682 | int HFO; |
Kovalev_D | 102:4270092be987 | 683 | temp=BuffTemp[3]; |
Kovalev_D | 102:4270092be987 | 684 | Consol = temp&0x3; |
Kovalev_D | 103:e96f08947def | 685 | HFO = temp&0x3;// // (номер (код) ЦАПа 0...3, HFO - 3dac, PLC - 0DAC |
igor_v | 21:bc8c1cec3da6 | 686 | temp =((BuffTemp[4]<<8) | BuffTemp[5]); |
igor_v | 21:bc8c1cec3da6 | 687 | // temp=0; |
igor_v | 21:bc8c1cec3da6 | 688 | temp=temp&0xFFFF; |
Kovalev_D | 102:4270092be987 | 689 | |
Kovalev_D | 102:4270092be987 | 690 | if(HFO) |
Kovalev_D | 102:4270092be987 | 691 | { |
Kovalev_D | 102:4270092be987 | 692 | Spi.DAC_A=(unsigned int)temp; |
Kovalev_D | 102:4270092be987 | 693 | } |
Kovalev_D | 102:4270092be987 | 694 | else{ |
igor_v | 21:bc8c1cec3da6 | 695 | DACF =(temp*K_DAC)+deltaDAC; |
igor_v | 21:bc8c1cec3da6 | 696 | Spi.DAC_B =(unsigned int)(DACF) /*(unsigned int)(temp*K_DAC+deltaDAC)*/; // K_DAC); |
igor_v | 21:bc8c1cec3da6 | 697 | } |
igor_v | 0:8ad47e2b6f00 | 698 | } |
Kovalev_D | 103:e96f08947def | 699 | void Gph_W() |
Kovalev_D | 103:e96f08947def | 700 | { |
Kovalev_D | 172:ef7bf1663645 | 701 | Gyro.flagGph_W=3; |
Kovalev_D | 172:ef7bf1663645 | 702 | Out_G_photo(BuffTemp[4],BuffTemp[5]); |
Kovalev_D | 172:ef7bf1663645 | 703 | |
Kovalev_D | 103:e96f08947def | 704 | } |
igor_v | 0:8ad47e2b6f00 | 705 | |
Kovalev_D | 102:4270092be987 | 706 | |
igor_v | 0:8ad47e2b6f00 | 707 | unsigned int Check(char *c, unsigned int Count) |
igor_v | 0:8ad47e2b6f00 | 708 | { |
igor_v | 21:bc8c1cec3da6 | 709 | int i=1; |
igor_v | 21:bc8c1cec3da6 | 710 | unsigned int temp,CRC; |
igor_v | 21:bc8c1cec3da6 | 711 | |
igor_v | 21:bc8c1cec3da6 | 712 | |
igor_v | 21:bc8c1cec3da6 | 713 | temp=1; |
igor_v | 21:bc8c1cec3da6 | 714 | CRC=0; |
igor_v | 21:bc8c1cec3da6 | 715 | |
igor_v | 21:bc8c1cec3da6 | 716 | |
igor_v | 21:bc8c1cec3da6 | 717 | for(; i<Count-2; i++) { |
igor_v | 21:bc8c1cec3da6 | 718 | CRC+=c[i]; |
igor_v | 21:bc8c1cec3da6 | 719 | } |
igor_v | 0:8ad47e2b6f00 | 720 | |
igor_v | 21:bc8c1cec3da6 | 721 | if(c[Count-2]!=((CRC>>8)&0xFF)) { |
igor_v | 21:bc8c1cec3da6 | 722 | temp=0; |
igor_v | 30:17c84ed091b3 | 723 | Gyro.RsErrLine = (Gyro.RsErrLine)&=0x2; |
igor_v | 21:bc8c1cec3da6 | 724 | } |
igor_v | 0:8ad47e2b6f00 | 725 | |
igor_v | 21:bc8c1cec3da6 | 726 | if(c[Count-1]!=((CRC>>0)&0xFF)) { |
igor_v | 21:bc8c1cec3da6 | 727 | temp=0; |
igor_v | 30:17c84ed091b3 | 728 | // Gyro.RsErrLine= (Gyro.RsErrLine)=0x2; |
igor_v | 21:bc8c1cec3da6 | 729 | } |
igor_v | 21:bc8c1cec3da6 | 730 | |
igor_v | 21:bc8c1cec3da6 | 731 | c[Count-2]=(CRC>>8)&0xFF; |
igor_v | 21:bc8c1cec3da6 | 732 | c[Count-1]=(CRC>>0)&0xFF; |
igor_v | 21:bc8c1cec3da6 | 733 | |
igor_v | 21:bc8c1cec3da6 | 734 | |
igor_v | 21:bc8c1cec3da6 | 735 | |
igor_v | 21:bc8c1cec3da6 | 736 | return temp; |
igor_v | 0:8ad47e2b6f00 | 737 | } |
igor_v | 0:8ad47e2b6f00 | 738 | |
igor_v | 0:8ad47e2b6f00 | 739 | int Getlengf(void) |
igor_v | 0:8ad47e2b6f00 | 740 | { |
Kovalev_D | 121:bbae560cdd43 | 741 | unsigned int lengf; |
Kovalev_D | 121:bbae560cdd43 | 742 | lengf = 1; |
igor_v | 30:17c84ed091b3 | 743 | switch(Gyro.CMD_In) { |
igor_v | 30:17c84ed091b3 | 744 | case 0x99://Gyrotainance |
Kovalev_D | 92:c892f0311aa7 | 745 | |
igor_v | 21:bc8c1cec3da6 | 746 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 747 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 748 | break; |
igor_v | 0:8ad47e2b6f00 | 749 | |
igor_v | 21:bc8c1cec3da6 | 750 | case 0x0A: //m_stymul |
igor_v | 21:bc8c1cec3da6 | 751 | lengf=8; |
igor_v | 21:bc8c1cec3da6 | 752 | break; |
igor_v | 21:bc8c1cec3da6 | 753 | |
Kovalev_D | 129:406995a91322 | 754 | case 0xE9://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 755 | |
igor_v | 21:bc8c1cec3da6 | 756 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 757 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 758 | break; |
Kovalev_D | 129:406995a91322 | 759 | case 0xE8://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 760 | |
Kovalev_D | 129:406995a91322 | 761 | lengf=6; |
Kovalev_D | 129:406995a91322 | 762 | CRC_N=8; |
Kovalev_D | 129:406995a91322 | 763 | break; |
Kovalev_D | 129:406995a91322 | 764 | |
Kovalev_D | 129:406995a91322 | 765 | case 0xA5://DeviceMode |
Kovalev_D | 129:406995a91322 | 766 | |
Kovalev_D | 129:406995a91322 | 767 | lengf=6; |
Kovalev_D | 129:406995a91322 | 768 | CRC_N=8; |
Kovalev_D | 129:406995a91322 | 769 | break; |
Kovalev_D | 129:406995a91322 | 770 | |
igor_v | 21:bc8c1cec3da6 | 771 | case 0xDD://m_rate |
igor_v | 21:bc8c1cec3da6 | 772 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 773 | CRC_N=44; |
igor_v | 21:bc8c1cec3da6 | 774 | break; |
Kovalev_D | 162:44e4ded32c6a | 775 | |
Kovalev_D | 162:44e4ded32c6a | 776 | |
Kovalev_D | 124:9ae09249f842 | 777 | case 0xA0://Delta_PS |
Kovalev_D | 124:9ae09249f842 | 778 | lengf=6; |
Kovalev_D | 124:9ae09249f842 | 779 | CRC_N=8; |
Kovalev_D | 124:9ae09249f842 | 780 | break; |
Kovalev_D | 124:9ae09249f842 | 781 | |
Kovalev_D | 124:9ae09249f842 | 782 | |
igor_v | 21:bc8c1cec3da6 | 783 | case 0xB0://DeviceMode |
igor_v | 21:bc8c1cec3da6 | 784 | |
igor_v | 21:bc8c1cec3da6 | 785 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 786 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 787 | break; |
igor_v | 21:bc8c1cec3da6 | 788 | |
igor_v | 21:bc8c1cec3da6 | 789 | case 0xD8://m_control |
igor_v | 0:8ad47e2b6f00 | 790 | |
igor_v | 21:bc8c1cec3da6 | 791 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 792 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 793 | break; |
igor_v | 21:bc8c1cec3da6 | 794 | |
igor_v | 21:bc8c1cec3da6 | 795 | case 0xD9://m_control |
igor_v | 0:8ad47e2b6f00 | 796 | |
igor_v | 21:bc8c1cec3da6 | 797 | lengf=6; |
igor_v | 21:bc8c1cec3da6 | 798 | CRC_N=8; |
igor_v | 21:bc8c1cec3da6 | 799 | break; |
Kovalev_D | 102:4270092be987 | 800 | |
Kovalev_D | 102:4270092be987 | 801 | case 0xE4: |
Kovalev_D | 98:95b8e79f13e1 | 802 | lengf=8; |
Kovalev_D | 98:95b8e79f13e1 | 803 | break; |
Kovalev_D | 103:e96f08947def | 804 | |
Kovalev_D | 103:e96f08947def | 805 | |
Kovalev_D | 103:e96f08947def | 806 | case 0xE6: |
Kovalev_D | 103:e96f08947def | 807 | lengf=8; |
Kovalev_D | 103:e96f08947def | 808 | break; |
Kovalev_D | 103:e96f08947def | 809 | |
igor_v | 21:bc8c1cec3da6 | 810 | } |
Kovalev_D | 98:95b8e79f13e1 | 811 | |
igor_v | 21:bc8c1cec3da6 | 812 | return lengf; |
igor_v | 0:8ad47e2b6f00 | 813 | } |
igor_v | 0:8ad47e2b6f00 | 814 | |
igor_v | 0:8ad47e2b6f00 | 815 | void Read_CMD(void) |
igor_v | 21:bc8c1cec3da6 | 816 | { |
Kovalev_D | 188:4c523cc373cc | 817 | |
Kovalev_D | 147:1aed74f19a8f | 818 | Gyro.RsErrLine = (Gyro.RsErrLine)& 0xffff;//для сброса ошибки |
Kovalev_D | 188:4c523cc373cc | 819 | CountBuFFIn=ReadChekCon1(BuffTemp); |
Kovalev_D | 188:4c523cc373cc | 820 | // чтение данных из консоли |
Kovalev_D | 188:4c523cc373cc | 821 | if(CountBuFFIn==1) { |
Kovalev_D | 190:289514f730ee | 822 | // если есть первый байт |
Kovalev_D | 147:1aed74f19a8f | 823 | if (BuffTemp[0] != SOC_In) { |
Kovalev_D | 147:1aed74f19a8f | 824 | ReadCon1(BuffTemp); |
Kovalev_D | 147:1aed74f19a8f | 825 | Gyro.RsErrLine += 0x100;//WriteCon("\n\r ...Error.... "); |
Kovalev_D | 147:1aed74f19a8f | 826 | BuffTemp[99]=Gyro.RsErrLine; |
Kovalev_D | 147:1aed74f19a8f | 827 | } |
Kovalev_D | 147:1aed74f19a8f | 828 | } |
Kovalev_D | 190:289514f730ee | 829 | else if(CountBuFFIn==2) //если второй байт |
Kovalev_D | 147:1aed74f19a8f | 830 | { |
Kovalev_D | 147:1aed74f19a8f | 831 | if (BuffTemp[1] != Gyro.My_Addres) { |
Kovalev_D | 93:b3803774f110 | 832 | ReadCon1(BuffTemp); |
Diletant | 149:abbf7663d27d | 833 | Gyro.RsErrLine += 0x1;WriteCon("\n\r ...Error_ADDRES.... "); |
Kovalev_D | 188:4c523cc373cc | 834 | } |
Kovalev_D | 147:1aed74f19a8f | 835 | } |
Kovalev_D | 190:289514f730ee | 836 | else if(CountBuFFIn==3) // если третий байт |
Kovalev_D | 147:1aed74f19a8f | 837 | { |
igor_v | 30:17c84ed091b3 | 838 | Gyro.CMD_In=BuffTemp[2]; |
Kovalev_D | 92:c892f0311aa7 | 839 | N=Getlengf(); |
Kovalev_D | 92:c892f0311aa7 | 840 | } |
Kovalev_D | 92:c892f0311aa7 | 841 | else if(CountBuFFIn==4 && (N==6)) |
Kovalev_D | 92:c892f0311aa7 | 842 | { // N - длина посылки аскглд(для записи параметров). определяется по коду команды в Getlengf(); |
igor_v | 21:bc8c1cec3da6 | 843 | Param1=BuffTemp[3]; |
Kovalev_D | 92:c892f0311aa7 | 844 | } |
Kovalev_D | 92:c892f0311aa7 | 845 | else if((CountBuFFIn==5)&&(N==7)) |
Kovalev_D | 92:c892f0311aa7 | 846 | { |
igor_v | 21:bc8c1cec3da6 | 847 | Param1=BuffTemp[3]; |
igor_v | 21:bc8c1cec3da6 | 848 | Param2=BuffTemp[4]; |
igor_v | 0:8ad47e2b6f00 | 849 | |
Kovalev_D | 92:c892f0311aa7 | 850 | } |
Kovalev_D | 92:c892f0311aa7 | 851 | else if((CountBuFFIn==6)&&(N==8)) |
Kovalev_D | 147:1aed74f19a8f | 852 | { |
igor_v | 21:bc8c1cec3da6 | 853 | Param1=BuffTemp[3]; |
igor_v | 21:bc8c1cec3da6 | 854 | Param2=BuffTemp[4]; |
igor_v | 21:bc8c1cec3da6 | 855 | Param3=BuffTemp[5]; |
Kovalev_D | 92:c892f0311aa7 | 856 | } |
Kovalev_D | 102:4270092be987 | 857 | else if((CountBuFFIn==8)&&(N==10)) |
Kovalev_D | 147:1aed74f19a8f | 858 | { |
Kovalev_D | 102:4270092be987 | 859 | Param1=BuffTemp[4]; |
Kovalev_D | 102:4270092be987 | 860 | Param2=BuffTemp[5]; |
Kovalev_D | 102:4270092be987 | 861 | Param3=BuffTemp[6]; |
Kovalev_D | 102:4270092be987 | 862 | Param4=BuffTemp[7]; |
Kovalev_D | 102:4270092be987 | 863 | } |
Kovalev_D | 98:95b8e79f13e1 | 864 | |
Kovalev_D | 92:c892f0311aa7 | 865 | else if(CountBuFFIn > (N-1)) |
Kovalev_D | 92:c892f0311aa7 | 866 | { |
Kovalev_D | 147:1aed74f19a8f | 867 | ReadCon1(BuffTemp); |
Kovalev_D | 147:1aed74f19a8f | 868 | switch(Gyro.CMD_In) { |
Kovalev_D | 147:1aed74f19a8f | 869 | Rate_Flag=0; |
Kovalev_D | 92:c892f0311aa7 | 870 | case 0x99: |
Kovalev_D | 124:9ae09249f842 | 871 | Gyro.ModeOut=0; |
Kovalev_D | 183:7e200f4d9b16 | 872 | CMD_Maintenance(); |
Kovalev_D | 124:9ae09249f842 | 873 | break; |
Kovalev_D | 129:406995a91322 | 874 | |
Kovalev_D | 124:9ae09249f842 | 875 | case 0xA0: |
Kovalev_D | 183:7e200f4d9b16 | 876 | DropDelay();//выставка задержки для мультидропа сбрасывается в команде CMD_Maintenance() на 45 микросекунд; |
Kovalev_D | 124:9ae09249f842 | 877 | TempParam=(BuffTemp[3]) & 0x90; |
Kovalev_D | 165:b2bd0c810a4f | 878 | if (TempParam==Delta_500) {CMD_Delta_500Hz();} |
Kovalev_D | 165:b2bd0c810a4f | 879 | else if (TempParam==Delta_EXT) {CMD_Delta_Ext(); } |
Kovalev_D | 182:ebcd2bc3be8f | 880 | else if (TempParam==PDelta_500) { Gyro.ModeOut=3; Gyro.Delta500_Event=0; /*WriteCon("Delta500");*/ } |
Kovalev_D | 182:ebcd2bc3be8f | 881 | else if (TempParam==PDelta_EXT) { Gyro.ModeOut=4; Gyro.DeltaEXT_Event=0;/* WriteCon("deltaEXT"); */} |
Kovalev_D | 147:1aed74f19a8f | 882 | break; |
Kovalev_D | 129:406995a91322 | 883 | |
igor_v | 21:bc8c1cec3da6 | 884 | case 0xD8: |
igor_v | 21:bc8c1cec3da6 | 885 | CMD_M_Control_D8(); |
Kovalev_D | 147:1aed74f19a8f | 886 | break; |
Kovalev_D | 129:406995a91322 | 887 | |
Kovalev_D | 129:406995a91322 | 888 | case 0xE9://чтение параметров |
Kovalev_D | 129:406995a91322 | 889 | CMD_M_Param_R(); |
Kovalev_D | 147:1aed74f19a8f | 890 | break; |
Kovalev_D | 129:406995a91322 | 891 | |
Kovalev_D | 129:406995a91322 | 892 | case 0xE8://запись параметра |
Kovalev_D | 129:406995a91322 | 893 | CMD_M_Param_W(); |
Kovalev_D | 190:289514f730ee | 894 | break; |
Kovalev_D | 190:289514f730ee | 895 | |
Kovalev_D | 188:4c523cc373cc | 896 | case 0xDA: |
Kovalev_D | 190:289514f730ee | 897 | switch(Gyro.My_Addres) |
Kovalev_D | 190:289514f730ee | 898 | {//смещение поджига и подсветки в зависимости от адреса ГЛД |
Kovalev_D | 190:289514f730ee | 899 | case 0: |
Kovalev_D | 190:289514f730ee | 900 | Gyro.Discharg = StartDischarg << ShiftStart0; |
Kovalev_D | 190:289514f730ee | 901 | Gyro.BackLight = StartBackLight << ShiftStart0; |
Kovalev_D | 190:289514f730ee | 902 | break; |
Kovalev_D | 190:289514f730ee | 903 | case 1: |
Kovalev_D | 190:289514f730ee | 904 | Gyro.Discharg = StartDischarg << ShiftStart1; |
Kovalev_D | 190:289514f730ee | 905 | Gyro.BackLight = StartBackLight << ShiftStart1; |
Kovalev_D | 190:289514f730ee | 906 | break; |
Kovalev_D | 190:289514f730ee | 907 | case 2: |
Kovalev_D | 190:289514f730ee | 908 | Gyro.Discharg = StartDischarg << ShiftStart2; |
Kovalev_D | 190:289514f730ee | 909 | Gyro.BackLight = StartBackLight << ShiftStart2; |
Kovalev_D | 190:289514f730ee | 910 | break; |
Kovalev_D | 190:289514f730ee | 911 | case 3: |
Kovalev_D | 190:289514f730ee | 912 | Gyro.Discharg = StartDischarg << ShiftStart3; |
Kovalev_D | 190:289514f730ee | 913 | Gyro.BackLight = StartBackLight << ShiftStart3; |
Kovalev_D | 190:289514f730ee | 914 | break; |
Kovalev_D | 190:289514f730ee | 915 | } |
Kovalev_D | 190:289514f730ee | 916 | break; |
Kovalev_D | 190:289514f730ee | 917 | |
igor_v | 21:bc8c1cec3da6 | 918 | case 0xD9: |
igor_v | 21:bc8c1cec3da6 | 919 | CMD_M_Control_D9(); |
Kovalev_D | 147:1aed74f19a8f | 920 | break; |
Kovalev_D | 129:406995a91322 | 921 | |
igor_v | 21:bc8c1cec3da6 | 922 | case 0x0A: |
Kovalev_D | 45:cbc955aecebe | 923 | CMD_M_Stymul(); |
Kovalev_D | 147:1aed74f19a8f | 924 | break; |
Kovalev_D | 129:406995a91322 | 925 | |
igor_v | 21:bc8c1cec3da6 | 926 | case 0xDD: |
Kovalev_D | 183:7e200f4d9b16 | 927 | |
Kovalev_D | 147:1aed74f19a8f | 928 | TempParam=(BuffTemp[3]) & 0x9f; |
Kovalev_D | 147:1aed74f19a8f | 929 | if (TempParam == Rate1) { CMD_Rate(); WriteCon("Rate11");} |
Kovalev_D | 165:b2bd0c810a4f | 930 | else if (TempParam == Rate2) { CMD_Rate2(); WriteCon("Rate21");} |
Kovalev_D | 147:1aed74f19a8f | 931 | else if (TempParam == PRate1) { Gyro.ModeOut=1; Gyro.Rate1_Event=0; WriteCon("Rate12");} |
Kovalev_D | 147:1aed74f19a8f | 932 | else if (TempParam == PRate2) { Gyro.ModeOut=2; Gyro.Rate2_Event=0; WriteCon("Rate22");} |
Kovalev_D | 147:1aed74f19a8f | 933 | break; |
Kovalev_D | 129:406995a91322 | 934 | |
Kovalev_D | 147:1aed74f19a8f | 935 | case 0xE4: |
Kovalev_D | 102:4270092be987 | 936 | CMD_M_vib(); |
Kovalev_D | 147:1aed74f19a8f | 937 | break; |
Kovalev_D | 129:406995a91322 | 938 | |
Kovalev_D | 103:e96f08947def | 939 | case 0xE6: |
Kovalev_D | 103:e96f08947def | 940 | Gph_W(); |
Kovalev_D | 147:1aed74f19a8f | 941 | break; |
Kovalev_D | 147:1aed74f19a8f | 942 | Gyro.RsErrLine = 0; |
Kovalev_D | 147:1aed74f19a8f | 943 | } |
Kovalev_D | 102:4270092be987 | 944 | } |
Kovalev_D | 147:1aed74f19a8f | 945 | } |
Kovalev_D | 147:1aed74f19a8f | 946 | void TechLog(void) |
Kovalev_D | 147:1aed74f19a8f | 947 | { |
Kovalev_D | 147:1aed74f19a8f | 948 | if (ReadCon (Time)) { |
Kovalev_D | 147:1aed74f19a8f | 949 | ///////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 950 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 951 | //////////////////////Выбор FlashMod/////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 952 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 121:bbae560cdd43 | 953 | |
Kovalev_D | 147:1aed74f19a8f | 954 | if (Time[0] == 'B') {Gyro.FlashMod=1;} |
Kovalev_D | 147:1aed74f19a8f | 955 | if (Time[0] == 'W') {Gyro.FlashMod=2;} |
Kovalev_D | 147:1aed74f19a8f | 956 | if (Time[0] == 'R') {Gyro.FlashMod=3;} |
Kovalev_D | 147:1aed74f19a8f | 957 | /////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 958 | /////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 959 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 960 | if (Time[0] == 'H') { // если ввели буквц h то выдать подсказку. сделанно через принф ОЧЕНЬ плохо в работе не использовать |
Kovalev_D | 147:1aed74f19a8f | 961 | sprintf(Time,"\r\nCompiled: %s %s.",__DATE__, __TIME__ ); //Подготовка даты и времени компиляции |
Kovalev_D | 147:1aed74f19a8f | 962 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 963 | sprintf(Time,"--%d.%3.d.%2.d.",Time1Hz,Time1K,Time100K); //Временно выдачпа временни из трех чисел |
Kovalev_D | 147:1aed74f19a8f | 964 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 965 | } |
Kovalev_D | 147:1aed74f19a8f | 966 | if (Time[0] == 'D') { |
Kovalev_D | 147:1aed74f19a8f | 967 | Gyro.Discharg = StartDischarg; |
Kovalev_D | 147:1aed74f19a8f | 968 | } |
Kovalev_D | 147:1aed74f19a8f | 969 | if (Time[0] == 'L') { |
Kovalev_D | 147:1aed74f19a8f | 970 | Gyro.BackLight = StartBackLight; |
Kovalev_D | 147:1aed74f19a8f | 971 | } |
Kovalev_D | 147:1aed74f19a8f | 972 | if (Time[0] == 'F') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 973 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 974 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 975 | sprintf((Time)," Gyro.Termo = <%07d> Spi.ADC1 = <%07d> Spi.ADC1_Accum = <%07d>",Spi.ADC4,Spi.ADC4,Spi.ADC4_Accum ); |
Kovalev_D | 147:1aed74f19a8f | 976 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 977 | } |
Kovalev_D | 147:1aed74f19a8f | 978 | if (Time[0] == 'q') { // внешняя защелка |
Kovalev_D | 147:1aed74f19a8f | 979 | Gyro.EXT_Latch=1; |
Kovalev_D | 147:1aed74f19a8f | 980 | } |
Kovalev_D | 147:1aed74f19a8f | 981 | if (Time[0] == '1') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 982 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 983 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 984 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_1Point[i]); |
Kovalev_D | 147:1aed74f19a8f | 985 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 986 | } |
Kovalev_D | 147:1aed74f19a8f | 987 | if (Time[0] == '2') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 988 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 989 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 990 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_8Point[i]); |
Kovalev_D | 147:1aed74f19a8f | 991 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 992 | } |
Kovalev_D | 147:1aed74f19a8f | 993 | if (Time[0] == '3') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 994 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 995 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 996 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_16Point[i]); |
Kovalev_D | 147:1aed74f19a8f | 997 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 998 | } |
Kovalev_D | 147:1aed74f19a8f | 999 | if (Time[0] == '4') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1000 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1001 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1002 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_16PointD[i]); |
Kovalev_D | 147:1aed74f19a8f | 1003 | WriteCon(Time); |
Kovalev_D | 174:daffcc97d532 | 1004 | } |
Kovalev_D | 147:1aed74f19a8f | 1005 | if (Time[0] == 'z'){ // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1006 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1007 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1008 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 147:1aed74f19a8f | 1009 | { |
Kovalev_D | 174:daffcc97d532 | 1010 | ttemp=(Buff_Restored_sin[i]); |
Kovalev_D | 174:daffcc97d532 | 1011 | if (ttemp > 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 147:1aed74f19a8f | 1012 | } |
Kovalev_D | 174:daffcc97d532 | 1013 | } |
Kovalev_D | 147:1aed74f19a8f | 1014 | if (Time[0] == '6') { // выдача технологическая |
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++ )sprintf((Time + i * 9)," <%05d> ",Buff_Restored_sin[i]); |
Kovalev_D | 147:1aed74f19a8f | 1018 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1019 | } |
Kovalev_D | 147:1aed74f19a8f | 1020 | if (Time[0] == '7') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1021 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1022 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1023 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 10)," <%07d> ",Buff_AMP64P[i]-(Buff_AMP[i])); |
Kovalev_D | 147:1aed74f19a8f | 1024 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1025 | } |
Kovalev_D | 147:1aed74f19a8f | 1026 | if (Time[0] == '9') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1027 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1028 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1029 | for (int i = 0; i < 32; i++ )sprintf((Time)," <%07d> ",Gyro.Frq); |
Kovalev_D | 147:1aed74f19a8f | 1030 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1031 | } |
Kovalev_D | 147:1aed74f19a8f | 1032 | if (Time[0] == 'p') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1033 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1034 | WriteCon(Time); |
Kovalev_D | 183:7e200f4d9b16 | 1035 | for (int i = 0; i < 32; i++ )sprintf((Time)," <%07d> ",Gyro.MaxAmp); |
Kovalev_D | 147:1aed74f19a8f | 1036 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1037 | } |
Kovalev_D | 179:2b4e6bc277df | 1038 | if (Time[0] == 'x') { // выдача технологическая |
Kovalev_D | 179:2b4e6bc277df | 1039 | sprintf(Time,"\r\n"); |
Kovalev_D | 179:2b4e6bc277df | 1040 | WriteCon(Time); |
Kovalev_D | 179:2b4e6bc277df | 1041 | 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 | 1042 | WriteCon(Time); |
Kovalev_D | 179:2b4e6bc277df | 1043 | } |
Kovalev_D | 147:1aed74f19a8f | 1044 | if (Time[0] == 'm') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1045 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1046 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1047 | sprintf((Time),"PLC_Delta <%07d> ", Gyro.PLC_Delta); WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1048 | sprintf((Time),"PLC_DeltaADD <%07d> ", Gyro.PLC_DeltaADD); WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1049 | } |
Kovalev_D | 147:1aed74f19a8f | 1050 | if (Time[0] == 'V') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1051 | Spi.DAC_B += 200; |
Kovalev_D | 147:1aed74f19a8f | 1052 | } |
Kovalev_D | 147:1aed74f19a8f | 1053 | if (Time[0] == 'v') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1054 | Spi.DAC_B -= 200; |
Kovalev_D | 147:1aed74f19a8f | 1055 | } |
Kovalev_D | 147:1aed74f19a8f | 1056 | //////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 150:29c9f7671bac | 1057 | /*Запись лога регулировки частоты*/ |
Kovalev_D | 147:1aed74f19a8f | 1058 | if (Time[0] == 'y') Gyro.LogHZ=1; //включит передачу |
Kovalev_D | 147:1aed74f19a8f | 1059 | if (Time[0] == 'u') Gyro.StrayHZ_flag = 1; //LPC_TIM1->MR0+1000 вносим помеху |
Kovalev_D | 147:1aed74f19a8f | 1060 | if (Time[0] == 'i') Gyro.StrayHZ_flag = 0; //LPC_TIM1->MR0 убираем помеху |
Kovalev_D | 147:1aed74f19a8f | 1061 | if (Time[0] == 'o') Gyro.LogHZ=0; //Отключить передачу |
Kovalev_D | 147:1aed74f19a8f | 1062 | //////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 150:29c9f7671bac | 1063 | /*Запись лога регулировки периметра*/ |
Kovalev_D | 151:d565ce4d58c8 | 1064 | if (Time[0] == 'g') {Gyro.LogPLC=1; Gyro.PLC_Lern=0;} //включит передачу |
Kovalev_D | 150:29c9f7671bac | 1065 | if (Time[0] == 'h') Gyro.StrayPLC_flag = 1; //LPC_TIM1->MR0+1000 вносим помеху + |
Kovalev_D | 150:29c9f7671bac | 1066 | if (Time[0] == 'j') Gyro.StrayPLC_flag = 0; //LPC_TIM1->MR0 убираем помеху |
Kovalev_D | 150:29c9f7671bac | 1067 | if (Time[0] == 'b') Gyro.StrayPLC_flag = 3; //LPC_TIM1->MR0-1000 вносим помеху - |
Kovalev_D | 150:29c9f7671bac | 1068 | if (Time[0] == 'n') Gyro.StrayPLC_flag = 2; //LPC_TIM1->MR0+2500 большая помеха. |
Kovalev_D | 168:f4a6abb18358 | 1069 | if (Time[0] == 'k') Gyro.LogPLC = 0; //Отключить передачу |
Kovalev_D | 168:f4a6abb18358 | 1070 | if (Time[0] == 'd') Gyro.ModJump = 1; //прыжок на воду + |
Kovalev_D | 168:f4a6abb18358 | 1071 | if (Time[0] == 'f') Gyro.ModJump = 2; //прыжок на воду - |
Kovalev_D | 174:daffcc97d532 | 1072 | //if (Time[0] == 'z') {Gyro.ModJump = 3; Spi.DAC_B = 0x3a98; } //прообежать по всем модам. |
Kovalev_D | 189:8a16378724c4 | 1073 | ////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1074 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1075 | ////////////////////////////////////////////////////выдача частоты в терминал длля записи лога/////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1076 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 189:8a16378724c4 | 1077 | //////G=1,K=0 в терменале |
Kovalev_D | 189:8a16378724c4 | 1078 | |
Kovalev_D | 189:8a16378724c4 | 1079 | if((Gyro.LogHZ == 1)&&(Gyro.Event_500Hz==1)) //Запись для Ориджина. |
Kovalev_D | 189:8a16378724c4 | 1080 | { |
Kovalev_D | 189:8a16378724c4 | 1081 | Gyro.Event_500Hz=0; |
Kovalev_D | 189:8a16378724c4 | 1082 | sprintf((Time),"%d \r\n",LPC_TIM1->MR0); |
Kovalev_D | 189:8a16378724c4 | 1083 | WriteCon(Time); |
Kovalev_D | 189:8a16378724c4 | 1084 | } |
Kovalev_D | 189:8a16378724c4 | 1085 | |
Kovalev_D | 189:8a16378724c4 | 1086 | |
Kovalev_D | 147:1aed74f19a8f | 1087 | if (Time[0] == '8') { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1088 | sprintf(Time,"\r\n"); |
Kovalev_D | 147:1aed74f19a8f | 1089 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1090 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 147:1aed74f19a8f | 1091 | { |
Kovalev_D | 147:1aed74f19a8f | 1092 | ttemp=(Buff_AMP64P[i]-(Buff_AMP[i])); |
Kovalev_D | 147:1aed74f19a8f | 1093 | if (ttemp < 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 147:1aed74f19a8f | 1094 | } |
Kovalev_D | 147:1aed74f19a8f | 1095 | } |
Kovalev_D | 168:f4a6abb18358 | 1096 | if (Time[0] == 'q') { // выдача технологическая |
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_Restored_sin[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 | 147:1aed74f19a8f | 1105 | if (Gyro.PLC_Error2Mode) { // выдача технологическая |
Kovalev_D | 147:1aed74f19a8f | 1106 | sprintf(Time,"\r\nPLC_Error2Mode"); |
Kovalev_D | 147:1aed74f19a8f | 1107 | WriteCon(Time); |
Kovalev_D | 147:1aed74f19a8f | 1108 | } |
Kovalev_D | 147:1aed74f19a8f | 1109 | } |
igor_v | 0:8ad47e2b6f00 | 1110 | } |
igor_v | 0:8ad47e2b6f00 | 1111 | |
igor_v | 0:8ad47e2b6f00 | 1112 |