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