📄 monitor.lst
字号:
563 2 MonIncDecI2C(0);
564 2 break;
565 2
566 2 case '<':
567 2 if( incnt ) {
568 3 Mon_tx(ch);
569 3 monstr[incnt++] = ch;
570 3 }
571 2 else
572 2 MonIncDecI2C(10);
573 2 break;
574 2 //--- increamental write
575 2 case '.':
576 2 if( incnt ) {
577 3 Mon_tx(ch);
578 3 monstr[incnt++] = ch;
579 3 }
580 2 else
581 2 MonIncDecI2C(1);
582 2 break;
583 2
584 2 case '>':
585 2 if( incnt ) {
586 3 Mon_tx(ch);
587 3 monstr[incnt++] = ch;
588 3 }
589 2 else
590 2 MonIncDecI2C(11);
591 2 break;
592 2
593 2 default:
594 2 Mon_tx(ch);
595 2 monstr[incnt++] = ch;
596 2 break;
597 2 }
598 1
599 1 if( ret ) {
600 2 comment = 0;
601 2 last_argc = argc;
602 2 return ret;
603 2 }
604 1 else {
605 2 return ret;
606 2 }
607 1 }
608
609 //*****************************************************************************
610 // Monitoring Command
611 //*****************************************************************************
612
C51 COMPILER V7.50 MONITOR 04/01/2008 15:02:20 PAGE 11
613 void Monitor(void)
614 {
615 1 if( !MonGetCommand() ) return;
616 1
617 1 //--------------------------------------------------
618 1 // Check Indirect command
619 1 /*
620 1 if( !stricmp( argv[0], "I" ) ) indirect=1;
621 1 else if( !stricmp( argv[0], "O" ) ) indirect=1;
622 1
623 1 else if( !stricmp( argv[0], "," ) ) indirect=0;
624 1 else if( !stricmp( argv[0], ">" ) ) indirect=0;
625 1 else if( !stricmp( argv[0], "<" ) ) indirect=0;
626 1 else if( !stricmp( argv[0], "." ) ) indirect=0;
627 1 else indirect=0;
628 1 */
629 1 indirect = 0;
630 1
631 1 //---------------- Write Register -------------------
632 1 if( !stricmp( argv[0], "W" ) ) {
633 2 MonWriteI2C();
634 2 }
635 1 else if( !stricmp( argv[0], ")" ) ) {
636 2 indirect=0;
637 2 MonNewWriteI2C();
638 2 }
639 1 /*
640 1 else if( !stricmp( argv[0], "O" ) ) { // inderect addressing for 8806
641 1 MonIndex = Asc2Bin( argv[1] );
642 1 MonWdata = Asc2Bin( argv[2] );
643 1 WriteI2C(MonAddress, 0xc5, MonIndex);
644 1 WriteI2C(MonAddress, 0xc6, MonWdata);
645 1 MonRdata = ReadI2C(MonAddress, 0xc6);
646 1 Printf("\r\n==> Read %2xh:%2xh", (WORD)MonIndex, (WORD)MonRdata);
647 1 }
648 1 */
649 1 //---------------- Read Register --------------------
650 1 else if ( !stricmp( argv[0], "R" ) ) {
651 2 MonReadI2C();
652 2 }
653 1 else if ( !stricmp( argv[0], "(" ) ) {
654 2 indirect=0;
655 2 MonNewReadI2C();
656 2 }
657 1 /*
658 1 else if( !stricmp( argv[0], "i" ) ) {
659 1 MonIndex = Asc2Bin( argv[1] );
660 1 WriteI2C(MonAddress, 0xc5, MonIndex);
661 1 MonRdata = ReadI2C(MonAddress, 0xc6);
662 1 Printf("\r\n==> Read %2xh:%2xh", (WORD)MonIndex, (WORD)MonRdata);
663 1
664 1 }
665 1 */
666 1 //---------------- Dump Register --------------------
667 1 else if( !stricmp( argv[0], "D" ) ) {
668 2 Puts("\r\ndump start");
669 2 MonDumpI2C();
670 2 }
671 1 else if( !stricmp( argv[0], "&" ) ) {
672 2 indirect=0;
673 2 MonNewDumpI2C();
674 2 }
C51 COMPILER V7.50 MONITOR 04/01/2008 15:02:20 PAGE 12
675 1
676 1 //---------------- Bit Operation --------------------
677 1 else if( !stricmp( argv[0], "B" ) ) {// Write bits - B AA II bb DD
678 2 MonWriteBit();
679 2 }
680 1 /* no indirect addressing in TW8816
681 1 //---------------------------------------------------
682 1 else if( !stricmp( argv[0], "@" ) ) { // Indirect address bit access
683 1
684 1 BYTE Slave, mask, FromBit, ToBit, MonMask, val,i;
685 1 // @ 8a iaddr idata index startbit|endbit data
686 1 // 0 1 2 3 4 5 6
687 1
688 1 if( argc<7 ) {
689 1 Printf(" --> Missing parameter !!!");
690 1 return;
691 1 }
692 1
693 1 Slave = Asc2Bin(argv[1]);
694 1
695 1 FromBit = Asc2Bin( argv[5] );
696 1 FromBit = ( FromBit >> 4) & 0x0f;
697 1 ToBit = Asc2Bin( argv[5] );
698 1 ToBit = ToBit & 0x0f;
699 1 MonMask = Asc2Bin( argv[6] );
700 1
701 1 if( FromBit<ToBit || FromBit>7 || ToBit>7) {
702 1 Printf("\r\n --> Wrong range of bit operation !!!");
703 1 return;
704 1 }
705 1
706 1 mask = 0xff;
707 1 val=0x7f;
708 1 for(i=7; i>FromBit; i--) {
709 1 mask &= val;
710 1 val = val>>1;
711 1 }
712 1
713 1 val=0xfe;
714 1 for(i=0; i<ToBit; i++) {
715 1 mask &= val;
716 1 val = val<<1;
717 1 }
718 1
719 1 // @ 8a iaddr idata index startbit|endbit data
720 1 // 0 1 2 3 4 5 6
721 1 MonIndex = Asc2Bin(argv[2]);
722 1 MonWdata = Asc2Bin(argv[4]);
723 1 WriteI2C( Slave, MonIndex, MonWdata);
724 1
725 1 MonRdata = ReadI2C(Slave, Asc2Bin( argv[3]));
726 1 MonWdata = (MonRdata & (~mask)) | (MonMask & mask);
727 1 MonIndex = Asc2Bin(argv[3]);
728 1 WriteI2C(Slave, MonIndex, MonWdata);
729 1
730 1 MonRdata = ReadI2C(Slave, MonIndex);
731 1
732 1 Printf("\r\n<R>%2x[%2x]=%2x", (WORD)Slave, (WORD)MonIndex, (WORD)MonRdata);
733 1
734 1 }
735 1 //------------------------------------------------------------------
736 1 else if( !stricmp( argv[0], "!" ) ) // Indirect address write access
C51 COMPILER V7.50 MONITOR 04/01/2008 15:02:20 PAGE 13
737 1 {
738 1 BYTE Slave;
739 1 // @ 8a iaddr idata index data
740 1 if( argc<6 ) {
741 1 Printf(" --> Missing parameter !!!");
742 1 return;
743 1 }
744 1
745 1 Slave = Asc2Bin(argv[1]);
746 1
747 1 MonIndex = Asc2Bin(argv[2]);
748 1 MonWdata = Asc2Bin(argv[4]);
749 1 WriteI2C(Slave, MonIndex, MonWdata);
750 1
751 1 MonIndex = Asc2Bin(argv[3]);
752 1 MonWdata = Asc2Bin(argv[5]);
753 1 WriteI2C(Slave, MonIndex, MonWdata);
754 1
755 1 MonRdata = ReadI2C(Slave, MonIndex);
756 1
757 1 Printf("\r\n<R>%2x[%2x]=%2x", (WORD)Slave, (WORD)MonIndex, (WORD)MonRdata);
758 1
759 1 }
760 1 */
761 1
762 1 //---------------- Change I2C -----------------------
763 1 else if( !stricmp( argv[0], "C" ) ) {
764 2 MonAddress = Asc2Bin( argv[1] );
765 2 }
766 1
767 1 //---------------- Help -----------------------------
768 1 else if( !stricmp( argv[0], "H" ) || !stricmp( argv[0], "HELP" ) || !stricmp( argv[0], "?" ) ) {
769 2 MonHelp();
770 2
771 2 }
772 1 //---------------------------------------------------
773 1 else if( !stricmp( argv[0], "*" ) ) {
774 2
775 2 if( argc==1 ) {
776 3 Printf("\r\n * 0 : Program default Loader");
777 3 Printf("\r\n * 1 : Program external Loader");
778 3 Printf("\r\n * 2 : Execute Loader");
779 3 }
780 2 else {
781 3 BYTE mode;
782 3 mode = Asc2Bin(argv[1]);
783 3 Loader(mode);
784 3 }
785 2 }
786 1
787 1 //---------------------------------------------------
788 1 #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
789 1 else if( !stricmp( argv[0], "PCLK" ) ) {
790 2 PclkAccess();
791 2 }
792 1 #endif
793 1 //---------------------------------------------------
794 1 else if( !stricmp( argv[0], "POWER" ) ) {
795 2 LCDPower();
796 2 }
797 1 //---------------------------------------------------
798 1 #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
C51 COMPILER V7.50 MONITOR 04/01/2008 15:02:20 PAGE 14
799 1 else if( !stricmp( argv[0], "M" ) ) {
800 2 if( argc==2 ) {
801 3 if( !stricmp( argv[1], "?" ) ) {
802 4 BYTE i;
803 4 Printf("\r\nCurrent Input:%d \r\n", (WORD)InputSelection);
804 4 for(i=1; struct_InputSelection[i].Id!=0 ; i++)
805 4 Printf("%s:%d ",struct_InputSelection[i].Name,(WORD)struct_InputSelection[i].Id );
806 4 Printf("\r\n");
807 4 }
808 3 else
809 3 ChangeInput(Asc2Bin( argv[1] ));
810 3 }
811 2 else
812 2 ChangeInput(GetNextInputSelection());
813 2 }
814 1 //---------------------------------------------------
815 1 else if( !stricmp( argv[0], "PCAUTO" ) ) {
816 2 Puts("\r\nPC Auto Measurement");
817 2 AutoAdjust();
818 2 }
819 1 #endif
820 1 //---------------------------------------------------
821 1 else if( !stricmp( argv[0], "AUTODETECT" ) ) {
822 2 if( argc==2 ) {
823 3 AutoDetect = Asc2Bin(argv[1]);
824 3 }
825 2 Printf("\r\nAuto Detect = %d", (WORD)AutoDetect);
826 2 }
827 1 //---------------- Debug Level ---------------------
828 1 else if ( !stricmp( argv[0], "DEBUG" ) ) {
829 2 if( argc==2 ) {
830 3 DebugLevel = Asc2Bin(argv[1]);
831 3 SaveDebugLevelEE(DebugLevel);
832 3 }
833 2 Printf("\r\nDebug Level = %2x", (WORD)DebugLevel);
834 2 }
835 1
836 1 //---------------- Display on/off -------------------
837 1 else if ( !stricmp( argv[0], "echo" ) ) {
838 2 if( !stricmp( argv[1], "off" ) ) {
839 3 echo = 0;
840 3 Printf("\r\necho off");
841 3 }
842 2 else {
843 3 echo = 1;
844 3 Printf("\r\necho on");
845 3 }
846 2 }
847 1 //---------------- OSD test for parallel -----------------------------------
848 1 else if( !stricmp( argv[0], "OSD" ) ) {
849 2 if( !stricmp( argv[1], "logo" ) ) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -