📄 t100.lst
字号:
859 2 _nop_();
860 2 _nop_();
C51 COMPILER V7.06 T100 09/21/2005 18:16:31 PAGE 15
861 2 r|=INT1;
862 2 }
863 1 if(r==le)
864 1 return 1;
865 1 else
866 1 return 0;
867 1 }
868 /*遥控接收在此中断程序内完成
869 数据放在ir_data内*/
870 /************************************/
871 /* Interrupt for IR subroutine */
872 /* external interrupt source INT0 */
873 /************************************/
874 void int1Remote(void) interrupt 2
875 {
876 1 unsigned int mask=1; //sary !LSB first
877 1
878 1 register BYTE i;
879 1 unsigned int count; /*计时变量*/
880 1 unsigned int temp0,temp1,ir_code=0;
881 1 ir_enable=TRUE;
882 1 TMOD=0x11; /*timer 0 operate in 16 bit mode*/
883 1 EX1=0;
884 1 TL0=0;
885 1 TH0=0;
886 1 TR0=1;
887 1 /************************************/
888 1 /* Detect IR Head */
889 1 /************************************/
890 1 do /*Detect IR head 9mS*/
891 1 {
892 2 count=(TL0+TH0*256); /*count :us unit */
893 2 if(Filter13(1)==1) break;
894 2 }while(count<=(IR_HEAD+DELTA));
895 1 TR0=0; /*停止计时*/
896 1
897 1 if(Filter13(0)==1||count<(IR_HEAD-DELTA*25)) /*for some noise disturb IR*/
898 1 {
899 2 ir_enable=FALSE; /* no IR head or not suitable for Ir head*/
900 2 EX1=1;
901 2 TR0=1;
902 2 return;
903 2 }
904 1 /************************************/
905 1 /* Detect OFF CODE 4.5mS */
906 1 /************************************/
907 1 while(Filter13(0)==1);
908 1 TR0=0;
909 1 TL0=0;
910 1 TH0=0;
911 1 TR0=1;
912 1 do /*Detect IR OFF CODE*/
913 1 {
914 2 count=(TL0+TH0*256); /*count :us unit */
915 2 if(Filter13(0)==1) break;
916 2 }while(count<(OFF_CODE+DELTA));
917 1 TR0=0;
918 1 count=(TL0+TH0*256); /*count :us unit */
919 1 if(count<=(OFF_CODE-DELTA*4))
920 1 {
921 2 /*重复码OFF=2.25*/
922 2 if((count>(OFF_REP-DELTA)&&count<(OFF_REP+DELTA)))
C51 COMPILER V7.06 T100 09/21/2005 18:16:31 PAGE 16
923 2 { TR0=0;
924 3 TL0=0;
925 3 TH0=0;
926 3 TR0=1;
927 3
928 3 do
929 3 {
930 4 count=(TL0+TH0*256); /*count :us unit */
931 4 if(Filter13(1)==1) break;
932 4 }while(count<=(REP_CODE+DELTA));
933 3 TR0=0;
934 3 count=(TL0+TH0*256); /*count :us unit */
935 3 if(INT1==1)
936 3 {
937 4 TR0=0;
938 4
939 4 if(ir_data==LEFT||ir_data==RIGHT)
940 4 {
941 5 ir_enable=TRUE; /*注意:ir_data不变*/
942 5 EX1=0;
943 5 }
944 4 else
945 4 {
946 5 ir_data=0;
947 5 ir_enable=FALSE;
948 5 EX1=1;
949 5 TR0=1;
950 5 }
951 4 return;
952 4 }
953 3 }
954 2 else if(count>(OFF_REP+DELTA))
955 2 {
956 3
957 3 ir_enable=TRUE; /*注意:ir_data不变*/
958 3 EX1=0;
959 3
960 3 }
961 2 else
962 2 {
963 3 ir_enable=FALSE; /*not suitable for off code*/
964 3 EX1=1;
965 3 TR0=1;
966 3 return;
967 3 }
968 2 }
969 1
970 1 /************************************/
971 1 /* Detect 16 bit address code */
972 1 /************************************/
973 1 if(ir_enable==TRUE)
974 1 {
975 2 TMOD=0x11; /*counter start with INT0 and TR0*/
976 2 ir_code=0; /*初始化变量*/
977 2 for(i=0;i<16;i++)
978 2 {
979 3 while(INT1==0);
980 3 TL0=0;
981 3 TH0=0;
982 3 TR0=1;
983 3 do
984 3 {
C51 COMPILER V7.06 T100 09/21/2005 18:16:31 PAGE 17
985 4 count=(TL0+TH0*256); /*count :us unit */
986 4 if(Filter13(0)==1) break;
987 4 }while(count<=(CODE_1_TIME+DELTA)); /*INT0为高电平时计时*/
988 3 TR0=0;
989 3
990 3 //ir_code<<=1;
991 3
992 3 if((count>(CODE_1_TIME-DELTA))&&(count<=(CODE_1_TIME+DELTA))) /*detect 1 code 2.24mS-0.56mS=1.68mS*/
993 3 ir_code|=mask; //ir_code++;
994 3 else if((count>(CODE_0_TIME-DELTA))&&(count<=(CODE_0_TIME+DELTA))); /*detect 0 code 1.12mS-0.56mS=0.56
-mS*/
995 3 else
996 3 {
997 4 ir_enable=FALSE;
998 4 TR0=1;
999 4 break; /*not suitable for address code */
1000 4 }
1001 3 mask<<=1;
1002 3 } /*end for*/
1003 2 }
1004 1 /************************************/
1005 1 /* Detect 16 bit data code */
1006 1 /************************************/
1007 1 if(ir_enable==TRUE&&~ir_code==IR_SYSTEM_CODE)/**/
1008 1 {
1009 2 TMOD=0x11; /*counter start with INT0 and TR0*/
1010 2 mask=1;
1011 2 ir_code=0;
1012 2 for(i=0;i<16;i++)
1013 2 {
1014 3 while(INT1==0);
1015 3 TL0=0;
1016 3 TH0=0;
1017 3 TR0=1;
1018 3 do
1019 3 {
1020 4 count=(TL0+TH0*256);
1021 4 if(Filter13(0)==1) break;
1022 4 }while(count<=(CODE_1_TIME+DELTA)); /*INT0为高电平时计时*/
1023 3 TR0=0;
1024 3 //count=(TL0+TH0*256); /*count :us unit */
1025 3 //ir_code<<=1;
1026 3 if((count>(CODE_1_TIME-DELTA))&&(count<=(CODE_1_TIME+DELTA))) /*detect 1 code 1.68mS*/
1027 3 ir_code|=mask; //ir_code++;
1028 3 else if((count>(CODE_0_TIME-DELTA)&&count<=(CODE_0_TIME+DELTA))); /*detect 0 code 0.56mS*/
1029 3 else
1030 3 {
1031 4 ir_enable=FALSE;
1032 4 TR0=1;
1033 4 break; /*not suitable for address code */
1034 4 }
1035 3 mask<<=1;
1036 3 } /*end for*/
1037 2 if(ir_enable==TRUE)
1038 2 {
1039 3
1040 3 temp0=ir_code&0xff00;
1041 3 temp0=~temp0;
1042 3 temp0>>=8;
1043 3 temp1=ir_code&0x00ff;
1044 3 if(temp0!=temp1)
1045 3 ir_enable=FALSE;
C51 COMPILER V7.06 T100 09/21/2005 18:16:31 PAGE 18
1046 3 else
1047 3 {
1048 4 ir_data=(BYTE)(temp1); /*true code effective*/
1049 4 // ir_data=(BYTE)(temp0);
1050 4 ir_enable=TRUE; /*set ir flag*/
1051 4 EX1=0;
1052 4 return;
1053 4 }
1054 3 }
1055 2 }
1056 1 else
1057 1 { ir_enable=FALSE;
1058 2 EX1=1;}
1059 1 }
1060 void RemoteEvent(void)
1061 {
1062 1 bit bTemp=0;
1063 1 switch(ir_data)
1064 1 {
1065 2 case LEFT : left=1;
1066 2 break;
1067 2
1068 2 case RIGHT : right=1;
1069 2 break;
1070 2
1071 2 case DOWN : down=1;
1072 2 break;
1073 2
1074 2 case UP : up=1;
1075 2 break;
1076 2
1077 2 case ENTER : enter=1;
1078 2 break;
1079 2
1080 2 case OSD : osd=1;
1081 2
1082 2 default : break;
1083 2 }
1084 1
1085 1 if((window==SUB1_D) && ((cursor1==VIDEO) && (cursor2!=V_SHARP))
1086 1 || ((cursor1==AUDIO) && (cursor2==A_VOL)) )
1087 1 {
1088 2 EX1=1;
1089 2
1090 2 }
1091 1 else
1092 1 {
1093 2 EX1=0;
1094 2 }
1095 1
1096 1 }
1097 /*bit IRGammaAdjust(void)
1098 {
1099
1100 switch(m_cOSDFunc)
1101 {
1102 case 0:
1103 m_cOSDFunc=idGammaAdjust;
1104 m_cOSDEvent=GammaAdjust;
1105 break;
1106 case idGammaAdjust:
1107 m_cOSDFunc=0;
C51 COMPILER V7.06 T100 09/21/2005 18:16:31 PAGE 19
1108 bGAMMA_ADJ=0;
1109 m_cOSDEvent=FUNCEXIT;
1110 break;
1111 default:
1112 m_cOSDFunc=0;
1113 bGAMMA_ADJ=0;
1114 m_cOSDEvent=FUNCEXIT;
1115 break;
1116 break;
1117
1118 }
1119 return 1;
1120
1121
1122 }*/
1123 /*void IRSourceSelCtrl(void)
1124 {
1125
1126 if(cSource>=5)cSource = 1; //Kuo
1127 cSource++;
1128 ClosePanel();
1129 //I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_SOURCE_INDEX,m_cSource);
1130 SetSource();
1131 SetMode();
1132 Delay_ms(25);
1133 OpenPanel();
1134 //OSDShowSource();
1135 // return 1;
1136 }*/
1137 /*void IRSCALEREvent(void)
1138 {
1139 bFULL_43=!bFULL_43;
1140 SetMode();
1141 Delay_ms(25);
1142 OpenPanel();
1143 // OSDShowRatio();
1144 //return 1;
1145 }*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -