📄 main.lst
字号:
336 1 EA = 1;
337 1 }
338 #endif
339
340 #ifndef MARTIN_DVD_COMM_NOT_SUPPORT_INT
// DVD communication
void ISR_INT2(void) interrupt 2
{
#ifndef MARTIN_DVD_COMM_NOT_SUPPORT_INT
BYTE i, count;
#endif
#ifndef MARTIN_SYSTEM_ONLY_TVMODE
EA = 0;
if (SysMode!=PWR_DOWN_MODE) //needn't judge mode
#endif
{
while (mReadDvdClk())
{
if (mReadDvdCs())
{
goto _EINT2_EXIT;
}
}
for (i=0;i<(COMDVD_BYTE);i++)
C51 COMPILER V8.05a MAIN 07/03/2008 18:27:37 PAGE 7
{
DvdRxIndex = i;
DvdRxBuf[DvdRxIndex] = 0;
for (count=0x80;count>0;count>>=1)
{
// data out
if (DataOutValid)
{
if ( DataOut[DvdRxIndex]&count )
{
mSetDvdIr();
}
else
{
mClrDvdIr();
}
}
else
{
if (DvdRxIndex<=1)
{
mSetDvdIr();
}
else
{
mClrDvdIr();
}
}
while (!mReadDvdClk())
{
if (mReadDvdCs())
{
goto _EINT2_EXIT;
}
}
// data in
DvdRxBuf[DvdRxIndex] |= (mReadDvdDat() ? count : 0);
while (mReadDvdClk())
{
if (mReadDvdCs())
{
goto _EINT2_EXIT;
}
}
}
}
mClrDvdIr();
if (DvdChecksumOk())
{
for (count=1;count<DVD_STATUS_BYTE;count++)
{
ShadowDvdInfo[count-1] = DvdRxBuf[count];
}
#ifndef MARTIN_MCU_AND_DVD_PROTOCOL //martin 14May08
for (count=0;count<CAR_INFO_BYTE;count++)
{
if ((ShadowCarInfo[count]&0xf0)==0)
ShadowCarInfo[count] = DvdRxBuf[DVD_STATUS_BYTE+count];
}
#endif
}
_EINT2_EXIT:
C51 COMPILER V8.05a MAIN 07/03/2008 18:27:37 PAGE 8
if (DataOutValid>0)
{
--DataOutValid;
}
}
EA = 1;
}
#endif
436
437 #ifdef ENABLE_PRINTF //03Jul08
void UARTSwitch(void)large
{
if(fgEnUART)
{
printf("URAT is Off \n");
fgEnUART=0;
CS8955_PADMOD2=0xa0;
}
else
{
fgEnUART=1;
CS8955_PADMOD2=0x00;
printf("URAT is On \n");
}
}
#endif
454
455 #ifdef MARTIN_DVD_COMM_NOT_SUPPORT_INT
456 void McuDvdComm(void) large
457 {
458 1 BYTE i, count;
459 1
460 1 // EA = 0;
461 1 #ifndef MARTIN_SYSTEM_ONLY_TVMODE
if (SysMode!=PWR_DOWN_MODE) //needn't judge mode
#endif
464 1 if (!mReadDvdCs())
465 1 {
466 2
467 2 TVRaCurrDataOut();
468 2 bDataUpdateEn=0x01;
469 2 while (mReadDvdClk())
470 2 {
471 3 if (mReadDvdCs())
472 3 {
473 4 goto _EINT2_EXIT;
474 4 }
475 3 }
476 2 bTempIrKey=0xff;
477 2 for (i=0;i<(COMDVD_BYTE);i++)
478 2 {
479 3 #ifdef DEBUG_TXD_RXD
480 3 //DataOut[i]=i;
481 3 #endif
482 3 DvdRxIndex = i;
483 3 DvdRxBuf[DvdRxIndex] = 0;
484 3 for (count=0x80;count>0;count>>=1)
485 3 {
486 4 // data out
C51 COMPILER V8.05a MAIN 07/03/2008 18:27:37 PAGE 9
487 4 //04Jun08 if(DataOutValid)
488 4 {
489 5 if ( DataOut[DvdRxIndex]&count )
490 5 {
491 6 mSetDvdIr();
492 6 }
493 5 else
494 5 {
495 6 mClrDvdIr();
496 6 }
497 5 }
498 4 /* 04Jun08
499 4 else
500 4 {
501 4 if (DvdRxIndex<=1)
502 4 {
503 4 mSetDvdIr();
504 4 }
505 4 else
506 4 {
507 4 mClrDvdIr();
508 4 }
509 4 }
510 4 04Jun08 */
511 4 while (!mReadDvdClk())
512 4 {
513 5 if (mReadDvdCs())
514 5 {
515 6 goto _EINT2_EXIT;
516 6 }
517 5 }
518 4 // data in
519 4 DvdRxBuf[DvdRxIndex] |= (mReadDvdDat() ? count : 0);
520 4
521 4
522 4 // DvdRxBuf[DvdRxIndex] <<= 1;
523 4 // if (mReadDvdDat()) //Data input
524 4 // { DvdRxBuf[DvdRxIndex] |= 0x01; }
525 4 // else
526 4 // { DvdRxBuf[DvdRxIndex] &= 0xfe; }s
527 4 /*
528 4 if(i ==COMDVD_BYTE )
529 4 {
530 4 for (count=1;count<DVD_STATUS_BYTE;count++)
531 4 {
532 4 ShadowDvdInfo[count-1] = DvdRxBuf[count];
533 4 }
534 4 }
535 4 */
536 4 while (mReadDvdClk())
537 4 {
538 5 if (mReadDvdCs())
539 5 {
540 6 goto _EINT2_EXIT;
541 6 }
542 5 }
543 4 }
544 3 /*
545 3 if(DvdRxBuf[1] == 0x81)
546 3 {
547 3 DataOut[DvdRxIndex+1]=DvdRxBuf[DvdRxIndex] ;
548 3 // _bIRKey0=IR_SYSTEM;
C51 COMPILER V8.05a MAIN 07/03/2008 18:27:37 PAGE 10
549 3 // bTempIrKey=IR_SYSTEM;
550 3 // _bPlaypostKey=0x81;
551 3 //vTVTempSetSystem();
552 3 }
553 3 else DataOut[DvdRxIndex+1]=0x0f;
554 3 */
555 3 //if(i == (COMDVD_BYTE-1))
556 3
557 3 if(DvdChecksumOk())
558 3 {
559 4 for (count=1;count<COMDVD_BYTE;count++)
560 4 {
561 5 ShadowDvdInfo[count-1] = DvdRxBuf[count];
562 5 // if(DvdRxBuf[1] == 0x81)
563 5 // _bIRKey0=IR_SYSTEM;
564 5 }
565 4 }
566 3 else
567 3 {
568 4 ShadowDvdInfo[0]=0xff;
569 4 }
570 3 }
571 2
572 2
573 2 mClrDvdIr();
574 2 /*
575 2 // if (DvdChecksumOk())
576 2 {
577 2 for (count=1;count<COMDVD_BYTE;count++)
578 2 {
579 2 // ShadowDvdInfo[count-1] = DvdRxBuf[count];
580 2 }
581 2 if(DvdRxBuf[1] == 0x81)
582 2 {
583 2 // _bIRKey0=IR_SYSTEM;
584 2 // bTempIrKey=IR_SYSTEM;
585 2 // _bPlaypostKey=0x81;
586 2 }
587 2 #ifndef MARTIN_MCU_AND_DVD_PROTOCOL //martin 14May08
588 2 for (count=0;count<CAR_INFO_BYTE;count++)
589 2 {
590 2 if ((ShadowCarInfo[count]&0xf0)==0)
591 2 ShadowCarInfo[count] = DvdRxBuf[DVD_STATUS_BYTE+count];
592 2 }
593 2 #endif
594 2
595 2 }
596 2 */
597 2 bDataUpdateEn=0x00; //04jun08
598 2 _EINT2_EXIT:
599 2 bDataUpdateEn=0x00;
600 2 if (DataOutValid>0)
601 2 {
602 3 --DataOutValid;
603 3 }
604 2 }
605 1 // EA = 1;
606 1 }
607
608 #endif
609 //*****************************************************************************************
610 // Main Entrance
C51 COMPILER V8.05a MAIN 07/03/2008 18:27:37 PAGE 11
611 //*****************************************************************************************
612 void main(void)
613 {
614 1
615 1 CS8955_SEL = 0x80; // ALE disable
616 1 // CS8955_OPTION = 0x01;
617 1 EA = 0; //enable all interrupt
618 1 vInitCPU(ON);
619 1 #ifndef MARTIN_SYSTEM_ONLY_TVMODE //martin 08Mary08
vInitSysPwr(OFF);
#endif
622 1
623 1 #ifdef MARTIN_SYSTEM_ONLY_TVMODE //martin 08Mary08
624 1 vInitSys(); //martin 12May08
625 1 #endif
626 1
627 1 TR0=1; // start timer0--------system clock
628 1 #ifndef MARTIN_MCU_NO_IR //disable IR martin 08May08
EX0 = 1; // enable int0-------- ir
#endif
631 1 EA = 1; //enable all interrupt
632 1
633 1 while(1)
634 1 {
635 2 #ifdef MARTIN_DVD_COMM_NOT_SUPPORT_INT
636 2 // TVRaCurrDataOut(); //17Jun08
637 2
638 2 McuDvdComm();
639 2 bDataUpdateEn=0x00;
640 2 // ShadowDvdInfo[0] = 0x83; //02Jun08 test
641 2 // ShadowDvdInfo[5] = 0x02; //02Jun08 test
642 2 #endif
643 2 // TV search state
644 2 if (_bSearchState>0)
645 2 {
646 3 #ifndef MARTIN_SYSTEM_ONLY_TVMODE //martin 12May08
if (SysMode==TV_MODE)
#endif
649 3 vTVSearch(_fgSearchDir);
650 3 }
651 2
652 2 // tasks
653 2 if (bTimer20ms)
654 2 {
655 3 TaskProc();
656 3 if (_bRemoteTimer>0)
657 3 --_bRemoteTimer;
658 3 bTimer20ms = 0;
659 3 //IICSW_WriteTest(); //martin28May08 test
660 3 }
661 2
662 2
663 2
664 2 }
665 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 640 ----
CONSTANT SIZE = 64 ----
XDATA SIZE = 96 2
PDATA SIZE = ---- ----
C51 COMPILER V8.05a MAIN 07/03/2008 18:27:37 PAGE 12
DATA SIZE = ---- ----
IDATA SIZE = 35 ----
BIT SIZE = 13 2
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -