123
Fork of LG by
main.c@195:bcc769f5292b, 2016-09-20 (annotated)
- Committer:
- Kovalev_D
- Date:
- Tue Sep 20 10:39:30 2016 +0000
- Revision:
- 195:bcc769f5292b
- Parent:
- 193:a0fe8bfc97e4
- Child:
- 196:f76dbc081e63
PLC_TERMO
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 7: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" |
Diletant | 74:f4d9c3403578 | 17 | #include "Device.h" |
igor_v | 0:8ad47e2b6f00 | 18 | /****************************************************************************** |
igor_v | 0:8ad47e2b6f00 | 19 | ** Main Function main() |
igor_v | 0:8ad47e2b6f00 | 20 | ******************************************************************************/ |
Diletant | 137:14a0c452cf32 | 21 | extern Device device; //Single global for all device hardware-independent algorithm |
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 | 139:1716152517aa | 28 | int temp; |
Kovalev_D | 136:19b9e6abb86f | 29 | unsigned int status; |
Kovalev_D | 136:19b9e6abb86f | 30 | unsigned int Para; |
igor_v | 52:30f2e52a493f | 31 | int main (void) |
igor_v | 52:30f2e52a493f | 32 | { |
Kovalev_D | 136:19b9e6abb86f | 33 | SystemInit1(); // Инициализация контроллера: установка тактовых частот |
Kovalev_D | 150:29c9f7671bac | 34 | SystemCoreClockUpdate1(); // расчет тактовой частоты процессора перед инициализацией UART - 103MHz |
Kovalev_D | 147:1aed74f19a8f | 35 | GLD_Init(); |
Kovalev_D | 188:4c523cc373cc | 36 | BackLightOFF |
Kovalev_D | 188:4c523cc373cc | 37 | LightUpOFF |
Kovalev_D | 188:4c523cc373cc | 38 | //UART_InitSet (0, 115200, 0x03); |
Kovalev_D | 184:ebcd2bc3be8f | 39 | UART_InitSet (0, 921600, 0x03); |
Kovalev_D | 188:4c523cc373cc | 40 | //UART_InitSet (1, 115200, 0x03); |
Kovalev_D | 188:4c523cc373cc | 41 | UART_InitSet (1, 921600, 0x03); |
igor_v | 51:81f47b817071 | 42 | |
Kovalev_D | 190:289514f730ee | 43 | Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); |
Kovalev_D | 190:289514f730ee | 44 | // WriteCon1("\n\r 123456789...GL start programm uart ACK.... "); |
Kovalev_D | 190:289514f730ee | 45 | // WriteCon("\n\r ...GL start programm uart Tech.... "); |
Kovalev_D | 190:289514f730ee | 46 | //sprintf(Time,"\r\nCompiled: %s %s.",__DATE__, __TIME__ ); //Подготовка даты и времени компиляции |
Kovalev_D | 190:289514f730ee | 47 | // WriteCon(Time); |
Kovalev_D | 191:40028201ddad | 48 | |
Kovalev_D | 185:7e200f4d9b16 | 49 | |
Kovalev_D | 150:29c9f7671bac | 50 | |
Kovalev_D | 150:29c9f7671bac | 51 | while ( 1 ){ //основной цикл. |
Kovalev_D | 195:bcc769f5292b | 52 | //BackLightON |
Kovalev_D | 147:1aed74f19a8f | 53 | G_Photo_Exchange(); |
Kovalev_D | 108:030cdde08314 | 54 | Concol (); // Проврка 0 консоли (вход и выход) |
Kovalev_D | 93:b3803774f110 | 55 | Concol1 (); // Проврка 0 консоли (вход и выход) |
Kovalev_D | 99:3d8f206ceac2 | 56 | Read_CMD(); |
igor_v | 3:ed8744c5f67a | 57 | if (OutBufConCount) OutBufConCount--; |
Kovalev_D | 108:030cdde08314 | 58 | if (OutBufCon1Count) OutBufCon1Count--; |
Kovalev_D | 104:ab1cb4ff56b2 | 59 | |
Kovalev_D | 147:1aed74f19a8f | 60 | TechLog();//технологическая выдача |
Kovalev_D | 136:19b9e6abb86f | 61 | |
Kovalev_D | 116:66f1f0ff2dab | 62 | Event_100KHz(); |
Kovalev_D | 88:b5c1d9d338d1 | 63 | Event_1KHz(); |
Kovalev_D | 124:9ae09249f842 | 64 | Event_500Hz(); |
Kovalev_D | 116:66f1f0ff2dab | 65 | Event_1Hz(); |
Kovalev_D | 88:b5c1d9d338d1 | 66 | Event_Vibro(); |
Kovalev_D | 193:a0fe8bfc97e4 | 67 | if(Gyro.QEIznak1) {/*событие перехода востановленного синуса от - к +*/} |
Kovalev_D | 193:a0fe8bfc97e4 | 68 | |
Kovalev_D | 193:a0fe8bfc97e4 | 69 | if(Gyro.DeltaEXT_Event){Gyro.DeltaEXT_Event=0;} |
Kovalev_D | 193:a0fe8bfc97e4 | 70 | /*else LoopOff*/ |
Kovalev_D | 150:29c9f7671bac | 71 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 150:29c9f7671bac | 72 | ////////////////////////////////////выдача параметров через Rate//////////////////////////////////////////////////////////////// |
Kovalev_D | 150:29c9f7671bac | 73 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 191:40028201ddad | 74 | M_RateA(); |
Kovalev_D | 191:40028201ddad | 75 | AllRegul(); |
Kovalev_D | 150:29c9f7671bac | 76 | |
Kovalev_D | 150:29c9f7671bac | 77 | |
Kovalev_D | 193:a0fe8bfc97e4 | 78 | |
Kovalev_D | 189:8a16378724c4 | 79 | |
Kovalev_D | 132:2c7bec5cf6fe | 80 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 81 | /////////////////////////Работа с Flash////////////////////////////////////////////////////////////////// |
Kovalev_D | 132:2c7bec5cf6fe | 82 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 147:1aed74f19a8f | 83 | if(Gyro.FlashMod == 1) {GoBoot(); } |
Kovalev_D | 147:1aed74f19a8f | 84 | if(Gyro.FlashMod == 2) {WriteFlash(); } |
Kovalev_D | 147:1aed74f19a8f | 85 | if(Gyro.FlashMod == 3) {ReadFlash(); } |
Kovalev_D | 195:bcc769f5292b | 86 | //BackLightOFF |
Kovalev_D | 147:1aed74f19a8f | 87 | } |
Kovalev_D | 132:2c7bec5cf6fe | 88 | }//main |
igor_v | 0:8ad47e2b6f00 | 89 | |
igor_v | 0:8ad47e2b6f00 | 90 | /****************************************************************************** |
igor_v | 0:8ad47e2b6f00 | 91 | ** End Of File |
igor_v | 0:8ad47e2b6f00 | 92 | ******************************************************************************/ |
igor_v | 0:8ad47e2b6f00 | 93 | |
igor_v | 0:8ad47e2b6f00 | 94 |