V1.0
This commit is contained in:
+158
-165
@@ -1,10 +1,10 @@
|
||||
C51 COMPILER V9.60.7.0 RF_SEND 07/03/2025 11:27:50 PAGE 1
|
||||
C51 COMPILER V9.60.0.0 RF_SEND 05/05/2026 17:41:51 PAGE 1
|
||||
|
||||
|
||||
C51 COMPILER V9.60.7.0, COMPILATION OF MODULE RF_SEND
|
||||
C51 COMPILER V9.60.0.0, COMPILATION OF MODULE RF_SEND
|
||||
OBJECT MODULE PLACED IN .\hex\rf_send.obj
|
||||
COMPILER INVOKED BY: D:\Program Files\Keil_v5\C51\BIN\C51.EXE rf_send.c OMF2 OPTIMIZE(9,SIZE) BROWSE DEBUG PRINT(.\lst\r
|
||||
-f_send.lst) TABS(2) OBJECT(.\hex\rf_send.obj)
|
||||
COMPILER INVOKED BY: C:\keil5\C51\BIN\C51.EXE rf_send.c OMF2 OPTIMIZE(9,SIZE) BROWSE DEBUG PRINT(.\lst\rf_send.lst) TABS
|
||||
-(2) OBJECT(.\hex\rf_send.obj)
|
||||
|
||||
line level source
|
||||
|
||||
@@ -39,178 +39,171 @@ line level source
|
||||
28
|
||||
29 void Send433_Byte(void) //100us执行一次
|
||||
30 {
|
||||
31 1 switch (Send433_Status)
|
||||
32 1 {
|
||||
33 2 case 0: //同步头高
|
||||
34 2 Pin_rf = 1;
|
||||
35 2 if (++Send433_Time >= 4)//高电平400us
|
||||
36 2 {
|
||||
37 3 Send433_Time = 0;
|
||||
38 3 Send433_Status = 1; //进入同步头低
|
||||
39 3 }
|
||||
40 2 break;
|
||||
41 2 case 1://同步头低电平
|
||||
42 2 Pin_rf = 0;
|
||||
43 2 if (++Send433_Time >= 120)//电平12300us
|
||||
44 2 {
|
||||
45 3 Send433_Time = 0;
|
||||
46 3 Send433_Status = 2; //进入发送24位
|
||||
47 3 }
|
||||
48 2 break;
|
||||
49 2 case 2:
|
||||
50 2
|
||||
51 2 if(!Chose_Data_En)//还没开始发送 或者上次已经发送完一个字节才使能选择
|
||||
52 2 {
|
||||
53 3 Chose_Data_En=1;
|
||||
C51 COMPILER V9.60.7.0 RF_SEND 07/03/2025 11:27:50 PAGE 2
|
||||
31 1 // switch (Send433_Status)
|
||||
32 1 // {
|
||||
33 1 // case 0: //同步头高
|
||||
34 1 // Pin_rf = 1;
|
||||
35 1 // if (++Send433_Time >= 4)//高电平400us
|
||||
36 1 // {
|
||||
37 1 // Send433_Time = 0;
|
||||
38 1 // Send433_Status = 1; //进入同步头低
|
||||
39 1 // }
|
||||
40 1 // break;
|
||||
41 1 // case 1://同步头低电平
|
||||
42 1 // Pin_rf = 0;
|
||||
43 1 // if (++Send433_Time >= 120)//电平12300us
|
||||
44 1 // {
|
||||
45 1 // Send433_Time = 0;
|
||||
46 1 // Send433_Status = 2; //进入发送24位
|
||||
47 1 // }
|
||||
48 1 // break;
|
||||
49 1 // case 2:
|
||||
50 1
|
||||
51 1 // if(!Chose_Data_En)//还没开始发送 或者上次已经发送完一个字节才使能选择
|
||||
52 1 // {
|
||||
53 1 // Chose_Data_En=1;
|
||||
C51 COMPILER V9.60.0.0 RF_SEND 05/05/2026 17:41:51 PAGE 2
|
||||
|
||||
54 3 Temp=Yaokong_Data[Send433_Byte_Cont];
|
||||
55 3 //Send433_Byte_Cont++;
|
||||
56 3 }
|
||||
57 2
|
||||
58 2 Send433_Time++;
|
||||
59 2 if (Temp & 0x80) //1
|
||||
60 2 {
|
||||
61 3 if (Send433_Time <= 12)
|
||||
62 3 {
|
||||
63 4 Pin_rf = 1;
|
||||
64 4 }
|
||||
65 3 else if (Send433_Time >= 13)
|
||||
66 3 {
|
||||
67 4 Pin_rf = 0;
|
||||
68 4 if (Send433_Time == 16)
|
||||
69 4 {
|
||||
70 5 Send433_Time = 0;
|
||||
71 5 Temp <<= 1;
|
||||
72 5 Send433_Bit_Cont++;
|
||||
73 5 }
|
||||
74 4 }
|
||||
75 3 }
|
||||
76 2 else//0
|
||||
77 2 {
|
||||
78 3 if (Send433_Time <= 4)
|
||||
79 3 {
|
||||
80 4 Pin_rf = 1;
|
||||
81 4 }
|
||||
82 3 else if (Send433_Time >= 5)
|
||||
83 3 {
|
||||
84 4 Pin_rf = 0;
|
||||
85 4 if (Send433_Time == 16)
|
||||
86 4 {
|
||||
87 5 Send433_Time = 0;
|
||||
88 5 Temp <<= 1;
|
||||
89 5 Send433_Bit_Cont++;
|
||||
90 5 }
|
||||
91 4 }
|
||||
92 3 }
|
||||
93 2 if (Send433_Bit_Cont == 8)//发送完一字节
|
||||
94 2 {
|
||||
95 3 Send433_Bit_Cont = 0;
|
||||
96 3
|
||||
97 3 Chose_Data_En=0;//使能选择下一个字节
|
||||
98 3 if(++Send433_Byte_Cont==3)
|
||||
99 3 {
|
||||
100 4 Send433_Byte_Cont=0;
|
||||
101 4
|
||||
102 4 if(flagStart == 1)
|
||||
103 4 {
|
||||
104 5 Send433_Status = 3; //结束脉冲
|
||||
105 5 }
|
||||
106 4 else
|
||||
107 4 {
|
||||
108 5 Send433_Status = 0; //一帧数据发送完毕
|
||||
109 5 }
|
||||
110 4
|
||||
111 4 }
|
||||
112 3 }
|
||||
113 2 break;
|
||||
114 2
|
||||
115 2 case 3:
|
||||
C51 COMPILER V9.60.7.0 RF_SEND 07/03/2025 11:27:50 PAGE 3
|
||||
54 1 // Temp=Yaokong_Data[Send433_Byte_Cont];
|
||||
55 1 // //Send433_Byte_Cont++;
|
||||
56 1 // }
|
||||
57 1
|
||||
58 1 // Send433_Time++;
|
||||
59 1 // if (Temp & 0x80) //1
|
||||
60 1 // {
|
||||
61 1 // if (Send433_Time <= 12)
|
||||
62 1 // {
|
||||
63 1 // Pin_rf = 1;
|
||||
64 1 // }
|
||||
65 1 // else if (Send433_Time >= 13)
|
||||
66 1 // {
|
||||
67 1 // Pin_rf = 0;
|
||||
68 1 // if (Send433_Time == 16)
|
||||
69 1 // {
|
||||
70 1 // Send433_Time = 0;
|
||||
71 1 // Temp <<= 1;
|
||||
72 1 // Send433_Bit_Cont++;
|
||||
73 1 // }
|
||||
74 1 // }
|
||||
75 1 // }
|
||||
76 1 // else//0
|
||||
77 1 // {
|
||||
78 1 // if (Send433_Time <= 4)
|
||||
79 1 // {
|
||||
80 1 // Pin_rf = 1;
|
||||
81 1 // }
|
||||
82 1 // else if (Send433_Time >= 5)
|
||||
83 1 // {
|
||||
84 1 // Pin_rf = 0;
|
||||
85 1 // if (Send433_Time == 16)
|
||||
86 1 // {
|
||||
87 1 // Send433_Time = 0;
|
||||
88 1 // Temp <<= 1;
|
||||
89 1 // Send433_Bit_Cont++;
|
||||
90 1 // }
|
||||
91 1 // }
|
||||
92 1 // }
|
||||
93 1 // if (Send433_Bit_Cont == 8)//发送完一字节
|
||||
94 1 // {
|
||||
95 1 // Send433_Bit_Cont = 0;
|
||||
96 1
|
||||
97 1 // Chose_Data_En=0;//使能选择下一个字节
|
||||
98 1 // if(++Send433_Byte_Cont==3)
|
||||
99 1 // {
|
||||
100 1 // Send433_Byte_Cont=0;
|
||||
101 1 //
|
||||
102 1 // if(flagStart == 1)
|
||||
103 1 // {
|
||||
104 1 // Send433_Status = 3; //结束脉冲
|
||||
105 1 // }
|
||||
106 1 // else
|
||||
107 1 // {
|
||||
108 1 // Send433_Status = 0; //一帧数据发送完毕
|
||||
109 1 // }
|
||||
110 1 //
|
||||
111 1 // }
|
||||
112 1 // }
|
||||
113 1 // break;
|
||||
114 1 //
|
||||
115 1 // case 3:
|
||||
C51 COMPILER V9.60.0.0 RF_SEND 05/05/2026 17:41:51 PAGE 3
|
||||
|
||||
116 2 if (++Send433_Time <= 4)
|
||||
117 2 {
|
||||
118 3 Pin_rf = 1;
|
||||
119 3 }
|
||||
120 2 else
|
||||
121 2 {
|
||||
122 3 Pin_rf = 0;
|
||||
123 3 Send433_Time = 0;
|
||||
124 3 // flagStart = 0;
|
||||
125 3 Send433_Status = 0;
|
||||
126 3 TR0 = 0; //定时器0禁止
|
||||
127 3
|
||||
128 3 }
|
||||
129 2 break;
|
||||
130 2 default:
|
||||
131 2 break;
|
||||
132 2 }
|
||||
116 1 // if (++Send433_Time <= 4)
|
||||
117 1 // {
|
||||
118 1 // Pin_rf = 1;
|
||||
119 1 // }
|
||||
120 1 // else
|
||||
121 1 // {
|
||||
122 1 // Pin_rf = 0;
|
||||
123 1 // Send433_Time = 0;
|
||||
124 1 // // flagStart = 0;
|
||||
125 1 // Send433_Status = 0;
|
||||
126 1 // TR0 = 0; //定时器0禁止
|
||||
127 1 //
|
||||
128 1 // }
|
||||
129 1 // break;
|
||||
130 1 // default:
|
||||
131 1 // break;
|
||||
132 1 // }
|
||||
133 1 }
|
||||
134
|
||||
135
|
||||
136 //void RF_send(unsigned char cnt);
|
||||
137 //void send_8bit(unsigned char n);
|
||||
138
|
||||
139 ///*****************************************/
|
||||
140
|
||||
141 //void RF_send(unsigned char cnt)
|
||||
142 //{
|
||||
143 // unsigned char i;
|
||||
144
|
||||
145 // for(i=cnt;i>0;i--) //单个包发送次数
|
||||
146 // {
|
||||
147 // Pin_rf=1;
|
||||
148 // Delay_50us(8); //同步码高电平
|
||||
149 // Pin_rf=0;
|
||||
150 // Delay_ms(12); //同步码低电平
|
||||
151 // Pin_rf=1;
|
||||
152
|
||||
153 // send_8bit(D0);
|
||||
154 // send_8bit(D1);
|
||||
155 // send_8bit(valueSend);
|
||||
156 //
|
||||
157 //// if(WheelSliderPosition == -1&&KeysFlagSN == 0)
|
||||
158 //// {
|
||||
159 //// Pin_rf=1;
|
||||
160 //// Delay_50us(7);
|
||||
161 //// Pin_rf=0;
|
||||
162 //// }
|
||||
163 // }
|
||||
164 //}
|
||||
165 ////---------------------------------------------
|
||||
166 //void send_8bit(unsigned char n)
|
||||
167 //{
|
||||
168 // unsigned char i;
|
||||
169 // for(i=8;i>0;i--)
|
||||
170 // {
|
||||
171 // Pin_rf=1;
|
||||
172 // if(n&0x80)
|
||||
173 // {
|
||||
174 // Delay_50us(24);
|
||||
175 // Pin_rf=0;
|
||||
176 // Delay_50us(7);
|
||||
177 // }
|
||||
C51 COMPILER V9.60.7.0 RF_SEND 07/03/2025 11:27:50 PAGE 4
|
||||
135 void RF_send(unsigned char cnt);
|
||||
136 void send_8bit(unsigned char n);
|
||||
137
|
||||
138 /*****************************************/
|
||||
139
|
||||
140 void RF_send(unsigned char cnt)
|
||||
141 {
|
||||
142 1 unsigned char i;
|
||||
143 1
|
||||
144 1 for(i=cnt;i>0;i--) //单个包发送次数
|
||||
145 1 {
|
||||
146 2 Pin_rf=1;
|
||||
147 2 Delay_50us(5); //同步码高电平
|
||||
148 2 Pin_rf=0;
|
||||
149 2 Delay_50us(185); //同步码低电平
|
||||
150 2 Pin_rf=1;
|
||||
151 2
|
||||
152 2 send_8bit(D0);
|
||||
153 2 send_8bit(D1);
|
||||
154 2 send_8bit(valueSend);
|
||||
155 2 }
|
||||
156 1 }
|
||||
157
|
||||
158 void send_8bit(unsigned char n)
|
||||
159 {
|
||||
160 1 unsigned char i;
|
||||
161 1 for(i=8;i>0;i--)
|
||||
162 1 {
|
||||
163 2 Pin_rf=1;
|
||||
164 2 if(n&0x80)
|
||||
165 2 {//发1码
|
||||
166 3 Delay_50us(18);
|
||||
167 3 Pin_rf=0;
|
||||
168 3 Delay_50us(4);
|
||||
169 3 }
|
||||
170 2 else
|
||||
171 2 {//发0码
|
||||
172 3 Delay_50us(5);
|
||||
173 3 Pin_rf=0;
|
||||
174 3 Delay_50us(17);
|
||||
175 3 }
|
||||
176 2 n<<=1;
|
||||
177 2 }
|
||||
C51 COMPILER V9.60.0.0 RF_SEND 05/05/2026 17:41:51 PAGE 4
|
||||
|
||||
178 // else
|
||||
179 // {
|
||||
180 // Delay_50us(7);
|
||||
181 // Pin_rf=0;
|
||||
182 // Delay_50us(24);
|
||||
183 // }
|
||||
184 // n<<=1;
|
||||
185 // }
|
||||
186 //}
|
||||
187
|
||||
188 #endif
|
||||
178 1 }
|
||||
179
|
||||
180
|
||||
181 #endif
|
||||
|
||||
|
||||
MODULE INFORMATION: STATIC OVERLAYABLE
|
||||
CODE SIZE = 260 ----
|
||||
CODE SIZE = 117 ----
|
||||
CONSTANT SIZE = ---- ----
|
||||
XDATA SIZE = ---- ----
|
||||
PDATA SIZE = ---- ----
|
||||
DATA SIZE = 13 ----
|
||||
DATA SIZE = 13 3
|
||||
IDATA SIZE = 2 ----
|
||||
BIT SIZE = ---- ----
|
||||
EDATA SIZE = ---- ----
|
||||
|
||||
Reference in New Issue
Block a user