📄 venus.lst
字号:
186 2 }
187 1 }
188 main()
189 {
190 1 // unsigned char code TABLE01[9]={17,18,19,20,21,16,16,16,0xFF};//系统联机中...
191 1 unsigned char code TABLE02[6]={24,14,25,26,27,0xFF};//VENUS
192 1 unsigned char code TABLE03[5]={29,30,31,32,0xFF};//保护试验
193 1 unsigned char code TABLE04[5]={28,12,33,34,0xFF};//PC主控
194 1 unsigned char code TABLE05[5]={35,36,37,38,0xFF};//结果处理
195 1 unsigned char code TABLE06[5]={17,18,39,40,0xFF};//系统设置
196 1 unsigned int code MENU_ADD[4]={TABLE03,TABLE04,TABLE05,TABLE06};//菜单代码地址数组
197 1 unsigned int code MENU_DIS[4]={0x1e0,0x3c0,0x5a0,0x780};//菜单显示位置数组
198 1 unsigned char i,counter_old,counter_new;
199 1 sys_init();
200 1 lcd_init();
201 1 SetPCF8563(0x2,0); //设置秒
202 1 SetPCF8563(0x3,10); //设置分
203 1 SetPCF8563(0x4,9); //设置小时
204 1 SetPCF8563(0x5,1); //设置日
205 1 SetPCF8563(0x6,6); //设置星期
206 1 SetPCF8563(0x7,1); //设置月
207 1 SetPCF8563(0x8,05); //设置年
208 1 counter_new=0x0;
209 1 counter_old=0x0;
210 1 lcd_cls(lcd_page1);
211 1 lcd_cls(lcd_page2);
212 1 load_data(0,&TABLE02,0,&lcd_buf,6);
213 1 print_c16(0x8);
214 1 load_data(0,&TABLE03,0,&lcd_buf,5);
215 1 print_c16(MENU_DIS[0]);
216 1 load_data(0,&TABLE04,0,&lcd_buf,5);
217 1 print_c16(MENU_DIS[1]);
218 1 load_data(0,&TABLE05,0,&lcd_buf,5);
219 1 print_c16(MENU_DIS[2]);
220 1 load_data(0,&TABLE06,0,&lcd_buf,5);
221 1 print_c16(MENU_DIS[3]);
222 1 while (1)
223 1 {
224 2 load_data(0,MENU_ADD[counter_new],0,&lcd_buf,20);
*** WARNING C214 IN LINE 224 OF VENUS.C: 'Argument': conversion: non-pointer to pointer
225 2 fprint_c16(MENU_DIS[counter_new]);
226 2 counter_old=counter_new;
227 2 i=getchar();
228 2 if (i==UP) {counter_new--;}
229 2 if (i==DOWN) {counter_new++;}
230 2 if (i==ENTER)
231 2 {
232 3 switch (counter_new)
233 3 {
234 4 case 0:{ gzsd();}break;
235 4 case 1:{ bhsy();}break;
236 4 case 2:{ xtcssd();}break;
237 4 case 3:{ ;}break;
238 4 }
239 3 }
240 2 counter_new=counter_new&0x3;
C51 COMPILER V7.02b VENUS 01/18/2005 21:43:57 PAGE 5
241 2 load_data(0,MENU_ADD[counter_old],0,&lcd_buf,20);
*** WARNING C214 IN LINE 241 OF VENUS.C: 'Argument': conversion: non-pointer to pointer
242 2 print_c16(MENU_DIS[counter_old]);
243 2 }
244 1 }
245 lcd_busy()
246 {
247 1 while (Lcd_Code_Port!=0x3);
248 1 }
249 lcd_cls(unsigned char i)
250 {
251 1 unsigned int k;
252 1 lcd_busy();
253 1 Lcd_Data_Port=0x0;
254 1 lcd_busy();
255 1 Lcd_Data_Port=i;
256 1 lcd_busy();
257 1 Lcd_Code_Port=0x24; //SET ADDRESS POINTER
258 1 lcd_busy();
259 1 Lcd_Code_Port=0xB0;
260 1 for (k=0;k<0xF00;k++)
261 1 {
262 2 lcd_busy();
263 2 Lcd_Data_Port=0x0;
264 2 }
265 1 lcd_busy();
266 1 Lcd_Code_Port=0xB2;
267 1 }
268 lcd_init()
269 {
270 1 lcd_busy();
271 1 Lcd_Code_Port=0x81; //"XOR" MODE
272 1 lcd_cls(lcd_page1);
273 1 lcd_cls(lcd_page2);
274 1 lcd_busy();
275 1 Lcd_Code_Port=0x9C; //graphic
276 1 lcd_busy();
277 1 Lcd_Data_Port=0x0;
278 1 lcd_busy();
279 1 Lcd_Data_Port=0x0;
280 1 lcd_busy();
281 1 Lcd_Code_Port=0x42; //GRAPHIC HOME ADDRESS #0000H
282 1 lcd_busy();
283 1 Lcd_Data_Port=lcd_graphic_columns;
284 1 lcd_busy();
285 1 Lcd_Data_Port=0x0;
286 1 lcd_busy();
287 1 Lcd_Code_Port=0x43; //GRAPHIC AREA 30 COLUMNS
288 1 lcd_busy();
289 1 Lcd_Data_Port=0x0;
290 1 lcd_busy();
291 1 Lcd_Data_Port=0xF;
292 1 lcd_busy();
293 1 Lcd_Code_Port=0x40; //TEXT HOME ADDRESS #0F00H
294 1 lcd_busy();
295 1 Lcd_Data_Port=lcd_text_columns;
296 1 lcd_busy();
297 1 Lcd_Data_Port=0x0;
298 1 lcd_busy();
299 1 Lcd_Code_Port=0x41; //TEXT AREA 30 COLUMNS
300 1 }
301 sys_init()
C51 COMPILER V7.02b VENUS 01/18/2005 21:43:57 PAGE 6
302 {
303 1 unsigned int i;
304 1 Flash_Reg=0x00;
305 1 Ram_Reg=0x0;
306 1 Flash_Page=Flash_Reg;
307 1 Ram_Page=Ram_Reg;
308 1 Reset_Port=0x03; //设置LCD,USB复位,不能使FLASH复位
309 1 for (i=0x2000;i!=0;i--);
310 1 Reset_Port=0x5; //清除LCD,USB复位
311 1 //串口设备通道A初始化
312 1 com_reg[0]=0x13; //MR1A
313 1 com_reg[0]=0x07; //MR2A
314 1 com_reg[1]=0xcc; //CSRA
315 1 com_reg[2]=0x09; //CRA
316 1 com_reg[4]=0x60; //ACR
317 1 com_reg[5]=0x33; //IMR
318 1 //串口设备通道B初始化
319 1 com_reg[8]=0x13; //MR1B
320 1 com_reg[8]=0x07; //MR2B
321 1 com_reg[9]=0xcc; //CSRB
322 1 com_reg[10]=0x09; //CRB
323 1 combstatu=0;
324 1 //系统中断初始化
325 1 IT0=0; //边沿触发
326 1 IE0=0; //清外中断0标志
327 1 EX0=1; //开外中断0
328 1 EA=1; //开全局中断
329 1 }
330 print_c16(unsigned int lcd_ram_addr)
331 {
332 1 unsigned char i,j;
333 1 unsigned int k;
334 1 i=0;
335 1 while (lcd_buf[i]!=0xff)
336 1 {
337 2 if (lcd_buf[i]==0xfe) {lcd_ram_addr++;i++;}
338 2 k=32*lcd_buf[i]+(int)(&HZK16); //字模地址
339 2 load_data(hzk_page,k,0,font_data,32); //取字模数据
*** WARNING C214 IN LINE 339 OF VENUS.C: 'Argument': conversion: non-pointer to pointer
340 2 k=lcd_ram_addr;
341 2 lcd_ram_addr=lcd_ram_addr+2; //下一个汉字地址
342 2 j=0;
343 2 while (j<32)
344 2 {
345 3 lcd_busy();
346 3 Lcd_Data_Port=k%256; //地址低位
347 3 lcd_busy();
348 3 Lcd_Data_Port=k/256; //地址高位
349 3 lcd_busy();
350 3 Lcd_Code_Port=0x24; //SET ADDRESS POINTER
351 3 lcd_busy();
352 3 Lcd_Data_Port=font_data[j];
353 3 lcd_busy();
354 3 Lcd_Code_Port=0xc0;
355 3 j++;
356 3 lcd_busy();
357 3 Lcd_Data_Port=font_data[j];
358 3 lcd_busy();
359 3 Lcd_Code_Port=0xc0;
360 3 j++;
361 3 k=k+lcd_graphic_columns;
362 3 }
C51 COMPILER V7.02b VENUS 01/18/2005 21:43:57 PAGE 7
363 2 i++;
364 2 }
365 1 }
366 fprint_c16(unsigned int lcd_ram_addr) //反向显示16*16点阵汉字
367 {
368 1 unsigned char i,j;
369 1 unsigned int k;
370 1 i=0;
371 1 while (lcd_buf[i]!=0xff)
372 1 {
373 2 if (lcd_buf[i]==0xfe) {lcd_ram_addr++;i++;}
374 2 k=32*lcd_buf[i]+(&HZK16); //字模地址
*** WARNING C260 IN LINE 374 OF VENUS.C: '=': pointer truncation
375 2 load_data(hzk_page,k,0,&font_data,32); //取字模数据
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -