![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
main.c@141:c6de20b9b483, 2016-04-26 (annotated)
- Committer:
- Kovalev_D
- Date:
- Tue Apr 26 13:42:09 2016 +0000
- Revision:
- 141:c6de20b9b483
- Parent:
- 140:1fbf117fc120
- Child:
- 142:7a6f68601291
?????? ??? ?????????? ??????? ??????????? ?????????, ??????????? ????????? ???????????.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 8:5188b1448d34 | 1 | //ssdfwewedfsfds |
igor_v | 0:8ad47e2b6f00 | 2 | /****************************************Copyright (c)**************************************************** |
igor_v | 0:8ad47e2b6f00 | 3 | **--------------File Info--------------------------------------------------------------------------------- |
igor_v | 0:8ad47e2b6f00 | 4 | ** File name: main.c |
igor_v | 0:8ad47e2b6f00 | 5 | ** Last modified Date: 2011-10-24 |
igor_v | 0:8ad47e2b6f00 | 6 | ** Last Version: V1.00 |
igor_v | 0:8ad47e2b6f00 | 7 | ** Descriptions: The main() function |
igor_v | 0:8ad47e2b6f00 | 8 | ** |
igor_v | 0:8ad47e2b6f00 | 9 | **-------------------------------------------------------------------------------------------------------- |
igor_v | 0:8ad47e2b6f00 | 10 | ** Created by: Electrooptica Incorp. |
igor_v | 0:8ad47e2b6f00 | 11 | ** Created date: 2011-08-22 |
igor_v | 0:8ad47e2b6f00 | 12 | ** Version: V1.00 |
igor_v | 3:ed8744c5f67a | 13 | ** Descriptions: |
igor_v | 3:ed8744c5f67a | 14 | **-------------------------------------------------------------------------------------------------------- |
igor_v | 30:17c84ed091b3 | 15 | последнии изменения |
igor_v | 30:17c84ed091b3 | 16 | //2016_02_03_17_47 |
igor_v | 31:c783288001b5 | 17 | //2016_02_06 igor |
igor_v | 37:bdd52117b56e | 18 | //2016_06 Dima |
Kovalev_D | 41:70d12776d1ef | 19 | //2016_02_06 21:20 Kovalev_D |
igor_v | 0:8ad47e2b6f00 | 20 | *********************************************************************************************************/ |
igor_v | 21:bc8c1cec3da6 | 21 | |
igor_v | 0:8ad47e2b6f00 | 22 | |
igor_v | 0:8ad47e2b6f00 | 23 | #include "Global.h" |
igor_v | 0:8ad47e2b6f00 | 24 | //#include <math.h> |
Diletant | 74:f4d9c3403578 | 25 | #include "Device.h" |
Kovalev_D | 130:1421dda4d7e7 | 26 | //#include "IAP.h" |
igor_v | 0:8ad47e2b6f00 | 27 | /****************************************************************************** |
igor_v | 0:8ad47e2b6f00 | 28 | ** Main Function main() |
igor_v | 0:8ad47e2b6f00 | 29 | ******************************************************************************/ |
Diletant | 138:14a0c452cf32 | 30 | extern Device device; //Single global for all device hardware-independent algorithm |
Kovalev_D | 132:2c7bec5cf6fe | 31 | #define IMG_START_SECTOR 0x00010000 /* Sector 16 */ |
Kovalev_D | 136:19b9e6abb86f | 32 | #define IMG_END_SECTOR 0x00017FFF /* Sector 20 */ |
Kovalev_D | 136:19b9e6abb86f | 33 | |
Kovalev_D | 132:2c7bec5cf6fe | 34 | /* |
Kovalev_D | 132:2c7bec5cf6fe | 35 | #define IMG_START_SECTOR 0x00030000//0x00010000 /* Sector 16 |
Kovalev_D | 132:2c7bec5cf6fe | 36 | #define IMG_END_SECTOR 0x00037FFF */ |
Kovalev_D | 136:19b9e6abb86f | 37 | unsigned int addres; |
Kovalev_D | 136:19b9e6abb86f | 38 | |
Kovalev_D | 134:caf4c9cd5052 | 39 | uint32_t Result[5]; |
igor_v | 0:8ad47e2b6f00 | 40 | extern uint32_t CMD_Mode; |
igor_v | 52:30f2e52a493f | 41 | unsigned int secPuls; |
igor_v | 52:30f2e52a493f | 42 | float DACF, K_DAC; |
Kovalev_D | 107:4d178bcc9d8a | 43 | int tempAMP; |
Kovalev_D | 139:1716152517aa | 44 | int temp; |
Kovalev_D | 136:19b9e6abb86f | 45 | //unsigned int *Add; |
Kovalev_D | 136:19b9e6abb86f | 46 | |
Kovalev_D | 136:19b9e6abb86f | 47 | unsigned int status; |
Kovalev_D | 136:19b9e6abb86f | 48 | unsigned int Para; |
igor_v | 52:30f2e52a493f | 49 | int main (void) |
igor_v | 52:30f2e52a493f | 50 | { |
igor_v | 110:6406b7ac0442 | 51 | int ttemp; |
Kovalev_D | 136:19b9e6abb86f | 52 | |
igor_v | 110:6406b7ac0442 | 53 | unsigned int TempA; |
Kovalev_D | 136:19b9e6abb86f | 54 | SystemInit1(); // Инициализация контроллера: установка тактовых частот |
Kovalev_D | 136:19b9e6abb86f | 55 | addres = 0x10000; |
Kovalev_D | 133:90d0bf0e2996 | 56 | |
Kovalev_D | 133:90d0bf0e2996 | 57 | |
Kovalev_D | 134:caf4c9cd5052 | 58 | //FlashDMA_Init(); // Загрузка параметров с флэш |
Kovalev_D | 86:398da56ef751 | 59 | SystemCoreClockUpdate1(); // расчет тактовой частоты процессора перед инициализацией UART - 100MHz |
Kovalev_D | 88:b5c1d9d338d1 | 60 | |
Kovalev_D | 134:caf4c9cd5052 | 61 | |
Kovalev_D | 134:caf4c9cd5052 | 62 | |
Kovalev_D | 86:398da56ef751 | 63 | GLD_Init(); |
Kovalev_D | 92:c892f0311aa7 | 64 | ///////////старый UART |
igor_v | 91:a2bb81eaa183 | 65 | // UARTInit(); // инициализация UART0 на скорость 38400. |
igor_v | 91:a2bb81eaa183 | 66 | // UART1_Init(); // инициализация UART1 на скорость 38400. |
Kovalev_D | 88:b5c1d9d338d1 | 67 | |
igor_v | 91:a2bb81eaa183 | 68 | |
Kovalev_D | 134:caf4c9cd5052 | 69 | UART_InitSet (0, 921600, 0x03); // надо проверить, мож чо с ногам |
Kovalev_D | 129:406995a91322 | 70 | // UART_InitSet (1, 921600, 0x03); |
Kovalev_D | 129:406995a91322 | 71 | UART_InitSet (1, 115200, 0x03); |
Kovalev_D | 99:3d8f206ceac2 | 72 | |
Kovalev_D | 86:398da56ef751 | 73 | //////////// |
Kovalev_D | 90:d9b6a4bc5065 | 74 | //DAC_ADC_Exchange_Init(); // инициализация обмена АЦП и ЦАП. |
Kovalev_D | 88:b5c1d9d338d1 | 75 | |
Diletant | 46:2670fa0fcebc | 76 | IntLatch_Init(); // инициализация внутренней защелки. |
Diletant | 46:2670fa0fcebc | 77 | ExtLatch_Init(); // инициализация внешней защелки. |
igor_v | 21:bc8c1cec3da6 | 78 | LoadFlashParam(FromFLASH); //загрузка параметров. |
Kovalev_D | 89:a0d344db227e | 79 | |
Kovalev_D | 112:4a96133a1311 | 80 | // open_all_loops(); //#define open_all_loops() RgConA = 0 (Основной регистр управления устройства (0 - включить, 1 - отключить)). |
Kovalev_D | 129:406995a91322 | 81 | // Output.Str.HF_reg = Device_blk.Str.HF_min; //HFO output voltage = максивальное напряжение на ГВЧ. |
igor_v | 30:17c84ed091b3 | 82 | init_PLC(); //Инициализация СРП(регулировка периметра) |
igor_v | 30:17c84ed091b3 | 83 | init_Dither_reg(); //инициализация вибропривода |
Kovalev_D | 112:4a96133a1311 | 84 | // RgConB = RATE_VIBRO_1; // дополнительный регистр управления = разность вибросчетчиков после фильтра скольз.среднего(#define RATE_VIBRO_1 0x0001) |
Kovalev_D | 112:4a96133a1311 | 85 | // close_all_loops(); |
igor_v | 51:81f47b817071 | 86 | |
Kovalev_D | 105:bd01d8d20fb6 | 87 | Out_G_photo(200,200); //запись в буфер мастера принятые от функции данные (60,60) и установка флага старта передачи и занятой шины. |
Kovalev_D | 105:bd01d8d20fb6 | 88 | |
Kovalev_D | 47:d902ef6f7564 | 89 | WriteCon1("\n\r ...GL start programm uart ACK.... "); |
Kovalev_D | 47:d902ef6f7564 | 90 | WriteCon("\n\r ...GL start programm uart Tech.... "); |
igor_v | 15:f5191a1c3805 | 91 | sprintf(Time,"\r\nCompiled: %s %s.",__DATE__, __TIME__ ); //Подготовка даты и времени компиляции |
igor_v | 13:e2a1d18677b8 | 92 | WriteCon(Time); |
igor_v | 11:af609f6dee46 | 93 | |
igor_v | 127:6a7472d67804 | 94 | Gyro.PLC_Error2Mode = 10; // начальная задержка (неработает СРП) |
igor_v | 11:af609f6dee46 | 95 | |
Kovalev_D | 50:0e3d47f18a50 | 96 | while ( 1 ) { //основной цикл. |
Kovalev_D | 107:4d178bcc9d8a | 97 | |
Kovalev_D | 108:030cdde08314 | 98 | G_Photo_Exchange(); |
Kovalev_D | 108:030cdde08314 | 99 | Concol (); // Проврка 0 консоли (вход и выход) |
Kovalev_D | 93:b3803774f110 | 100 | Concol1 (); // Проврка 0 консоли (вход и выход) |
Kovalev_D | 99:3d8f206ceac2 | 101 | Read_CMD(); |
igor_v | 3:ed8744c5f67a | 102 | if (OutBufConCount) OutBufConCount--; |
Kovalev_D | 108:030cdde08314 | 103 | if (OutBufCon1Count) OutBufCon1Count--; |
Kovalev_D | 121:bbae560cdd43 | 104 | |
Kovalev_D | 95:dd51e577e114 | 105 | if (ReadCon (Time)) { |
Kovalev_D | 132:2c7bec5cf6fe | 106 | ///////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 107 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 108 | //////////////////////Выбор FlashMod/////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 109 | //////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 110 | |
Kovalev_D | 136:19b9e6abb86f | 111 | if (Time[0] == 'B') { |
Kovalev_D | 132:2c7bec5cf6fe | 112 | Gyro.FlashMod=1; |
Kovalev_D | 136:19b9e6abb86f | 113 | } |
Kovalev_D | 136:19b9e6abb86f | 114 | if (Time[0] == 'W') { |
Kovalev_D | 136:19b9e6abb86f | 115 | Gyro.FlashMod=2; |
Kovalev_D | 132:2c7bec5cf6fe | 116 | } |
Kovalev_D | 132:2c7bec5cf6fe | 117 | if (Time[0] == 'R') { |
Kovalev_D | 136:19b9e6abb86f | 118 | Gyro.FlashMod=3; |
Kovalev_D | 132:2c7bec5cf6fe | 119 | } |
Kovalev_D | 132:2c7bec5cf6fe | 120 | |
Kovalev_D | 136:19b9e6abb86f | 121 | |
Kovalev_D | 132:2c7bec5cf6fe | 122 | /////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 123 | /////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 124 | //////////////////////////////////////////////////////////////// |
igor_v | 48:8697dfe679b9 | 125 | |
Kovalev_D | 141:c6de20b9b483 | 126 | if (Time[0] == 'H') { // если ввели буквц h то выдать подсказку. сделанно через принф ОЧЕНЬ плохо в работе не использовать |
igor_v | 15:f5191a1c3805 | 127 | sprintf(Time,"\r\nCompiled: %s %s.",__DATE__, __TIME__ ); //Подготовка даты и времени компиляции |
igor_v | 15:f5191a1c3805 | 128 | WriteCon(Time); |
igor_v | 52:30f2e52a493f | 129 | sprintf(Time,"--%d.%3.d.%2.d.",Time1Hz,Time1K,Time100K); //Временно выдачпа временни из трех чисел |
igor_v | 15:f5191a1c3805 | 130 | WriteCon(Time); |
igor_v | 52:30f2e52a493f | 131 | } |
igor_v | 52:30f2e52a493f | 132 | if (Time[0] == 'D') { |
igor_v | 52:30f2e52a493f | 133 | Gyro.Discharg = StartDischarg; |
igor_v | 15:f5191a1c3805 | 134 | } |
igor_v | 52:30f2e52a493f | 135 | if (Time[0] == 'L') { |
igor_v | 52:30f2e52a493f | 136 | Gyro.BackLight = StartBackLight; |
igor_v | 52:30f2e52a493f | 137 | } |
Kovalev_D | 98:95b8e79f13e1 | 138 | |
Kovalev_D | 108:030cdde08314 | 139 | if (Time[0] == 'F') { // выдача технологическая |
Kovalev_D | 105:bd01d8d20fb6 | 140 | sprintf(Time,"\r\n"); |
Kovalev_D | 105:bd01d8d20fb6 | 141 | WriteCon(Time); |
Kovalev_D | 105:bd01d8d20fb6 | 142 | sprintf((Time)," <%07d> <%07d>",Gyro.F_ras,Param2); |
Kovalev_D | 105:bd01d8d20fb6 | 143 | WriteCon(Time); |
Kovalev_D | 105:bd01d8d20fb6 | 144 | } |
Kovalev_D | 128:1e4675a36c93 | 145 | |
Kovalev_D | 128:1e4675a36c93 | 146 | if (Time[0] == 'q') { // внешняя защелка |
Kovalev_D | 128:1e4675a36c93 | 147 | Gyro.EXT_Latch=1; |
Kovalev_D | 128:1e4675a36c93 | 148 | } |
Kovalev_D | 98:95b8e79f13e1 | 149 | if (Time[0] == '1') { // выдача технологическая |
Kovalev_D | 88:b5c1d9d338d1 | 150 | sprintf(Time,"\r\n"); |
Kovalev_D | 95:dd51e577e114 | 151 | WriteCon(Time); |
Kovalev_D | 96:1c8536458119 | 152 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_1Point[i]); |
igor_v | 52:30f2e52a493f | 153 | WriteCon(Time); |
igor_v | 52:30f2e52a493f | 154 | } |
Kovalev_D | 98:95b8e79f13e1 | 155 | |
Kovalev_D | 98:95b8e79f13e1 | 156 | if (Time[0] == '2') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 157 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 158 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 159 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_8Point[i]); |
Kovalev_D | 98:95b8e79f13e1 | 160 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 161 | } |
Kovalev_D | 98:95b8e79f13e1 | 162 | if (Time[0] == '3') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 163 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 164 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 165 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_16Point[i]); |
Kovalev_D | 98:95b8e79f13e1 | 166 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 167 | } |
Kovalev_D | 98:95b8e79f13e1 | 168 | |
Kovalev_D | 98:95b8e79f13e1 | 169 | if (Time[0] == '4') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 170 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 171 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 172 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ", Buff_16PointD[i]); |
Kovalev_D | 98:95b8e79f13e1 | 173 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 174 | } |
Kovalev_D | 108:030cdde08314 | 175 | |
Kovalev_D | 108:030cdde08314 | 176 | |
Kovalev_D | 108:030cdde08314 | 177 | |
Kovalev_D | 104:ab1cb4ff56b2 | 178 | if (Time[0] == 'z') { // выдача технологическая |
Kovalev_D | 104:ab1cb4ff56b2 | 179 | sprintf(Time,"\r\n"); |
Kovalev_D | 104:ab1cb4ff56b2 | 180 | WriteCon(Time); |
Kovalev_D | 104:ab1cb4ff56b2 | 181 | |
Kovalev_D | 104:ab1cb4ff56b2 | 182 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 104:ab1cb4ff56b2 | 183 | { |
Kovalev_D | 104:ab1cb4ff56b2 | 184 | ttemp=(Buff_16PointD[i]); |
Kovalev_D | 104:ab1cb4ff56b2 | 185 | if (ttemp < 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 104:ab1cb4ff56b2 | 186 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 187 | |
Kovalev_D | 104:ab1cb4ff56b2 | 188 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 189 | |
Kovalev_D | 104:ab1cb4ff56b2 | 190 | |
Kovalev_D | 98:95b8e79f13e1 | 191 | if (Time[0] == '5') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 192 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 193 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 194 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_32Point[i]); |
Kovalev_D | 98:95b8e79f13e1 | 195 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 196 | } |
Kovalev_D | 98:95b8e79f13e1 | 197 | |
Kovalev_D | 98:95b8e79f13e1 | 198 | if (Time[0] == '6') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 199 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 200 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 201 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_Restored_sin[i]); |
Kovalev_D | 98:95b8e79f13e1 | 202 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 203 | } |
Kovalev_D | 95:dd51e577e114 | 204 | |
Kovalev_D | 95:dd51e577e114 | 205 | |
Kovalev_D | 104:ab1cb4ff56b2 | 206 | |
Kovalev_D | 104:ab1cb4ff56b2 | 207 | if (Time[0] == 'c') { // выдача технологическая |
Kovalev_D | 104:ab1cb4ff56b2 | 208 | sprintf(Time,"\r\n"); |
Kovalev_D | 104:ab1cb4ff56b2 | 209 | WriteCon(Time); |
Kovalev_D | 106:250ddd8629c6 | 210 | sprintf((Time)," <%07d> <%07d> <%07d> <%07d>", Gyro.F_ras,Gyro.F_ras/16, Gyro.Cnt_Pls, Gyro.Cnt_Mns); |
Kovalev_D | 104:ab1cb4ff56b2 | 211 | WriteCon(Time); |
Kovalev_D | 104:ab1cb4ff56b2 | 212 | } |
Kovalev_D | 104:ab1cb4ff56b2 | 213 | |
Kovalev_D | 104:ab1cb4ff56b2 | 214 | |
Kovalev_D | 104:ab1cb4ff56b2 | 215 | |
Kovalev_D | 98:95b8e79f13e1 | 216 | if (Time[0] == '7') { // выдача технологическая |
Kovalev_D | 95:dd51e577e114 | 217 | sprintf(Time,"\r\n"); |
Kovalev_D | 95:dd51e577e114 | 218 | WriteCon(Time); |
Kovalev_D | 96:1c8536458119 | 219 | for (int i = 0; i < 32; i++ )sprintf((Time + i * 10)," <%07d> ",Buff_AMP64P[i]-(Buff_AMP[i])); |
Kovalev_D | 95:dd51e577e114 | 220 | WriteCon(Time); |
Kovalev_D | 95:dd51e577e114 | 221 | } |
Kovalev_D | 98:95b8e79f13e1 | 222 | if (Time[0] == '9') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 223 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 224 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 225 | for (int i = 0; i < 32; i++ )sprintf((Time)," <%07d> ",Gyro.Frq); |
Kovalev_D | 98:95b8e79f13e1 | 226 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 227 | } |
Kovalev_D | 98:95b8e79f13e1 | 228 | |
Kovalev_D | 98:95b8e79f13e1 | 229 | if (Time[0] == 'p') { // выдача технологическая |
Kovalev_D | 98:95b8e79f13e1 | 230 | sprintf(Time,"\r\n"); |
Kovalev_D | 98:95b8e79f13e1 | 231 | WriteCon(Time); |
Kovalev_D | 99:3d8f206ceac2 | 232 | for (int i = 0; i < 32; i++ )sprintf((Time)," <%07d> ",Cur_Amp); |
Kovalev_D | 98:95b8e79f13e1 | 233 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 234 | } |
Kovalev_D | 99:3d8f206ceac2 | 235 | if (Time[0] == 'm') { // выдача технологическая |
Kovalev_D | 99:3d8f206ceac2 | 236 | sprintf(Time,"\r\n"); |
Kovalev_D | 99:3d8f206ceac2 | 237 | WriteCon(Time); |
Kovalev_D | 128:1e4675a36c93 | 238 | // sprintf((Time),"Cur_Amp <%07d> ", Cur_Amp); WriteCon(Time); |
Kovalev_D | 128:1e4675a36c93 | 239 | // sprintf((Time),"Znak_Amp <%07d> ", Znak_Amp); WriteCon(Time); |
Kovalev_D | 128:1e4675a36c93 | 240 | // sprintf((Time),"AD_Regul <%07d> ", AD_Regul); WriteCon(Time); |
Kovalev_D | 128:1e4675a36c93 | 241 | |
Kovalev_D | 128:1e4675a36c93 | 242 | sprintf((Time),"PLC_Delta <%07d> ", Gyro.PLC_Delta); WriteCon(Time); |
Kovalev_D | 128:1e4675a36c93 | 243 | sprintf((Time),"PLC_DeltaADD <%07d> ", Gyro.PLC_DeltaADD); WriteCon(Time); |
Kovalev_D | 109:ee0cff33ad3b | 244 | // printf((Time),"AD_Regul <%07d> ", Delta); WriteCon(Time); |
Kovalev_D | 109:ee0cff33ad3b | 245 | |
Kovalev_D | 109:ee0cff33ad3b | 246 | // sprintf((Time),"Spi.DAC_B <%07d> ",Spi.DAC_B); WriteCon(Time);*/ |
Kovalev_D | 109:ee0cff33ad3b | 247 | // sprintf((Time),"MaxAmp <%07d> ", MaxAmp); WriteCon(Time); |
Kovalev_D | 109:ee0cff33ad3b | 248 | // sprintf((Time),"CaunAddPlus <%07d> ", CaunAddPlus); WriteCon(Time); |
Kovalev_D | 109:ee0cff33ad3b | 249 | // sprintf((Time),"CaunAddMin <%07d> ", CaunAddMin); WriteCon(Time); |
Kovalev_D | 109:ee0cff33ad3b | 250 | // sprintf((Time)," Gyro.Amp <%07d> ",amp); WriteCon(Time); |
Kovalev_D | 108:030cdde08314 | 251 | |
Kovalev_D | 99:3d8f206ceac2 | 252 | } |
Kovalev_D | 98:95b8e79f13e1 | 253 | if (Time[0] == 'V') { // выдача технологическая |
Kovalev_D | 109:ee0cff33ad3b | 254 | // Gyro.Frq+=65000; |
Kovalev_D | 121:bbae560cdd43 | 255 | Spi.DAC_B += 200; |
Kovalev_D | 109:ee0cff33ad3b | 256 | |
Kovalev_D | 98:95b8e79f13e1 | 257 | } |
Kovalev_D | 98:95b8e79f13e1 | 258 | if (Time[0] == 'v') { // выдача технологическая |
Kovalev_D | 109:ee0cff33ad3b | 259 | //Gyro.Frq-=65000; |
Kovalev_D | 121:bbae560cdd43 | 260 | Spi.DAC_B -= 200; |
Kovalev_D | 98:95b8e79f13e1 | 261 | } |
Kovalev_D | 139:1716152517aa | 262 | /* |
Kovalev_D | 139:1716152517aa | 263 | if (Time[0] == 'Y') { // выдача технологическая |
Kovalev_D | 139:1716152517aa | 264 | Log=1; |
Kovalev_D | 139:1716152517aa | 265 | }*/ |
Kovalev_D | 139:1716152517aa | 266 | |
Kovalev_D | 139:1716152517aa | 267 | |
Kovalev_D | 139:1716152517aa | 268 | |
Kovalev_D | 139:1716152517aa | 269 | //////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 139:1716152517aa | 270 | /*Запись лога настройки частоты*/ |
Kovalev_D | 140:1fbf117fc120 | 271 | if (Time[0] == 'y') Gyro.LogHZ=1; //включит передачу |
Kovalev_D | 140:1fbf117fc120 | 272 | if (Time[0] == 'u') Gyro.StrayHZ_flag = 1; //LPC_TIM1->MR0+1000 вносим помеху |
Kovalev_D | 140:1fbf117fc120 | 273 | if (Time[0] == 'i') Gyro.StrayHZ_flag = 0; //LPC_TIM1->MR0 убираем помеху |
Kovalev_D | 140:1fbf117fc120 | 274 | if (Time[0] == 'o') Gyro.LogHZ=0; //Отключить передачу |
Kovalev_D | 139:1716152517aa | 275 | //////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 140:1fbf117fc120 | 276 | |
Kovalev_D | 140:1fbf117fc120 | 277 | if (Time[0] == 'g') Gyro.LogPLC=1; //включит передачу |
Kovalev_D | 140:1fbf117fc120 | 278 | if (Time[0] == 'h') Gyro.StrayPLC_flag = 1; //LPC_TIM1->MR0+1000 вносим помеху |
Kovalev_D | 140:1fbf117fc120 | 279 | if (Time[0] == 'j') Gyro.StrayPLC_flag = 0; |
Kovalev_D | 140:1fbf117fc120 | 280 | if (Time[0] == 'n') Gyro.StrayPLC_flag = 2; //LPC_TIM1->MR0 убираем помеху |
Kovalev_D | 140:1fbf117fc120 | 281 | if (Time[0] == 'k') Gyro.LogPLC=0; //Отключить передачу |
Kovalev_D | 140:1fbf117fc120 | 282 | |
Kovalev_D | 141:c6de20b9b483 | 283 | ////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 139:1716152517aa | 284 | |
Kovalev_D | 96:1c8536458119 | 285 | |
Kovalev_D | 98:95b8e79f13e1 | 286 | if (Time[0] == '8') { // выдача технологическая |
Kovalev_D | 96:1c8536458119 | 287 | sprintf(Time,"\r\n"); |
Kovalev_D | 96:1c8536458119 | 288 | WriteCon(Time); |
Kovalev_D | 96:1c8536458119 | 289 | // for (int i = 0; i < 32; i++ )sprintf((Time + i * 9)," <%05d> ",Buff_AMP64P[i]-(Buff_AMP[i]*2)); |
Kovalev_D | 96:1c8536458119 | 290 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 96:1c8536458119 | 291 | { |
Kovalev_D | 96:1c8536458119 | 292 | ttemp=(Buff_AMP64P[i]-(Buff_AMP[i])); |
Kovalev_D | 96:1c8536458119 | 293 | if (ttemp < 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 96:1c8536458119 | 294 | } |
Kovalev_D | 96:1c8536458119 | 295 | // WriteCon(Time); |
Kovalev_D | 96:1c8536458119 | 296 | } |
Kovalev_D | 95:dd51e577e114 | 297 | |
Kovalev_D | 98:95b8e79f13e1 | 298 | if (Time[0] == 'b') { // выдача технологическая |
Kovalev_D | 92:c892f0311aa7 | 299 | sprintf(Time,"\r\n"); |
Kovalev_D | 95:dd51e577e114 | 300 | WriteCon(Time); |
Kovalev_D | 98:95b8e79f13e1 | 301 | |
Kovalev_D | 98:95b8e79f13e1 | 302 | for (int i = 0; i < 32; i++ ) |
Kovalev_D | 98:95b8e79f13e1 | 303 | { |
Kovalev_D | 98:95b8e79f13e1 | 304 | ttemp=(Buff_Restored_sin[i]); |
Kovalev_D | 98:95b8e79f13e1 | 305 | if (ttemp < 0) WriteCon("1"); else WriteCon("0"); |
Kovalev_D | 98:95b8e79f13e1 | 306 | } |
Kovalev_D | 98:95b8e79f13e1 | 307 | |
Kovalev_D | 92:c892f0311aa7 | 308 | } |
Kovalev_D | 98:95b8e79f13e1 | 309 | |
Kovalev_D | 128:1e4675a36c93 | 310 | if (Gyro.PLC_Error2Mode) { // выдача технологическая |
Kovalev_D | 128:1e4675a36c93 | 311 | sprintf(Time,"\r\nPLC_Error2Mode"); |
Kovalev_D | 128:1e4675a36c93 | 312 | WriteCon(Time); |
Kovalev_D | 128:1e4675a36c93 | 313 | } |
Kovalev_D | 121:bbae560cdd43 | 314 | |
Kovalev_D | 95:dd51e577e114 | 315 | } |
Kovalev_D | 108:030cdde08314 | 316 | |
Kovalev_D | 136:19b9e6abb86f | 317 | |
Kovalev_D | 116:66f1f0ff2dab | 318 | |
Kovalev_D | 116:66f1f0ff2dab | 319 | Event_100KHz(); |
Kovalev_D | 88:b5c1d9d338d1 | 320 | Event_1KHz(); |
Kovalev_D | 124:9ae09249f842 | 321 | Event_500Hz(); |
Kovalev_D | 116:66f1f0ff2dab | 322 | Event_1Hz(); |
Kovalev_D | 124:9ae09249f842 | 323 | |
Kovalev_D | 88:b5c1d9d338d1 | 324 | Event_Vibro(); |
Kovalev_D | 124:9ae09249f842 | 325 | |
Kovalev_D | 124:9ae09249f842 | 326 | switch(Gyro.ModeOut) { |
Kovalev_D | 124:9ae09249f842 | 327 | case 1: |
Kovalev_D | 124:9ae09249f842 | 328 | if(Gyro.Rate1_Event==1)CMD_Rate(); |
Kovalev_D | 124:9ae09249f842 | 329 | break; |
Kovalev_D | 124:9ae09249f842 | 330 | case 2: |
Kovalev_D | 124:9ae09249f842 | 331 | if(Gyro.Rate2_Event==1)CMD_Rate2(); |
Kovalev_D | 124:9ae09249f842 | 332 | break; |
Kovalev_D | 124:9ae09249f842 | 333 | case 3: |
Kovalev_D | 124:9ae09249f842 | 334 | if(Gyro.Delta500_Event==1)CMD_Delta_500Hz(); |
Kovalev_D | 128:1e4675a36c93 | 335 | break; |
Kovalev_D | 128:1e4675a36c93 | 336 | case 4: |
Kovalev_D | 128:1e4675a36c93 | 337 | if(Gyro.EXT_Latch==1){CMD_Delta_Ext();} |
Kovalev_D | 128:1e4675a36c93 | 338 | break; |
Kovalev_D | 124:9ae09249f842 | 339 | } |
igor_v | 111:8ee1ef722ba7 | 340 | if (Spi.ADC_NewData == 1) // был приход новых данных по ацп сдесь сделать обработку информации и подготовку для выдачи делается 1 раз за вибро |
igor_v | 110:6406b7ac0442 | 341 | { |
igor_v | 114:5cc38a53d8a7 | 342 | // можно апихнкть в функцию |
igor_v | 110:6406b7ac0442 | 343 | Spi.ADC_NewData = 0; |
Kovalev_D | 113:8be429494918 | 344 | Gyro.Termo = Spi.ADC1; |
Kovalev_D | 113:8be429494918 | 345 | Gyro.In1 = Spi.ADC2; |
Kovalev_D | 113:8be429494918 | 346 | Gyro.In2 = Spi.ADC3; |
Kovalev_D | 113:8be429494918 | 347 | Gyro.DeltaT = Spi.ADC4; |
igor_v | 114:5cc38a53d8a7 | 348 | TempA = (0x7fff - Spi.ADC5) << 1; // перевернем знак и умножим на два (бало 32000...0 стало 0 ...64000) |
Kovalev_D | 112:4a96133a1311 | 349 | |
igor_v | 110:6406b7ac0442 | 350 | Gyro.ADF_Accum += TempA; |
igor_v | 110:6406b7ac0442 | 351 | Gyro.ADS_Accum += TempA; |
igor_v | 110:6406b7ac0442 | 352 | Gyro.ADF_Count ++; |
igor_v | 110:6406b7ac0442 | 353 | Gyro.ADS_Count ++; |
igor_v | 110:6406b7ac0442 | 354 | |
igor_v | 111:8ee1ef722ba7 | 355 | if (Gyro.ADF_Count > 15) // если прошло 16 тактов виброподвеса |
igor_v | 110:6406b7ac0442 | 356 | { |
igor_v | 111:8ee1ef722ba7 | 357 | Gyro.AD_Fast = Gyro.ADF_Accum << 12; //обновляем данные и приводим в один масштаб |
igor_v | 110:6406b7ac0442 | 358 | Gyro.ADF_Count = 0; |
igor_v | 110:6406b7ac0442 | 359 | Gyro.ADF_Accum = 0; |
igor_v | 110:6406b7ac0442 | 360 | Gyro.ADF_NewData = 1; |
igor_v | 110:6406b7ac0442 | 361 | } |
igor_v | 111:8ee1ef722ba7 | 362 | if (Gyro.ADS_Count > 255) // если прошло 256 тактов виброподвеса |
igor_v | 110:6406b7ac0442 | 363 | { |
igor_v | 111:8ee1ef722ba7 | 364 | Gyro.AD_Slow = Gyro.ADS_Accum << 8; //обновляем данные и приводим в один масштаб |
igor_v | 110:6406b7ac0442 | 365 | Gyro.ADS_Count = 0; |
igor_v | 110:6406b7ac0442 | 366 | Gyro.ADS_Accum = 0; |
igor_v | 110:6406b7ac0442 | 367 | Gyro.ADS_NewData = 1; |
igor_v | 110:6406b7ac0442 | 368 | } |
igor_v | 110:6406b7ac0442 | 369 | } |
Kovalev_D | 112:4a96133a1311 | 370 | |
Kovalev_D | 113:8be429494918 | 371 | |
Kovalev_D | 113:8be429494918 | 372 | |
Kovalev_D | 113:8be429494918 | 373 | |
igor_v | 111:8ee1ef722ba7 | 374 | if (Gyro.ADF_NewData == 1) // был приход новых данных После быстрого фильтра AD |
igor_v | 111:8ee1ef722ba7 | 375 | { |
Kovalev_D | 112:4a96133a1311 | 376 | Gyro.ADF_NewData = 0; |
igor_v | 114:5cc38a53d8a7 | 377 | }// можно запихнкть в функцию |
igor_v | 114:5cc38a53d8a7 | 378 | |
igor_v | 114:5cc38a53d8a7 | 379 | if (Gyro.ADS_NewData == 1) // был приход новых данных После Медленного фильтра AD |
igor_v | 114:5cc38a53d8a7 | 380 | { |
Kovalev_D | 116:66f1f0ff2dab | 381 | |
igor_v | 114:5cc38a53d8a7 | 382 | Gyro.ADS_NewData = 0; |
igor_v | 114:5cc38a53d8a7 | 383 | PlcRegul();//Расчет |
Kovalev_D | 140:1fbf117fc120 | 384 | |
Kovalev_D | 141:c6de20b9b483 | 385 | |
Kovalev_D | 113:8be429494918 | 386 | |
Kovalev_D | 112:4a96133a1311 | 387 | }// можно запихнкть в функцию |
Kovalev_D | 112:4a96133a1311 | 388 | |
igor_v | 114:5cc38a53d8a7 | 389 | if(Gyro.VibroFrqRegulF == 1) //Регулеровка частоты виброподвеса |
Kovalev_D | 112:4a96133a1311 | 390 | { |
Kovalev_D | 112:4a96133a1311 | 391 | Gyro.VibroFrqRegulF = 0; |
Kovalev_D | 112:4a96133a1311 | 392 | VibroFrqRegul(); |
Kovalev_D | 112:4a96133a1311 | 393 | } |
igor_v | 114:5cc38a53d8a7 | 394 | |
igor_v | 114:5cc38a53d8a7 | 395 | if(Gyro.VibroAMPRegulF == 1) //Регулеровка Амплитуды виброподвеса |
Kovalev_D | 112:4a96133a1311 | 396 | { |
Kovalev_D | 112:4a96133a1311 | 397 | Gyro.VibroAMPRegulF = 0; |
Kovalev_D | 112:4a96133a1311 | 398 | VibroAMPRegul(); |
Kovalev_D | 112:4a96133a1311 | 399 | } |
igor_v | 114:5cc38a53d8a7 | 400 | if(Gyro.VibroNoiseF == 1) //регулеровка ошумления, наверно нужно объеденить с регулеровкой ампитуды |
Kovalev_D | 112:4a96133a1311 | 401 | { |
Kovalev_D | 112:4a96133a1311 | 402 | Gyro.VibroNoiseF = 0; |
Kovalev_D | 112:4a96133a1311 | 403 | CalcAmpN(); |
Kovalev_D | 112:4a96133a1311 | 404 | } |
Kovalev_D | 113:8be429494918 | 405 | |
igor_v | 114:5cc38a53d8a7 | 406 | if(Gyro.VibroOutF== 1) // установка ног в регисторе тоже подумать , зачем отделный флаг? наверно |
Kovalev_D | 112:4a96133a1311 | 407 | { |
Kovalev_D | 112:4a96133a1311 | 408 | Gyro.VibroOutF = 0; |
Kovalev_D | 112:4a96133a1311 | 409 | VibroOut(); //Чтение ADS_SPI |
Kovalev_D | 112:4a96133a1311 | 410 | } |
Kovalev_D | 139:1716152517aa | 411 | |
Kovalev_D | 140:1fbf117fc120 | 412 | if( (Gyro.LogHZ == 1)&&(CountV31==0)) // установка ног в регисторе тоже подумать , зачем отделный флаг? наверно |
Kovalev_D | 139:1716152517aa | 413 | { |
Kovalev_D | 139:1716152517aa | 414 | |
Kovalev_D | 139:1716152517aa | 415 | // Gyro.Test_time1++; |
Kovalev_D | 139:1716152517aa | 416 | /* if(Gyro.Test_time1==4) |
Kovalev_D | 139:1716152517aa | 417 | {*/ |
Kovalev_D | 139:1716152517aa | 418 | sprintf((Time),"%d \r\n",LPC_TIM1->MR0); |
Kovalev_D | 139:1716152517aa | 419 | WriteCon(Time); |
Kovalev_D | 139:1716152517aa | 420 | // Gyro.Test_time++; |
Kovalev_D | 139:1716152517aa | 421 | /* Gyro.Test_time1=0; |
Kovalev_D | 139:1716152517aa | 422 | }*/ |
Kovalev_D | 139:1716152517aa | 423 | |
Kovalev_D | 139:1716152517aa | 424 | } |
Kovalev_D | 139:1716152517aa | 425 | //&Gyro.Firmware_Version |
Kovalev_D | 132:2c7bec5cf6fe | 426 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 427 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 428 | /////////////////////////Работа с Flash////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 429 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 430 | if(Gyro.FlashMod == 1) |
Kovalev_D | 132:2c7bec5cf6fe | 431 | { |
Kovalev_D | 132:2c7bec5cf6fe | 432 | |
Kovalev_D | 132:2c7bec5cf6fe | 433 | /* Prepare Sectors to be flashed */ |
Kovalev_D | 134:caf4c9cd5052 | 434 | NVIC_DisableIRQ(TIMER1_IRQn); |
Kovalev_D | 134:caf4c9cd5052 | 435 | NVIC_DisableIRQ(TIMER2_IRQn); |
Kovalev_D | 134:caf4c9cd5052 | 436 | NVIC_DisableIRQ(TIMER3_IRQn); |
Kovalev_D | 134:caf4c9cd5052 | 437 | NVIC_DisableIRQ(EINT3_IRQn); |
Kovalev_D | 134:caf4c9cd5052 | 438 | //SCB->VTOR = 0x00A000; |
Kovalev_D | 136:19b9e6abb86f | 439 | |
Kovalev_D | 135:c1e30e0e8949 | 440 | |
Kovalev_D | 135:c1e30e0e8949 | 441 | SystemInitDef(); |
Kovalev_D | 135:c1e30e0e8949 | 442 | vIAP_ReinvokeISP(); |
Kovalev_D | 136:19b9e6abb86f | 443 | } |
Kovalev_D | 133:90d0bf0e2996 | 444 | |
Kovalev_D | 132:2c7bec5cf6fe | 445 | |
Kovalev_D | 134:caf4c9cd5052 | 446 | if(Gyro.FlashMod == 2) |
Kovalev_D | 132:2c7bec5cf6fe | 447 | { |
Kovalev_D | 136:19b9e6abb86f | 448 | |
Kovalev_D | 136:19b9e6abb86f | 449 | NVIC_DisableIRQ(TIMER1_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 450 | NVIC_DisableIRQ(TIMER2_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 451 | NVIC_DisableIRQ(TIMER3_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 452 | NVIC_DisableIRQ(EINT3_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 453 | |
Kovalev_D | 136:19b9e6abb86f | 454 | SystemInitDef(); |
Kovalev_D | 136:19b9e6abb86f | 455 | |
Kovalev_D | 136:19b9e6abb86f | 456 | |
Kovalev_D | 136:19b9e6abb86f | 457 | |
Kovalev_D | 136:19b9e6abb86f | 458 | WriteCon("\r\n Start Prepare Sectors"); |
Kovalev_D | 136:19b9e6abb86f | 459 | if(u32IAP_PrepareSectors(18, 21) == IAP_STA_CMD_SUCCESS) |
Kovalev_D | 136:19b9e6abb86f | 460 | { |
Kovalev_D | 136:19b9e6abb86f | 461 | WriteCon("\r\nPrepare Sectors OK"); |
Kovalev_D | 136:19b9e6abb86f | 462 | WriteCon("\r\n Start Erase"); |
Kovalev_D | 136:19b9e6abb86f | 463 | |
Kovalev_D | 136:19b9e6abb86f | 464 | u32IAP_EraseSectors(IMG_START_SECTOR, IMG_END_SECTOR); |
Kovalev_D | 136:19b9e6abb86f | 465 | |
Kovalev_D | 136:19b9e6abb86f | 466 | WriteCon("\r\n AND Erase"); |
Kovalev_D | 136:19b9e6abb86f | 467 | } |
Kovalev_D | 136:19b9e6abb86f | 468 | else WriteCon("\r\nPrepare Sectors ERROR"); |
Kovalev_D | 136:19b9e6abb86f | 469 | SystemInit1(); |
Kovalev_D | 136:19b9e6abb86f | 470 | Gyro.FlashMod = 0; |
Kovalev_D | 136:19b9e6abb86f | 471 | //boot_jump(addres); |
Kovalev_D | 136:19b9e6abb86f | 472 | } |
Kovalev_D | 136:19b9e6abb86f | 473 | |
Kovalev_D | 136:19b9e6abb86f | 474 | |
Kovalev_D | 136:19b9e6abb86f | 475 | |
Kovalev_D | 136:19b9e6abb86f | 476 | |
Kovalev_D | 136:19b9e6abb86f | 477 | /* |
Kovalev_D | 136:19b9e6abb86f | 478 | #define IAP_STA_CMD_SUCCESS 0 |
Kovalev_D | 136:19b9e6abb86f | 479 | #define IAP_STA_INVALID_COMMAND 1 |
Kovalev_D | 136:19b9e6abb86f | 480 | #define IAP_STA_SRC_ADDR_ERROR 2 |
Kovalev_D | 136:19b9e6abb86f | 481 | #define IAP_STA_DST_ADDR_ERROR 3 |
Kovalev_D | 136:19b9e6abb86f | 482 | #define IAP_STA_SRC_ADDR_NOT_MAPPED 4 |
Kovalev_D | 136:19b9e6abb86f | 483 | #define IAP_STA_DST_ADDR_NOT_MAPPED 5 |
Kovalev_D | 136:19b9e6abb86f | 484 | #define IAP_STA_COUNT_ERROR 6 |
Kovalev_D | 136:19b9e6abb86f | 485 | #define IAP_STA_INVALID_SECTOR 7 |
Kovalev_D | 136:19b9e6abb86f | 486 | #define IAP_STA_SECTOR_NOT_BLANK 8 |
Kovalev_D | 136:19b9e6abb86f | 487 | #define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 9 |
Kovalev_D | 136:19b9e6abb86f | 488 | #define IAP_STA_COMPARE_ERROR 10 |
Kovalev_D | 136:19b9e6abb86f | 489 | #define IAP_STA_BUSY 11 |
Kovalev_D | 136:19b9e6abb86f | 490 | #define IAP_STA_INVALD_PARAM 12 |
Kovalev_D | 136:19b9e6abb86f | 491 | */ |
Kovalev_D | 136:19b9e6abb86f | 492 | |
Kovalev_D | 136:19b9e6abb86f | 493 | |
Kovalev_D | 136:19b9e6abb86f | 494 | |
Kovalev_D | 136:19b9e6abb86f | 495 | |
Kovalev_D | 136:19b9e6abb86f | 496 | |
Kovalev_D | 136:19b9e6abb86f | 497 | |
Kovalev_D | 136:19b9e6abb86f | 498 | |
Kovalev_D | 136:19b9e6abb86f | 499 | |
Kovalev_D | 136:19b9e6abb86f | 500 | |
Kovalev_D | 136:19b9e6abb86f | 501 | |
Kovalev_D | 136:19b9e6abb86f | 502 | |
Kovalev_D | 136:19b9e6abb86f | 503 | |
Kovalev_D | 136:19b9e6abb86f | 504 | |
Kovalev_D | 136:19b9e6abb86f | 505 | |
Kovalev_D | 136:19b9e6abb86f | 506 | |
Kovalev_D | 136:19b9e6abb86f | 507 | |
Kovalev_D | 136:19b9e6abb86f | 508 | |
Kovalev_D | 136:19b9e6abb86f | 509 | |
Kovalev_D | 136:19b9e6abb86f | 510 | |
Kovalev_D | 136:19b9e6abb86f | 511 | |
Kovalev_D | 136:19b9e6abb86f | 512 | if(Gyro.FlashMod == 3) |
Kovalev_D | 136:19b9e6abb86f | 513 | { |
Kovalev_D | 136:19b9e6abb86f | 514 | |
Kovalev_D | 136:19b9e6abb86f | 515 | ReadFlash(); |
Kovalev_D | 136:19b9e6abb86f | 516 | // SystemInitDef(); |
Kovalev_D | 136:19b9e6abb86f | 517 | // *status=(unsigned int*)addres; |
Kovalev_D | 136:19b9e6abb86f | 518 | /*NVIC_DisableIRQ(TIMER1_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 519 | NVIC_DisableIRQ(TIMER2_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 520 | NVIC_DisableIRQ(TIMER3_IRQn); |
Kovalev_D | 136:19b9e6abb86f | 521 | NVIC_DisableIRQ(EINT3_IRQn);*/ |
Kovalev_D | 136:19b9e6abb86f | 522 | Gyro.FlashMod = 0; |
Kovalev_D | 136:19b9e6abb86f | 523 | // memdump(addres,4); |
Kovalev_D | 136:19b9e6abb86f | 524 | // addres+=0x10; |
Kovalev_D | 136:19b9e6abb86f | 525 | // p = (unsigned int *)((unsigned int)base & ~(unsigned int)0x3); |
Kovalev_D | 136:19b9e6abb86f | 526 | // WriteCon(*addres); |
Kovalev_D | 136:19b9e6abb86f | 527 | // status=*addres; |
Kovalev_D | 136:19b9e6abb86f | 528 | // SystemInit1(); |
Kovalev_D | 136:19b9e6abb86f | 529 | // WriteCon(status); |
Kovalev_D | 136:19b9e6abb86f | 530 | // addres+=0x10; |
Kovalev_D | 136:19b9e6abb86f | 531 | |
Kovalev_D | 132:2c7bec5cf6fe | 532 | } |
Kovalev_D | 132:2c7bec5cf6fe | 533 | |
Kovalev_D | 132:2c7bec5cf6fe | 534 | |
Kovalev_D | 132:2c7bec5cf6fe | 535 | |
igor_v | 114:5cc38a53d8a7 | 536 | |
igor_v | 110:6406b7ac0442 | 537 | }//while |
Kovalev_D | 132:2c7bec5cf6fe | 538 | }//main |
igor_v | 0:8ad47e2b6f00 | 539 | |
igor_v | 0:8ad47e2b6f00 | 540 | /****************************************************************************** |
igor_v | 0:8ad47e2b6f00 | 541 | ** End Of File |
igor_v | 0:8ad47e2b6f00 | 542 | ******************************************************************************/ |
igor_v | 0:8ad47e2b6f00 | 543 | |
igor_v | 0:8ad47e2b6f00 | 544 |