![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
main.c@216:189b0ea1dc38, 2017-09-04 (annotated)
- Committer:
- Kovalev_D
- Date:
- Mon Sep 04 12:09:55 2017 +0000
- Revision:
- 216:189b0ea1dc38
- Parent:
- 215:b58b887fd367
plc_work
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 | 0:8ad47e2b6f00 | 15 | *********************************************************************************************************/ |
igor_v | 0:8ad47e2b6f00 | 16 | #include "Global.h" |
Kovalev_D | 215:b58b887fd367 | 17 | |
igor_v | 0:8ad47e2b6f00 | 18 | /****************************************************************************** |
igor_v | 0:8ad47e2b6f00 | 19 | ** Main Function main() |
igor_v | 0:8ad47e2b6f00 | 20 | ******************************************************************************/ |
Kovalev_D | 215:b58b887fd367 | 21 | |
Kovalev_D | 136:19b9e6abb86f | 22 | unsigned int addres; |
Kovalev_D | 134:caf4c9cd5052 | 23 | uint32_t Result[5]; |
igor_v | 0:8ad47e2b6f00 | 24 | extern uint32_t CMD_Mode; |
igor_v | 52:30f2e52a493f | 25 | unsigned int secPuls; |
igor_v | 52:30f2e52a493f | 26 | float DACF, K_DAC; |
Kovalev_D | 107:4d178bcc9d8a | 27 | int tempAMP; |
Kovalev_D | 208:19150d2b528f | 28 | int temp=1; |
Kovalev_D | 136:19b9e6abb86f | 29 | unsigned int status; |
Kovalev_D | 136:19b9e6abb86f | 30 | unsigned int Para; |
Kovalev_D | 214:4c70e452c491 | 31 | |
igor_v | 52:30f2e52a493f | 32 | int main (void) |
igor_v | 52:30f2e52a493f | 33 | { |
Kovalev_D | 196:f76dbc081e63 | 34 | SystemInit1(); // Инициализация контроллера: установка тактовых частот |
Kovalev_D | 196:f76dbc081e63 | 35 | SystemCoreClockUpdate1(); // расчет тактовой частоты процессора перед инициализацией UART - 103MHz |
Kovalev_D | 214:4c70e452c491 | 36 | InitMCPWM(); |
Kovalev_D | 205:775d54fdf646 | 37 | Param_init(); |
Kovalev_D | 196:f76dbc081e63 | 38 | GLD_Init(); |
Kovalev_D | 214:4c70e452c491 | 39 | |
Kovalev_D | 214:4c70e452c491 | 40 | /*if(Gyro.LG_Type==1) Gyro.RgConA = 0xff; |
Kovalev_D | 214:4c70e452c491 | 41 | else Gyro.RgConA = 0xfd; |
Kovalev_D | 214:4c70e452c491 | 42 | Gyro.RgConB = 0x4;*/ |
Kovalev_D | 214:4c70e452c491 | 43 | |
Kovalev_D | 208:19150d2b528f | 44 | BackLightOFF |
Kovalev_D | 208:19150d2b528f | 45 | LightUpOFF |
igor_v | 51:81f47b817071 | 46 | |
Kovalev_D | 196:f76dbc081e63 | 47 | UART_InitSet (0, 921600, 0x03); |
Kovalev_D | 196:f76dbc081e63 | 48 | UART_InitSet (1, 921600, 0x03); |
Kovalev_D | 205:775d54fdf646 | 49 | /* |
Kovalev_D | 205:775d54fdf646 | 50 | UART_InitSet (0, 115200, 0x03); |
Kovalev_D | 205:775d54fdf646 | 51 | UART_InitSet (1, 115200, 0x03); */ |
Kovalev_D | 197:7a05523bf588 | 52 | Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); |
Kovalev_D | 215:b58b887fd367 | 53 | for(int q=0; q<300; q++) |
Kovalev_D | 214:4c70e452c491 | 54 | { |
Kovalev_D | 214:4c70e452c491 | 55 | BuffADC_1Point[CountV255] =0; |
Kovalev_D | 214:4c70e452c491 | 56 | } |
Kovalev_D | 216:189b0ea1dc38 | 57 | |
Kovalev_D | 197:7a05523bf588 | 58 | while ( 1 ) { |
Kovalev_D | 215:b58b887fd367 | 59 | if(Time1Hz<5) |
Kovalev_D | 215:b58b887fd367 | 60 | { |
Kovalev_D | 215:b58b887fd367 | 61 | ADC_64Point=0; |
Kovalev_D | 215:b58b887fd367 | 62 | ADC_32PointD=0; |
Kovalev_D | 215:b58b887fd367 | 63 | for(int q=0; q<64; q++) |
Kovalev_D | 215:b58b887fd367 | 64 | { |
Kovalev_D | 216:189b0ea1dc38 | 65 | BuffADC_znak [q] = 0; |
Kovalev_D | 215:b58b887fd367 | 66 | BuffADC_64Point [q] = 0; |
Kovalev_D | 215:b58b887fd367 | 67 | Buff_Restored_Mod [q] = 0; |
Kovalev_D | 215:b58b887fd367 | 68 | } |
Kovalev_D | 216:189b0ea1dc38 | 69 | } |
Kovalev_D | 216:189b0ea1dc38 | 70 | Event_1250Hz(); |
Kovalev_D | 197:7a05523bf588 | 71 | Event_100KHz(); |
Kovalev_D | 209:224e7331a061 | 72 | Event_2KHz(); |
Kovalev_D | 197:7a05523bf588 | 73 | Event_1KHz(); |
Kovalev_D | 197:7a05523bf588 | 74 | Event_500Hz(); |
Kovalev_D | 209:224e7331a061 | 75 | Event_250Hz(); |
Kovalev_D | 197:7a05523bf588 | 76 | Event_1Hz(); |
Kovalev_D | 197:7a05523bf588 | 77 | Event_Vibro(); |
Kovalev_D | 214:4c70e452c491 | 78 | |
Kovalev_D | 197:7a05523bf588 | 79 | |
Kovalev_D | 196:f76dbc081e63 | 80 | G_Photo_Exchange(); |
Kovalev_D | 108:030cdde08314 | 81 | Concol (); // Проврка 0 консоли (вход и выход) |
Kovalev_D | 197:7a05523bf588 | 82 | Concol1 (); // Проврка 1 консоли (вход и выход) |
Kovalev_D | 196:f76dbc081e63 | 83 | Read_CMD(); |
igor_v | 3:ed8744c5f67a | 84 | if (OutBufConCount) OutBufConCount--; |
Kovalev_D | 108:030cdde08314 | 85 | if (OutBufCon1Count) OutBufCon1Count--; |
Kovalev_D | 147:1aed74f19a8f | 86 | TechLog();//технологическая выдача |
Kovalev_D | 211:ac8251b067d2 | 87 | |
Kovalev_D | 196:f76dbc081e63 | 88 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 196:f76dbc081e63 | 89 | ////////////////////////////////////выдача параметров через Rate//////////////////////////////////////////////////////////////// |
Kovalev_D | 196:f76dbc081e63 | 90 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 196:f76dbc081e63 | 91 | M_RateA(); |
Kovalev_D | 196:f76dbc081e63 | 92 | AllRegul(); |
Kovalev_D | 211:ac8251b067d2 | 93 | |
Kovalev_D | 132:2c7bec5cf6fe | 94 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 95 | /////////////////////////Работа с Flash////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 96 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 196:f76dbc081e63 | 97 | switch(Gyro.FlashMod) { |
Kovalev_D | 196:f76dbc081e63 | 98 | case 1: GoBoot(); break; |
Kovalev_D | 196:f76dbc081e63 | 99 | case 2: WriteFlash(); break; |
Kovalev_D | 196:f76dbc081e63 | 100 | case 3: ReadFlash(); break; |
Kovalev_D | 208:19150d2b528f | 101 | case 4: EraseFlash(); break; |
Kovalev_D | 208:19150d2b528f | 102 | } |
Kovalev_D | 208:19150d2b528f | 103 | |
Kovalev_D | 211:ac8251b067d2 | 104 | BackLightOFF |
Kovalev_D | 211:ac8251b067d2 | 105 | BackLightOFF |
Kovalev_D | 211:ac8251b067d2 | 106 | BackLightOFF |
Kovalev_D | 208:19150d2b528f | 107 | } |
Kovalev_D | 132:2c7bec5cf6fe | 108 | }//main |
igor_v | 0:8ad47e2b6f00 | 109 | |
igor_v | 0:8ad47e2b6f00 | 110 | /****************************************************************************** |
igor_v | 0:8ad47e2b6f00 | 111 | ** End Of File |
igor_v | 0:8ad47e2b6f00 | 112 | ******************************************************************************/ |
igor_v | 0:8ad47e2b6f00 | 113 | |
igor_v | 0:8ad47e2b6f00 | 114 |