📄 main.lst
字号:
C51 COMPILER V8.01 MAIN 01/09/2009 17:53:57 PAGE 1
C51 COMPILER V8.01, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE main.c OPTIMIZE(0,SPEED) BROWSE DEBUG OBJECTEXTEND
line level source
1 /*---------------------------------
2 记住调整ID时键盘发的码和PELCO有点相同,程序要加识别处理的
3
4 -----------------------------------*/
5 /*-----------------------------------------------
6
7 明景的键盘PELCO-P球机ID为实际球机ID少1,程序要进行处理
8 PELCO-D上下两代码颠倒了,UP为000 DOWN 为00108 与公布的相反
9 ------------------------------------------------*/
10 #include <general.h> //定义外部的函数
11 volatile unsigned char idata programFlyOff;
12 volatile unsigned char flagTxd;
13 volatile unsigned int comTxd;
14 volatile unsigned char countTxd;
15 unsigned char idata sKeyCode[5]={""}; //目前只用一组来表示,并且为0值 接收键盘码用
16 volatile unsigned char idata cKeyCodeReceiveState; //初值处于无串口码接收到状态有值用1表示
17 volatile unsigned char idata cKeyCodeReceive;
18 volatile unsigned char idata *pKeyCode;
19 volatile unsigned char cameraType;
20
21 unsigned char code SONYCLEAR[]={0x88,1,0,1,0xff};
22 unsigned char code SONYADDRSET[]={0x88,0x30,1,0xff};
23 unsigned char code SONYPOWERON[]={0x81,1,4,0,2,0xff};
24 unsigned char code SONYPOWEROFF[]={0x81,1,4,0,3,0xff};
25 unsigned char code SONYZOOMTELE[]={0x81,1,4,7,25,0xff};
26 unsigned char code SONYZOOMWIDE[]={0x81,1,4,7,35,0xff};
27 unsigned char code SONYZOOMSTOP[]={0x81,1,4,7,0,0xff};
28 unsigned char code SONYFOCUSFAR[]={0x81,1,4,8,25,0xff};
29 unsigned char code SONYFOCUSNEAR[]={0x81,1,4,8,35,0xff};
30 unsigned char code SONYFOCUSSTOP[]={0x81,1,4,8,0,0xff};
31 unsigned char code SONYIRISRESET[]={0x81,1,4,0xb,0,0xff};
32 unsigned char code SONYIRISUP[]={0x81,1,4,0xb,2,0xff};
33 unsigned char code SONYIRISDOUWN[]={0x81,1,4,0xb,3,0xff};
34 unsigned char code SONYPICTUREFLIPON[]={0x81,1,4,0x66,2,0xff};
35 unsigned char code SONYPICTUREFLIPOFF[]={0x81,1,4,0x66,3,0xff};
36 unsigned long code SIN16[]={0x43ffe,0x4307e,0x4207e,0x4707e,
37 0x47ffe,0x47fc0,0x45f80,0x45fc0,0x45ffe,0x4507e,0x4007e,
38 0x4107e,0x41ffe,0x41fc0,0x41f80,0x43fc0} ;
39 unsigned long code SIN16_[]={0x43ffe,0x43fc0,0x41f80, 0x41fc0,
40 0x41ffe,0x4107e, 0x4007e,0x4507e,0x45ffe, 0x45fc0,0x45f80,
41 0x47fc0 ,0x47ffe, 0x4707e,0x4207e,0x4307e } ;
42 unsigned long code SIN4[]={0x043ffe,0x047ffe,0x045ffe,0x041ffe};
43 unsigned int code DECTABLE[]={-4400,-4500,-4700,-4800,
44 -4900,-5000,-6000,-7000,
45 -8000,-9000,-10000,-20000,
46 -30000,-40000,-50000,-60000};
47 unsigned int code ACCTABLE[]={-60000,-50000,-40000,-30000,
48 -20000,-10000,-9000,-8000,
49 -7000,-6000,-5000,-4900,
50 -4800,-4700,-4500,-4400};
51
52 volatile unsigned char vOrientFlag;
53 volatile unsigned char vStopFlag;
54 volatile unsigned int vAbsolutionPosition;
55 volatile unsigned int vPresetPosition1 ;
C51 COMPILER V8.01 MAIN 01/09/2009 17:53:57 PAGE 2
56 volatile unsigned int vPresetPosition2 ;
57 volatile unsigned int vPresetPosition ;
58 volatile unsigned int vAbsolutionPosition;
59 volatile unsigned char vRotationManner;
60 volatile unsigned char vaccDecFlag;
61 volatile unsigned int vPauseTime;
62 volatile unsigned int xdata VMulPoint[]={0,200,400,600,800};
63 volatile unsigned char xdata vMulPointCount;
64 volatile unsigned char vSoftTimer0;
65
66
67 volatile unsigned char hOrientFlag;
68 volatile unsigned char hStopFlag;
69 volatile unsigned int hAbsolutionPosition;
70 volatile unsigned int hPresetPosition1 ;
71 volatile unsigned int hPresetPosition2 ;
72 volatile unsigned int hPresetPosition ;
73 volatile unsigned char hRotationManner;
74 volatile unsigned char haccDecFlag;
75 volatile unsigned int hPauseTime;
76 volatile unsigned int xdata HMulPoint[]={0,200,400,600,800};
77 volatile unsigned char xdata hMulPointCount;
78 // volatile unsigned char hPointMotionFlag;
79 /*
80 void GeneralHRotation(char v)
81 {
82 hRotationManner=GENERALROTATION;
83 hOrientFlag=(v>=0)?1:-1;
84 v=(v>=0)?-v:v;
85 v=10*v; //作速度变换
86 RCAP2L=(unsigned char)v;
87 RCAP2H=(unsigned char)(v>>8);
88 }
89 void GeneralVRotation(char v)
90 {
91 vRotationManner=GENERALROTATION;
92 vOrientFlag=(v>=0)?1:-1;
93 v=(v>=0)?v:-v;
94 vConst= 10*v ; //因T0时间基数太小要在中断里作一个软计时处理
95 }
96 void PresetHRotation(char dot)
97 { //返绝对坐标
98 hRotationManner=PRESETROTATION;
99 RCAP2L=(unsigned char)100; //以最快速度运行
100 RCAP2H=(unsigned char)(100>>8);
101 }
102 void PresetVRotation(char dot)
103 { //返绝对坐标
104 vRotationManner=PRESETROTATION;
105 vConst= 10*10 ; //因T0时间基数太小要在中断里作一个软计时处理
106 }
107 void RoutinHRotation(char v)
108 {
109 hRotationManner=ROUTINROTATION;
110
111 RCAP2L=(unsigned char)v;
112 RCAP2H=(unsigned char)(v>>8);
113 }
114 void RoutinVRotation(char v)
115 {
116 vRotationManner=ROUTINROTATION;
117
C51 COMPILER V8.01 MAIN 01/09/2009 17:53:57 PAGE 3
118 vConst= 10*10 ;
119 }
120 void HStop(void)
121 {
122 hRotationManner=STOPROTATION;
123 }
124 void VStop(void)
125 {
126 vRotationManner=STOPROTATION;
127 }
128 */
129 void main()
130 {
131 1
132 1 volatile unsigned int x;
133 1 volatile unsigned char count,y;
134 1 ERRor:
135 1 WdtCls();
136 1 GlobalSet();
137 1 IntDisable();
138 1 T0Stop();
139 1 T1Stop();
140 1 T2Stop();
141 1 TimerSet();
142 1 SciSet();
143 1 flagTxd=0xee; //初始化发送器状态变量
144 1 countTxd=0;
145 1
146 1 /*
147 1 P0_1=P0_2=P0_0=0;
148 1 while(1)
149 1 WdtCls();
150 1 */
151 1
152 1 CharOut(VIDEORAMCLS);
153 1 WdtCls();
154 1 CharOut(DISPCONTROL+DISPON+BLINKOFF);
155 1 //CharOut(0x22);
156 1 WdtCls();
157 1 CharOut(BACKGROUNDCONTROL+BACKGROUNDno);
158 1 WdtCls();
159 1 CharOut(EXTERNALVIDEO);
160 1 WdtCls();
161 1 CharOut(PAL);
162 1 WdtCls();
163 1 CharOut(ORIGIN+(0ORIGINPROW)+1);
164 1 WdtCls();
165 1 CharOut(POSITION+(0POSITIONy)+1);
166 1 WdtCls();
167 1 CharOut(OUT1VPP);
168 1 WdtCls();
169 1 for(x=0;x<0xc;x++)
170 1 {
171 2 CharOut(CHARACTERSIZE+CHARACTERSIZE0+x);
172 2 }
173 1 WdtCls();
174 1 BeginCharOut();
175 1 for(x=0;x<0x7f;x++)
176 1 {
177 2 SecCharOut(x);
178 2 WdtCls();
179 2 }
C51 COMPILER V8.01 MAIN 01/09/2009 17:53:57 PAGE 4
180 1 EndCharOut();
181 1 //CharOut(DISPCONTROL+DISPOFF+BLINKOFF);
182 1 while(1)
183 1 WdtCls();
184 1 /*
185 1 IntSet();
186 1 IntEnable();
187 1 TxdBaud9600();
188 1 T1Start();
189 1 SBUF=9;
190 1 Delay();
191 1 Delay();
192 1 Delay();
193 1 SBUF=9;
194 1 while(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -