📄 leddisp.lst
字号:
149 3 {
150 4 switch (BitCnt)
151 4 {
152 5 case 0: if (Dlink1) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
153 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
154 5
155 5 case 1: if (Dlink2) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
156 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
157 5
158 5 case 2: if (Dlink3) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
159 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
160 5
161 5 case 3: if (Dlink4) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
162 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
163 5
164 5 default: break;
165 5 }
166 4 }
167 3 else if ( !BFlash ) /*否则是位闪烁*/
168 3 {
169 4 switch (BitCnt)
170 4 {
171 5 case 0: if (Blink1) {LedPort = 0xff;}
172 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
173 5
174 5 case 1: if (Blink2) {LedPort = LedPort = 0xff;}
175 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
176 5
177 5 case 2: if (Blink3) {LedPort = LedPort = 0xff;}
178 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
179 5
C51 COMPILER V8.08 LEDDISP 10/02/2007 07:17:24 PAGE 4
180 5 case 3: if (Blink4) {LedPort = LedPort = 0xff;}
181 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
182 5
183 5 default: break;
184 5 }
185 4 }
186 3 else
187 3 {
188 4 LedPort = DispCode[dispbuf[BitCnt]];
189 4 }
190 3
191 3 break;
192 3
193 3 case 0x01:
194 3 if ( DFlash ) /*否则是点闪烁*/
195 3 {
196 4 switch (BitCnt)
197 4 {
198 5 case 0: if (Dlink1) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
199 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
200 5
201 5 case 1: if (Dlink2) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
202 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
203 5
204 5 case 2: if (Dlink3) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
205 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
206 5
207 5 case 3: if (Dlink4) {LedPort = DispCode[dispbuf[BitCnt]] & 0x7f;}
208 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
209 5
210 5 default: break;
211 5 }
212 4 }
213 3 else if ( BFlash ) /*否则是位闪烁*/
214 3 {
215 4 switch (BitCnt)
216 4 {
217 5 case 0: if (Blink1) {LedPort = 0xff;}
218 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
219 5
220 5 case 1: if (Blink2) {LedPort = LedPort = 0xff;}
221 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
222 5
223 5 case 2: if (Blink3) {LedPort = LedPort = 0xff;}
224 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
225 5
226 5 case 3: if (Blink4) {LedPort = LedPort = 0xff;}
227 5 else {LedPort = DispCode[dispbuf[BitCnt]];} break;
228 5
229 5 default: break;
230 5 }
231 4 }
232 3 else
233 3 {
234 4 LedPort = DispCode[dispbuf[BitCnt]];
235 4 }
236 3 break;
237 3
238 3 case 0x10: LedPort = DispCode[dispbuf[BitCnt]]; break;
239 3
240 3 default: break;
241 3 }
C51 COMPILER V8.08 LEDDISP 10/02/2007 07:17:24 PAGE 5
242 2
243 2 for (i=0; i<10; i++);
244 2 LedPort = 0xff; /*消隐*/
245 2 }
246 1 }
247
248
249
250 /*-----------------------------------------------------------------------*-
251 * 函数名称: FlashFreq()
252 * 参 数: XX
253 * 返 回: XX
254 * 函数功能: 控制闪烁频率(在定时中断中运行)
255 *
256 * 说 明:
257 *
258 * 当前版本: V1.0 * 取代版本:
259 * 作 者: wsl * 修 改:
260 * 版本信息: 2006-09-14 * 修改信息:
261 -*-----------------------------------------------------------------------*/
262 void FlashFreq(void)
263 {
264 1 static unsigned char ucFlashFreq = 0;
265 1 ucFlashFreq++;/*设每5mS中断一次*/
266 1 if (ucFlashFreq == 100)/*5ms *100*/
267 1 {
268 2 ucFlashFreq = 0;
269 2 if ( g_DFlashEn ) /*是否需要点闪烁*/
270 2 {
271 3 DFlash = ~DFlash;
272 3 }
273 2 else
274 2 {
275 3 DFlash = 0;
276 3 }
277 2
278 2 if ( g_BFlashEn ) /*是否需要点闪烁*/
279 2 {
280 3 BFlash = ~BFlash;
281 3 }
282 2 else
283 2 {
284 3 BFlash = 0;
285 3 }
286 2 }
287 1 }
288
289
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 438 ----
CONSTANT SIZE = 18 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 8 ----
IDATA SIZE = ---- ----
BIT SIZE = 5 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -