📄 irint.lst
字号:
C51 COMPILER V7.50 IRINT 01/12/2006 13:31:13 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE IRINT
OBJECT MODULE PLACED IN .\Obj\IrInt.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Source\T100\IrInt.c BROWSE INCDIR(.\Include\;.\Source\;.\Include\Panel\;.\I
-nclude\GammaTable\) DEFINE(T106) DEBUG OBJECTEXTEND PRINT(.\IrInt.lst) OBJECT(.\Obj\IrInt.obj)
line level source
1 //#ifdef INTERRUPT1
2 #include "reg51.h"
3 #include "Common.h"
4 #include "Remote.h"
5 #include "struct.h"
6 #include "system.h"
7 #include "KEYPAD.H"
8 #include "OSDDraw.h"
9 #include "TwoWire.h"
10 #include "intrins.h"
11
12
13 extern bit ir_enable;
14 extern uCHAR ir_data;
15 //extern uWORD count1;
16 uCHAR ir_repeat;
17 bit Filter13(bit le)
18 {
19 1 bit r;
20 1 r=INT1;
21 1 if(le==1)
22 1 {
23 2 _nop_();
24 2 _nop_();
25 2 _nop_();
26 2 r&=INT1;
27 2 _nop_();
28 2 _nop_();
29 2 _nop_();
30 2 r&=INT1;
31 2 }
32 1 else
33 1 {
34 2 _nop_();
35 2 _nop_();
36 2 _nop_();
37 2 r|=INT1;
38 2 _nop_();
39 2 _nop_();
40 2 _nop_();
41 2 r|=INT1;
42 2 }
43 1 if(r==le)
44 1 return 1;
45 1 else
46 1 return 0;
47 1 }
48 /*遥控接收在此中断程序内完成
49 数据放在ir_data内*/
50 /************************************/
51 /* Interrupt for IR subroutine */
52 /* external interrupt source INT0 */
53 /************************************/
54 void int1Remote(void) interrupt 2
C51 COMPILER V7.50 IRINT 01/12/2006 13:31:13 PAGE 2
55 {
56 1 register BYTE i;
57 1 unsigned int count; /*计时变量*/
58 1 unsigned int temp0,temp1,ir_code=0;
59 1 ir_enable=TRUE;
60 1 TMOD=0x11; /*timer 0 operate in 16 bit mode*/
61 1 EX1=0;
62 1 TL0=0;
63 1 TH0=0;
64 1 TR0=1;
65 1 /************************************/
66 1 /* Detect IR Head */
67 1 /************************************/
68 1 do /*Detect IR head 9mS*/
69 1 {
70 2 count=(TL0+TH0*256); /*count :us unit */
71 2 if(Filter13(1)==1) break;
72 2 }while(count<=(IR_HEAD+DELTA));
73 1 TR0=0; /*停止计时*/
74 1
75 1 if(Filter13(0)==1||count<(IR_HEAD-DELTA*25)) /*for some noise disturb IR*/
76 1 {
77 2 ir_enable=FALSE; /* no IR head or not suitable for Ir head*/
78 2 EX1=1;
79 2 TR0=1;
80 2 return;
81 2 }
82 1 /************************************/
83 1 /* Detect OFF CODE 4.5mS */
84 1 /************************************/
85 1 while(Filter13(0)==1);
86 1 TR0=0;
87 1 TL0=0;
88 1 TH0=0;
89 1 TR0=1;
90 1 do /*Detect IR OFF CODE*/
91 1 {
92 2 count=(TL0+TH0*256); /*count :us unit */
93 2 if(Filter13(0)==1) break;
94 2 }while(count<(OFF_CODE+DELTA));
95 1 TR0=0;
96 1 count=(TL0+TH0*256); /*count :us unit */
97 1 if(count<=(OFF_CODE-DELTA*2))
98 1 {
99 2 /*重复码OFF=2.25*/
100 2 if((count>(OFF_REP-DELTA)&&count<(OFF_REP+DELTA)))
101 2 {
102 3 TR0=0;
103 3 TL0=0;
104 3 TH0=0;
105 3 TR0=1;
106 3 do
107 3 {
108 4 count=(TL0+TH0*256); /*count :us unit */
109 4 if(Filter13(1)==1) break;
110 4 }while(count<=(REP_CODE+DELTA));
111 3 TR0=0;
112 3 count=(TL0+TH0*256); /*count :us unit */
113 3 if(INT1==1)
114 3 {
115 4 TR0=0;
116 4 if(
C51 COMPILER V7.50 IRINT 01/12/2006 13:31:13 PAGE 3
117 4 ir_data==REMOTE_KEY_DECR||ir_data==REMOTE_KEY_INCR)
118 4 {
119 5 ir_enable=TRUE; /*注意:ir_data不变*/
120 5 EX1=0;
121 5 }
122 4 else
123 4 {
124 5 ir_data=0;
125 5 ir_enable=FALSE;
126 5 EX1=1;
127 5 TR0=1;
128 5 }
129 4 return;
130 4 }
131 3 }
132 2 else
133 2 {
134 3 ir_enable=FALSE; /*not suitable for off code*/
135 3 EX1=1;
136 3 TR0=1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -