📄 interfacedef.lst
字号:
C51 COMPILER V8.02 INTERFACEDEF 09/05/2007 10:54:04 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE INTERFACEDEF
OBJECT MODULE PLACED IN interfacedef.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE interfacedef.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include "lcd.h"
2 #include "func.h"
3 #include "interface.h"
4 #include "key.h"
5 #include "getinputnum.h"
6 typedef unsigned int uint;
7 typedef unsigned char uchar;
8 typedef unsigned long ulong;
9
10 void DisplayStateDef(void)
11 {
12 1 char temp[10];
13 1 uchar len,j,i;
14 1 LcdClear();
15 1 SetPos(0,0);
16 1 LcdPrint("频率:",sizeof("频率:")-1);
17 1 len=ltoa(Wave[CurWaveType].Freq,temp);
18 1 if(Wave[CurWaveType].Freq>1000)
19 1 {
20 2 for(j=len;j>len-3;j--)
21 2 {
22 3 temp[j]=temp[j-1];
23 3 }
24 2 temp[len-3]='.';
25 2 LcdPrint(temp,len+1);
26 2 LcdPrint("KHz",3);
27 2 }
28 1 else
29 1 {
30 2 LcdPrint(temp,len);
31 2 LcdPrint("Hz",2);
32 2 }
33 1 /////////////////
34 1 SetPos(0,1);
35 1 LcdPrint("幅度:",sizeof("幅度:")-1);
36 1
37 1 Wave[CurWaveType].Peak=0;
38 1 for(i=0;i<4;i++)
39 1 {
40 2 Wave[CurWaveType].Peak+=Wave[i].Peak+HarPeak[i];
41 2 }
42 1 temp[3]=Wave[CurWaveType].Peak;
43 1 if(temp[3]<0){temp[3]*=-1;}
44 1 temp[0]=temp[3]/10;
45 1 temp[2]=temp[3]%10;
46 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
47 1 LcdPrint(temp,3);
48 1 LcdPrint("V",1);
49 1 SetPos(0,2);
50 1 LcdPrint("设定基波",sizeof("设定基波")-1);
51 1 SetPos(0,3);
52 1 LcdPrint("设定谐波",sizeof("设定谐波")-1);
53 1 }
54
55 void DisPlayBaseWave()
C51 COMPILER V8.02 INTERFACEDEF 09/05/2007 10:54:04 PAGE 2
56 {
57 1 char temp[10];
58 1 LcdClear();
59 1 SetPos(0,0);
60 1 LcdPrint("\xd5\xfd弦波:",sizeof("\xd5\xfd弦波:")-1);
61 1 temp[3]=Wave[0].Peak;
62 1 if(temp[3]<0)
63 1 {
64 2 LcdPrint("-",1);
65 2 temp[3]*=-1;
66 2 }
67 1 temp[0]=temp[3]/10;
68 1 temp[2]=temp[3]%10;
69 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
70 1 LcdPrint(temp,3);
71 1 LcdPrint("V",1);
72 1
73 1 SetPos(0,1);
74 1 LcdPrint("方波 : ",sizeof("方波 : ")-1);
75 1 temp[3]=Wave[1].Peak;
76 1 if(temp[3]<0)
77 1 {
78 2 LcdPrint("-",1);
79 2 temp[3]*=-1;
80 2 }
81 1 temp[0]=temp[3]/10;
82 1 temp[2]=temp[3]%10;
83 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
84 1 LcdPrint(temp,3);
85 1 LcdPrint("V",1);
86 1
87 1 SetPos(0,2);
88 1 LcdPrint("\xc8\xfd角波:",sizeof("\xc8\xfd角波:")-1);
89 1 temp[3]=Wave[2].Peak;
90 1 if(temp[3]<0)
91 1 {
92 2 LcdPrint("-",1);
93 2 temp[3]*=-1;
94 2 }
95 1 temp[0]=temp[3]/10;
96 1 temp[2]=temp[3]%10;
97 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
98 1 LcdPrint(temp,3);
99 1 LcdPrint("V",1);
100 1
101 1
102 1 SetPos(0,3);
103 1 LcdPrint("锯齿波:",sizeof("锯齿波:")-1);
104 1 temp[3]=Wave[3].Peak;
105 1 if(temp[3]<0)
106 1 {
107 2 LcdPrint("-",1);
108 2 temp[3]*=-1;
109 2 }
110 1 temp[0]=temp[3]/10;
111 1 temp[2]=temp[3]%10;
112 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
113 1 LcdPrint(temp,3);
114 1 LcdPrint("V",1);
115 1 }
116 void DisPlayHarWave()
117 {
C51 COMPILER V8.02 INTERFACEDEF 09/05/2007 10:54:04 PAGE 3
118 1 char temp[10];
119 1 LcdClear();
120 1 SetPos(0,0);
121 1 LcdPrint("一次谐波: ",sizeof("一次谐波: ")-1);
122 1 temp[3]=HarPeak[0];
123 1 if(temp[3]<0)
124 1 {
125 2 LcdPrint("-",1);
126 2 temp[3]*=-1;
127 2 }
128 1 temp[0]=temp[3]/10;
129 1 temp[2]=temp[3]%10;
130 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
131 1 LcdPrint(temp,3);
132 1 LcdPrint("V",1);
133 1
134 1 SetPos(0,1);
135 1 LcdPrint("二次谐波: ",sizeof("二次谐波: ")-1);
136 1 temp[3]=HarPeak[1];
137 1 if(temp[3]<0)
138 1 {
139 2 LcdPrint("-",1);
140 2 temp[3]*=-1;
141 2 }
142 1 temp[0]=temp[3]/10;
143 1 temp[2]=temp[3]%10;
144 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
145 1 LcdPrint(temp,3);
146 1 LcdPrint("V",1);
147 1
148 1
149 1 SetPos(0,2);
150 1 LcdPrint("\xc8\xfd次谐波: ",sizeof("\xc8\xfd次谐波: ")-1);
151 1 temp[3]=HarPeak[2];
152 1 if(temp[3]<0)
153 1 {
154 2 LcdPrint("-",1);
155 2 temp[3]*=-1;
156 2 }
157 1 temp[0]=temp[3]/10;
158 1 temp[2]=temp[3]%10;
159 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
160 1 LcdPrint(temp,3);
161 1 LcdPrint("V",1);
162 1
163 1 SetPos(0,3);
164 1 LcdPrint("四次谐波: ",sizeof("四次谐波: ")-1);
165 1 temp[3]=HarPeak[3];
166 1 if(temp[3]<0)
167 1 {
168 2 LcdPrint("-",1);
169 2 temp[3]*=-1;
170 2 }
171 1 temp[0]=temp[3]/10;
172 1 temp[2]=temp[3]%10;
173 1 temp[0]+=0x30;temp[2]+=0x30;temp[1]='.';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -