?? wt1.lst
字號:
211 3 while(1);
212 3 }
213 2 }
214 1 }
215 /* //Static Initial
216 PowerBtnOk1=PowerBtnOk2=0;
217 Jack1Ok=Jack2Ok=0;
218 GpiLedOk=0;
219 UsbOk1=0;UsbOk2=0;
220 Jack1394Ok1=0;Jack1394Ok2=0;
221 HP_JackOk1=HP_JackOk2=HP_JackOk3=0;
222 MIC_JackOk1=MIC_JackOk2=MIC_JackOk3=0;
223 Led=0;
224
225 // PA1=0xfe;
226 // PA2=0xff;
227 // PBYTE[DP1A]=PA1;PBYTE[DP2A]=PA2;
228 #define ON5V (~0x4)
229 while(1)
230 {
231 if(!UsbOk1)
232 {
233 P2=~8;Delay10ms(20);
234 st=(P2==~8);
235 P2=~16;Delay10ms(20);
236 st=st&&(P2==~16);
237 P2=~32;Delay10ms(20);
238 st=st&&(P2==~32);
239 P2=~64;Delay10ms(20);
240 st=st&&(P2==~64);
241 P2=~128;Delay10ms(20);
C51 COMPILER V7.10 WT1 06/29/2006 11:04:28 PAGE 5
242 st=st&&(P2==0x7f);
243 P2=~2;Delay10ms(50);
244 st=st&&(P2==0xf9);
245 P2=~4;Delay10ms(50);
246 st=st&&(P2==0xf9);
247 UsbOk1=st;
248 P2=0xff;
249 }
250 if(!Jack1394Ok1)
251 {
252 P1=~1;Delay10ms(20);
253 st=(P1=~1,(P1|0xc0)==~1);
254 P1=~2;Delay10ms(20);
255 st&=(P1=~2,(P1|0xc0)==~2);
256 P1=~4;Delay10ms(20);
257 st&=(P1=~4,(P1|0xc0)==(~4));
258 P1=~8;Delay10ms(20);
259 st&=(P1=~8,(P1|0xc0)==(~8));
260 P1=~16;Delay10ms(20);
261 st&=(P1=~16,(P1|0xc0)==(~16));
262 P1=~32;Delay10ms(20);
263 st&=(P1=~32,(P1|0xc0)==(~32));
264 Jack1394Ok1=st;
265 P1=0xff;
266 }
267 if(!(PBYTE[DP1B]&0x80)) GpiLedOk=1;
268 // if(!(PBYTE[DP1B]&JACK1)) {LightLedH(DP4C,PC4,0Xfd);} //DLED_2 light
269 if(!(PBYTE[DP1B]&JACK2)) {LightLedH(DP4C,PC4,0xfe);} //HD_LED light
270 }*/
271 /* {
272 ln=0;
273 PBYTE[DP2A]=PA2;
274 PBYTE[DP4A]=PA4=0;
275 }*/
276 //shortcut test
277 /* PBYTE[DP2]=PBYTE[DP3]=PMODE0|PAIN|PBIN&PCLOUT&PCHOUT;
278 PBYTE[DP1C]=PBYTE[DP2C]=PBYTE[DP3C]=PBYTE[DP4C]=0xff;
279 PB1=PBYTE[DP1B];
280 PB2=PBYTE[DP2B];
281 PB3=PBYTE[DP3B];
282 PB4=PBYTE[DP4B];
283 PA2=PBYTE[DP2A];
284 PA3=PBYTE[DP3A];
285 for(b=1,i=0;i<8;i++,b<<=1)
286 {
287 PA1;
288 }
289
290 */
291 /* PBYTE[DP1]=PBYTE[DP2]=PBYTE[DP3]=PBYTE[DP4]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
292 PA1=PBYTE[DP1A];
293 PB1=PBYTE[DP1B];
294 PC1=PBYTE[DP1C];
295
296 PA2=PBYTE[DP2A];
297 PB2=PBYTE[DP2B];
298 PC2=PBYTE[DP2C];
299
300 PA3=PBYTE[DP3A];
301 PB3=PBYTE[DP3B];
302 PC3=PBYTE[DP3C];
303
C51 COMPILER V7.10 WT1 06/29/2006 11:04:28 PAGE 6
304 PA4=PBYTE[DP4A];
305 PB4=PBYTE[DP4B];
306 PC4=PBYTE[DP4C];*/
307
308
309
310
311 // PBYTE[DP4A]=0xa5;
312 // delay(20000);
313 // PBYTE[DP4A]=0x5a;
314 // delay(20000);
315
316 // PBYTE[DP1A]=0x7e;
317 // delay(5000);
318 // PBYTE[DP1A]=0x81;
319 // PBYTE[DP2B]=1;
320 // delay(5000);
321 // PBYTE[DP2B]=0;
322 // PBYTE[DP2B]=2;
323 // delay(5000);
324 // PBYTE[DP2B]=0;
325
326 void Initial(void)
327 {
328 1 P1=P2=P3=0xff;
329 1 // RECLED=1;
330 1 INPORT=P3;
331 1 TMOD=0X11;
332 1 TR0=1;
333 1 EX0=EX1=0;
334 1 ET0=1;
335 1 EA=1;
336 1 TL0=T10MS & 256;
337 1 TH0=T10MS/256;
338 1 }
339 void Initial8255(void)
340 {
341 1 PBYTE[CS1+3]=PMODE0&PAOUT&PBOUT&PCLOUT&PCHOUT;
342 1 PBYTE[CS2+3]=PMODE0&PAOUT&PBOUT&PCLOUT&PCHOUT;
343 1 PBYTE[CS3+3]=PMODE0&PAOUT&PBOUT&PCLOUT&PCHOUT;
344 1 PBYTE[CS4+3]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
345 1 PBYTE[CS5+3]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
346 1 PBYTE[CS6+3]=PMODE0|PAIN|PBIN|PCLIN|PCHIN;
347 1 Initial8255A();
348 1 }
349
350 void Initial8255A(void)
351 {
352 1 PBYTE[CS1+0]=PIO1;
353 1 PBYTE[CS1+1]=PIO2;
354 1 PBYTE[CS1+2]=PIO3;
355 1
356 1 PBYTE[CS2+0]=PIO4;
357 1 PBYTE[CS2+1]=PIO5;
358 1 PBYTE[CS2+2]=PIO6;
359 1
360 1 PBYTE[CS3+0]=0;
361 1 PBYTE[CS3+1]=0;
362 1 PBYTE[CS3+2]=0;
363 1
364 1 P1=0xff;
365 1 P2=0xff;
C51 COMPILER V7.10 WT1 06/29/2006 11:04:28 PAGE 7
366 1 P3=0xff;
367 1
368 1 }
369
370 /*
371 void PowerOff (void) interrupt INT0INT
372 {
373 // StopPwrdn();
374 EA=0;
375 ET0=0;
376 P0=P1=P2=P3=0;
377 PCON|=0x2;
378 }*/
379 void Time10ms (void) interrupt TIMER0INT
380 {
381 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;}}
382 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;}}
383 1 #define tt 10
384 1 #define PNO 6
385 1 static char cn=tt;
386 1 static char InP1=0,InP2=0;
387 1 char pp,p1;
388 1 char InP,InP3;
389 1 static bit light=0;
390 1 static char lt=0;
391 1 static char jn1,jn2;
392 1 static char pn;
393 1 static char un;
394 1 static char jn;
395 1 static bit hl=0;
396 1 bit st;
397 1 TL0=T10MS & 256;
398 1 TH0=T10MS/256;
399 1
400 1
401 1 InP=INPORT^P3;
402 1 InP3=InP&InP2;
403 1 InP2=InP&InP1&(~InP3);
404 1 InP1=InP&(~InP3);
405 1 InP^=INPORT;
406 1 InP&=InP3;
407 1 INPORT&=~InP3;
408 1 INPORT|=InP;
409 1 if(ln)
410 1 {
411 2 if(lt<=0)
412 2 {
413 3 light=!light;
414 3 switch(ln)
415 3 {
416 4 case 1:
417 4 if(!Jack1394Ok2) LightLedA(CS1+1,PIO2,0x80,50,1); //DLED_4
418 4 break;
419 4 case 2:
420 4 if(!UsbOk2) LightLedA(CS1+2,PIO3,0x80,50,1); //LAN_LED
421 4 break;
422 4 case 3:
423 4 if(!UsbOk2) LightLedA(CS1+2,PIO3,0x4,50,1); //DLED_3
424 4 break;
425 4 case 4:
426 4 // if(PBYTE[DP1B]&JACK1) {LightLedA(DP4C,PC4,0Xfd,5,8);} //DLED_2 twinkle
427 4 if(!HP_JackOk3)
C51 COMPILER V7.10 WT1 06/29/2006 11:04:28 PAGE 8
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -