?? wt2.lst
字號:
258 2 LightLed=0;TwingleLed=0x8;
259 2 PBYTE[CS3+1]=0x8;Delay10ms(20);PBYTE[CS3+1]=0;Delay10ms(20);
260 2 for(n=0;n<5;n++)
261 2 {
262 3 if(PBYTE[CS4]&0x82) n=0;
263 3 if(ng) break;
264 3 Delay10ms(1);
265 3 }
266 2 //方波測試
267 2 PIO1=PIO2=PIO3=PIO4=PIO5=PIO6=0;
268 2 Initial8255A();
269 2 for(n=0;n<3;n++)
270 2 {
271 3 while((PBYTE[CS4]&5)!=5&&ng==0) {PIO1&=~5;PBYTE[CS1]=PIO1;Delay10ms(1);}
272 3 Delay10ms(20);
273 3 PIO1|=1;PBYTE[CS1]=PIO1;
274 3 if((dd=PBYTE[CS4])&4)
275 3 {
276 4 ng=1;
277 4 break;
278 4 }
279 3 PIO1&=~5;PBYTE[CS1]=PIO1;
280 3 }
281 2 if(ng)
282 2 {
283 3 LightLed=0x40;TwingleLed=0;
284 3 continue;
285 3 }
286 2 for(n=0;n<3;n++)
287 2 {
288 3 while((PBYTE[CS4]&0x50)!=0x50&&ng==0) {PIO1&=~0x50;PBYTE[CS1]=PIO1;Delay10ms(1);}
289 3 Delay10ms(20);
290 3 PIO1|=0x40;PBYTE[CS1]=PIO1;
291 3 if(PBYTE[CS4]&0x10) {ng=1;break;}
292 3 PIO1&=~0x40;PBYTE[CS1]=PIO1;
293 3 }
294 2 if(ng)
295 2 {
296 3 LightLed=0x40;TwingleLed=0;
297 3 continue;
298 3 }
299 2 //USB test
300 2 LightLed=0;TwingleLed=0x4;
301 2 PBYTE[CS3+1]=0x8;Delay10ms(20);PBYTE[CS3+1]=0;Delay10ms(20);
302 2 for(n=0;n<5;n++)
303 2 {
C51 COMPILER V7.10 WT2 06/30/2006 09:43:59 PAGE 6
304 3 while((P1&0x3c)&&ng==0);
305 3 }
306 2 Delay10ms(20);
307 2
308 2 //1394 test
309 2 LightLed=0;TwingleLed=0x2;
310 2 PBYTE[CS3+1]=0x8;Delay10ms(20);PBYTE[CS3+1]=0;Delay10ms(20);
311 2 for(n=0;n<5;n++)
312 2 {
313 3 while((P2&0x3c)&&ng==0);
314 3 }
315 2
316 2 //LED test
317 2 LightLed&=0x0;TwingleLed=0x1;
318 2 PBYTE[CS3+1]=0x8;Delay10ms(20);PBYTE[CS3+1]=0;Delay10ms(20);
319 2 if(ln==0)
320 2 {
321 3 PIO2=0xe; //Set 3Color destroy
322 3 PIO1=PIO3=PIO4=PIO5=PIO6=0;
323 3 Initial8255A();
324 3 PBYTE[CS3+1]=0x7; //3.3V 5V 5Vaux on
325 3 ln=1;
326 3 }
327 2 while(ok==0&&ng==0);
328 2 }
329 1 }
330
331 void Initial(void)
332 {
333 1 P1=P2=P3=0xff;
334 1 // RECLED=1;
335 1 INPORT=P3;
336 1 TMOD=0X11;
337 1 TR0=1;
338 1 EX0=EX1=0;
339 1 ET0=1;
340 1 EA=1;
341 1 TL0=T10MS & 256;
342 1 TH0=T10MS/256;
343 1 }
344 void Initial8255(void)
345 {
346 1 PBYTE[CS1+3]=PMODE0&PAOUT&PBOUT&PCLOUT&PCHOUT;
347 1 PBYTE[CS2+3]=PMODE0&PAOUT&PBOUT&PCLOUT&PCHOUT;
348 1 PBYTE[CS3+3]=PMODE0&PAOUT&PBOUT&PCLOUT&PCHOUT;
349 1 PBYTE[CS4+3]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
350 1 PBYTE[CS5+3]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
351 1 PBYTE[CS6+3]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
352 1 Initial8255A();
353 1 }
354
355 void Initial8255A(void)
356 {
357 1 PBYTE[CS1+0]=PIO1;
358 1 PBYTE[CS1+1]=PIO2;
359 1 PBYTE[CS1+2]=PIO3;
360 1
361 1 PBYTE[CS2+0]=PIO4;
362 1 PBYTE[CS2+1]=PIO5;
363 1 PBYTE[CS2+2]=PIO6;
364 1
365 1 PBYTE[CS3+0]=LightLed;
C51 COMPILER V7.10 WT2 06/30/2006 09:43:59 PAGE 7
366 1 PBYTE[CS3+1]=0;
367 1 PBYTE[CS3+2]=0;
368 1
369 1 P1=0xff;
370 1 P2=0xff;
371 1 P3=0xff;
372 1
373 1 }
374
375 /*
376 void PowerOff (void) interrupt INT0INT
377 {
378 // StopPwrdn();
379 EA=0;
380 ET0=0;
381 P0=P1=P2=P3=0;
382 PCON|=0x2;
383 }*/
384 void Time10ms (void) interrupt TIMER0INT
385 {
386 1 #define LightLedA(a,b,c,d,e) {if(light) {(b)|=(c);PBYTE[a]=(b);lt=d;}else{(b)&=~(c);PBYTE[a]=(b);lt=e;}}
387 1 #define LightLedA2(a,b,c,d,e) {if(light) {(b)&=~(c);PBYTE[a]=(b);lt=d;}else{(b)|=(c);PBYTE[a]=(b);lt=e;}}
388 1 #define tt 30
389 1 // #define PNO 6
390 1 static char cn=tt;
391 1 static char InP1=0,InP2=0;
392 1 // char pp,p1;
393 1 char InP,InP3;
394 1 static bit light=0;
395 1 static char lt=0;
396 1 // kn=0;
397 1 // static char jn1,jn2;
398 1 // static char pn;
399 1 // static char un;
400 1 // static char jn;
401 1 // static bit hl=0;
402 1 // bit st;
403 1 TL0=T10MS & 256;
404 1 TH0=T10MS/256;
405 1
406 1
407 1 InP=INPORT^P3;
408 1 InP3=InP&InP2;
409 1 InP2=InP&InP1&(~InP3);
410 1 InP1=InP&(~InP3);
411 1 InP^=INPORT;
412 1 InP&=InP3;
413 1 INPORT&=~InP3;
414 1 INPORT|=InP;
415 1 if(!CN1)
416 1 ok=1;
417 1 if(!CN2) {ng=1;ok=0;}
418 1 if(ln)
419 1 {
420 2 if(lt<=0)
421 2 {
422 3 light=!light;
423 3 switch(ln)
424 3 {
425 4 case 1:
426 4 // if(!Jack1394Ok2) LightLedA(CS1+1,PIO2,0x80,50,1); //DLED_4
427 4 LightLedA(CS1+1,PIO2,0x80,50,1); //DLED_4
C51 COMPILER V7.10 WT2 06/30/2006 09:43:59 PAGE 8
428 4 break;
429 4 case 2:
430 4 // if(!UsbOk2) LightLedA(CS1+2,PIO3,0x80,50,1); //LAN_LED
431 4 LightLedA(CS1+2,PIO3,0x80,50,1); //LAN_LED
432 4 break;
433 4 case 3:
434 4 // if(!UsbOk2) LightLedA(CS1+2,PIO3,0x4,50,1); //DLED_3
435 4 LightLedA(CS1+2,PIO3,0x4,50,1); //DLED_3
436 4 break;
437 4 case 4:
438 4 // if(PBYTE[DP1B]&JACK1) {LightLedA(DP4C,PC4,0Xfd,5,8);} //DLED_2 twinkle
439 4 // if(!HP_JackOk3)
440 4 {LightLedA(CS1+2,PIO3,0X2,50,1);} //DLED_2 twinkle
441 4 break;
442 4 case 5:
443 4 // if(PBYTE[DP1B]&JACK2) {LightLedA(CS1+2,PIO3,1,50,1);} //HD_LED twinkle
444 4 {LightLedA(CS1+2,PIO3,1,50,1);} //HD_LED twinkle
445 4 break;
446 4 case 6:
447 4 // if(!PowerBtnOk2) LightLedA(CS1+1,PIO2,0x40,50,1); //DLED_1
448 4 LightLedA(CS1+1,PIO2,0x40,50,1); //DLED_1
449 4 break;
450 4 case 7:
451 4 LightLedA(CS1+2,PIO3,0x8,50,1); //PWR_LED1
452 4 break;
453 4 case 8:
454 4 LightLedA(CS1+2,PIO3,0x20,50,1); //PWR_LED2
455 4 break;
456 4 case 9:
457 4 if(!(PBYTE[CS4+1]&1))
458 4 {
459 5 LightLedA2(CS1+1,PIO2,0x2,100,1); //J1-10
460 5 }
461 4 else
462 4 {
463 5 PBYTE[CS1+1]=(PIO2|=0xe); //Destroy the LED
464 5 }
465 4 break;
466 4 case 10:
467 4 if(!(PBYTE[CS4+1]&1))
468 4 {
469 5 LightLedA2(CS1+1,PIO2,0x4,100,1); //J1-11
470 5 }
471 4 else
472 4 {
473 5 PBYTE[CS1+1]=(PIO2|=0xe); //Destroy the LED
474 5 }
475 4 break;
476 4 case 11:
477 4 if(!(PBYTE[CS4+1]&1))
478 4 {
479 5 LightLedA2(CS1+1,PIO2,0x8,100,1); //J1-12
480 5 }
481 4 else
482 4 {
483 5 PBYTE[CS1+1]=(PIO2|=0xe); //Destroy the LED
484 5 }
485 4 break;
486 4 default:lt=0;
487 4 }
488 3 if(!light) if(++ln>11) ln=1;
489 3 }
C51 COMPILER V7.10 WT2 06/30/2006 09:43:59 PAGE 9
490 2 }
491 1
492 1 if(lt) lt--;
493 1 if(td) td--;
494 1 if((--cn)==0)
495 1 {
496 2 cn=tt;
497 2 LightLed^=TwingleLed;
498 2 PBYTE[CS3]=LightLed;
499 2 }
500 1 }
501
502 void Delay10ms(unsigned int a)
503 {
504 1 td=a;
505 1 while(td);
506 1 }
507
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 2427 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 22 3
IDATA SIZE = ---- ----
BIT SIZE = 3 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -