?? printplan.lst
字號:
C51 COMPILER V7.50 PRINTPLAN 11/12/2007 21:03:44 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE PRINTPLAN
OBJECT MODULE PLACED IN E:\XLED\SOURCE\PRINTPLAN.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE E:\XLED\SOURCE\PRINTPLAN.C DB SB OE
line level source
1 #include "config.h"
2 #include "Bmp.h"
3 data struct PRINTLED PRINT_INFOR;
4 struct print_asm idata printasm _at_ 0x30; //匯編程序讀取其顯存地址
5 xdata uchar word; //這個用于向主調函數返回存儲器中是否有可顯示的內容
6 bit rell_print; //可以更新顯存標記
7 uchar NOW_ROW=0;
8 uchar T0H,T0L;
9 extern uchar comtimeout;
10 uchar data_load(struct windows xdata *pt) //new
11 {
12 1 uchar xdata *data ptr_s;
13 1 uchar code *ps;
14 1 uchar i,j;
15 1 CS_RAM=0;
16 1 if(word == 0xaa) return 0;
17 1 //初始化點陣數據庫
18 1 pt->plan_flash = 1; //FLASH中的總計幕數
19 1 pt->plan_point = 1; //指向FLASH中幕數的數值
20 1 pt->plan_size = 1; //當前緩沖的幕數
21 1 pt->plan = 0;
22 1 pt->movintype[0]=0x03;
23 1 pt->movsize[0] =5; //移動速度50ms
24 1 pt->showtime[0]=100; //
25 1 ptr_s = (uchar xdata *)&pt->printbuf[0][0];
26 1 ps=&bmp;
27 1 for(i=16;i!=0;i--)
28 1 {
29 2 for(j=LIEDIP/8;j!=0;j--)
30 2 {
31 3 *ptr_s++ =*ps++;
32 3 }
33 2 }
34 1 #ifndef ALONE
35 1 ps=&bmp1;
36 1 for(i=16;i!=0;i--)
37 1 {
38 2 for(j=LIEDIP/8;j!=0;j--)
39 2 {
40 3 *ptr_s++ = *ps++;
41 3 }
42 2 }
43 1 #endif
44 1 PRINT_INFOR.PRINTBUF2_R1 =(uchar xdata *)&pt->printbuf[0][0];
45 1 #ifndef ALONE
46 1 PRINT_INFOR.PRINTBUF2_R2 =(uchar xdata *)&pt->printbuf[0][16*20];
47 1 #endif
48 1 }
49 void windows_init(struct windows xdata *pt)
50 {
51 1 uchar xdata *data ps;
52 1 //關閉顯示屏
53 1 LAT = 0;
54 1 HIB = 1;
55 1 //初試化顯示參數
C51 COMPILER V7.50 PRINTPLAN 11/12/2007 21:03:44 PAGE 2
56 1 rell_print=0;
57 1 PRINT_INFOR.CHANG = 0; //允許外部交換的標志
58 1 PRINT_INFOR.COLOR = DEFINECOLOR;
59 1 PRINT_INFOR.SWAP = SWAP_PRINT2;
60 1 //初試化顯存
61 1 ps = (uchar xdata *)&pt->PRINT1_R;
62 1 while(ps != &pt->printbuf)
63 1 {
64 2 *ps++ = 0xff;
65 2 }
66 1 //讀取幕數據信息
67 1 data_load(pt);
68 1 //開啟顯示屏
69 1 HIB = 0;
70 1 T0H=0xB8; //10mS
71 1 T0L=0x00;
72 1 //初始化T0產生打印節拍
73 1 #ifdef ALONE
T0H=0xB8; //10mS
T0L=0x00;
#else
77 1 #if(OSC_FREQ == 40000000L)
T0H=0xBE; //5mS
T0L=0xE5;
#endif//#if(OSC_FREQ == 40000000L)
81 1
82 1 #ifdef STATIC
T0H=0xD4; //6mS
T0L=0xCC;
#endif//#ifdef STATIC
86 1 #endif //end ALONE
87 1 TH0=T0H;
88 1 TL0=T0L;
89 1 ET0=1; //T0中斷允許
90 1 TR0=1; //啟動T0
91 1 EA = 1;
92 1 }
93 void Print_U(uchar xdata *data ptr1_s)
94 {
95 1 uchar i,j;
96 1 NOW_ROW=0;
97 1 for(i=16;i!=0;i--)
98 1 {
99 2 CS_RAM=0;
100 2 LAT=0;
101 2 HIB=0;
102 2 for(j=LIEDIP/8;j!=0;j--)
103 2 {
104 3 SDA_R1=*ptr1_s;
105 3 ptr1_s++;
106 3 CLK=0;
107 3 CLK=1;
108 3 }
109 2 ACC=NOW_ROW;
110 2 ACC|=0xF0;
111 2 LAT=1;
112 2 P1= ACC;
113 2 NOW_ROW++;
114 2 LAT=0;
115 2 }
116 1 }
117 void Print_D(uchar xdata *data ptr1_s)
C51 COMPILER V7.50 PRINTPLAN 11/12/2007 21:03:44 PAGE 3
118 {
119 1 uchar i,j;
120 1 NOW_ROW=0;
121 1 for(i=16;i!=0;i--)
122 1 {
123 2 CS_RAM=0;
124 2 LAT=0;
125 2 HIB=0;
126 2 for(j=LIEDIP/8;j!=0;j--)
127 2 {
128 3 SDA_R2=*ptr1_s;
129 3 ptr1_s++;
130 3 CLK=0;
131 3 CLK=1;
132 3 }
133 2 ACC=NOW_ROW;
134 2 ACC|=0xF0;
135 2 LAT=1;
136 2 P1= ACC;
137 2 NOW_ROW++;
138 2 LAT=0;
139 2 }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -