📄 level3.lst
字号:
188 007c F9CF rjmp .L1
189 .stabn 68,0,69,.LM26-Capture
190 .LM26:
191 .L11:
192 007e 86E0 ldi r24,lo8(6)
193 0080 83BF out 83-0x20,r24
194 .stabn 68,0,70,.LM27-Capture
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccmgaaaa.s page 6
195 .LM27:
196 0082 8091 0000 lds r24,counter1set
197 0086 8EBD out 78-0x20,r24
198 .stabn 68,0,71,.LM28-Capture
199 .LM28:
200 0088 5FD1 rcall type_A_polling
201 .stabn 68,0,73,.LM29-Capture
202 .LM29:
203 /* #APP */
204 008a A895 wdr
205 .stabn 68,0,76,.LM30-Capture
206 .LM30:
207 /* #NOAPP */
208 008c 00D0 rcall WatchDog_Feed
209 .stabn 68,0,78,.LM31-Capture
210 .LM31:
211 008e 13BE out 83-0x20,__zero_reg__
212 .stabn 68,0,79,.LM32-Capture
213 .LM32:
214 0090 1EBC out 78-0x20,__zero_reg__
215 0092 DDCF rjmp .L3
216 .stabn 68,0,52,.LM33-Capture
217 .LM33:
218 .L10:
219 0094 00D0 rcall ClearCaptureBuffers
220 0096 BDCF rjmp .L2
221 /* epilogue: frame size=0 */
222 0098 0895 ret
223 /* epilogue end (size=1) */
224 /* function Capture size 78 (77) */
225 .size Capture, .-Capture
226 .Lscope0:
227 .stabs "",36,0,0,.Lscope0-Capture
228 .stabs "Wait:F(0,20)",36,0,102,Wait
229 .stabs "period:P(4,4)",64,0,101,24
230 .global Wait
231 .type Wait, @function
232 Wait:
92:level3.c ****
93:level3.c **** // ********************************************************************************************
94:level3.c **** // Description : Wait period/16 us , and use Prescaler to realize period cycles large than 256
95:level3.c **** // instead of times of T2 overflow.
96:level3.c **** // Return value: None.
97:level3.c **** // parameter : period -- the number of cycles of OSC.
98:level3.c **** // ********************************************************************************************
99:level3.c ****
100:level3.c ****
101:level3.c **** void Wait( uint16_t period )
102:level3.c **** {
233 .stabn 68,0,102,.LM34-Wait
234 .LM34:
235 /* prologue: frame size=0 */
236 /* prologue end (size=0) */
103:level3.c **** uint8_t time = ScaleTime( period );
237 .stabn 68,0,103,.LM35-Wait
238 .LM35:
239 .LBB2:
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccmgaaaa.s page 7
240 009a 11D1 rcall ScaleTime
104:level3.c **** TCCR2 = 0; //disable Counter2
241 .stabn 68,0,104,.LM36-Wait
242 .LM36:
243 009c 15BC out 69-0x20,__zero_reg__
105:level3.c **** TCNT2 = -time; //set timer with initial time
244 .stabn 68,0,105,.LM37-Wait
245 .LM37:
246 009e 8195 neg r24
247 00a0 84BD out 68-0x20,r24
106:level3.c **** TIFR = TIFR | ( 1 << OCF2 ) | ( 1 << TOV2 ); //clear pending interrupts
248 .stabn 68,0,106,.LM38-Wait
249 .LM38:
250 00a2 88B7 in r24,88-0x20
251 00a4 806C ori r24,lo8(-64)
252 00a6 88BF out 88-0x20,r24
107:level3.c **** sbi( SFIOR , PSR2 ); //clear T2 prescaler
253 .stabn 68,0,107,.LM39-Wait
254 .LM39:
255 00a8 80B7 in r24,80-0x20
256 00aa 8260 ori r24,lo8(2)
257 00ac 80BF out 80-0x20,r24
108:level3.c **** sbi( TIMSK , TOIE2 ); //enable overflow
258 .stabn 68,0,108,.LM40-Wait
259 .LM40:
260 00ae 89B7 in r24,89-0x20
261 00b0 8064 ori r24,lo8(64)
262 00b2 89BF out 89-0x20,r24
109:level3.c **** TCCR2 = maxCaptureTimeScale; //run! at clkio/scale
263 .stabn 68,0,109,.LM41-Wait
264 .LM41:
265 00b4 8091 0000 lds r24,maxCaptureTimeScale
266 00b8 85BD out 69-0x20,r24
110:level3.c **** while ( TIMSK & ( 1 << TOIE2 ) ) //wait until done
267 .stabn 68,0,110,.LM42-Wait
268 .LM42:
269 .L13:
270 00ba 09B6 in __tmp_reg__,89-0x20
271 00bc 06FC sbrc __tmp_reg__,6
272 00be FDCF rjmp .L13
111:level3.c **** { }
112:level3.c **** TCCR2 = 0; //stop
273 .stabn 68,0,112,.LM43-Wait
274 .LM43:
275 00c0 15BC out 69-0x20,__zero_reg__
113:level3.c **** }
276 .stabn 68,0,113,.LM44-Wait
277 .LM44:
278 .LBE2:
279 /* epilogue: frame size=0 */
280 00c2 0895 ret
281 /* epilogue end (size=1) */
282 /* function Wait size 21 (20) */
283 .size Wait, .-Wait
284 .stabs "time:r(4,2)",64,0,103,24
285 .stabn 192,0,0,.LBB2-Wait
286 .stabn 224,0,0,.LBE2-Wait
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccmgaaaa.s page 8
287 .Lscope1:
288 .stabs "",36,0,0,.Lscope1-Wait
289 .stabs "Compute_Timeouts:F(0,20)",36,0,123,Compute_Timeouts
290 .global Compute_Timeouts
291 .type Compute_Timeouts, @function
292 Compute_Timeouts:
114:level3.c ****
115:level3.c ****
116:level3.c **** // ********************************************************************************************
117:level3.c **** // Description : Compute the timeout of polling data from antenna.
118:level3.c **** // Return value: None.
119:level3.c **** // parameter : None.
120:level3.c **** // ********************************************************************************************
121:level3.c ****
122:level3.c **** void Compute_Timeouts( void )
123:level3.c **** {
293 .stabn 68,0,123,.LM45-Compute_Timeouts
294 .LM45:
295 /* prologue: frame size=0 */
296 /* prologue end (size=0) */
124:level3.c **** uint16_t pom = 0;
125:level3.c **** pom = ( uint16_t )expectedResponseLen * 20 + 1;
297 .stabn 68,0,125,.LM46-Compute_Timeouts
298 .LM46:
299 .LBB3:
300 00c4 9091 0000 lds r25,expectedResponseLen
301 00c8 84E1 ldi r24,lo8(20)
302 00ca 989F mul r25,r24
303 00cc C001 movw r24,r0
304 00ce 1124 clr r1
305 00d0 0196 adiw r24,1
126:level3.c **** pom = ( 19 * ( uint32_t )pom ) / 16 + 1; //13.56 to 16 correction
306 .stabn 68,0,126,.LM47-Compute_Timeouts
307 .LM47:
308 00d2 AA27 clr r26
309 00d4 BB27 clr r27
310 00d6 BC01 movw r22,r24
311 00d8 CD01 movw r24,r26
312 00da 23E1 ldi r18,lo8(19)
313 00dc 30E0 ldi r19,hi8(19)
314 00de 40E0 ldi r20,hlo8(19)
315 00e0 50E0 ldi r21,hhi8(19)
316 00e2 00D0 rcall __mulsi3
317 00e4 DC01 movw r26,r24
318 00e6 CB01 movw r24,r22
319 00e8 24E0 ldi r18,4
320 00ea B695 1: lsr r27
321 00ec A795 ror r26
322 00ee 9795 ror r25
323 00f0 8795 ror r24
324 00f2 2A95 dec r18
325 00f4 D1F7 brne 1b
326 00f6 0196 adiw r24,1
127:level3.c **** maxTGeneral = pom;
327 .stabn 68,0,127,.LM48-Compute_Timeouts
328 .LM48:
329 00f8 9093 0000 sts (maxTGeneral)+1,r25
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccmgaaaa.s page 9
330 00fc 8093 0000 sts maxTGeneral,r24
128:level3.c **** }
331 .stabn 68,0,128,.LM49-Compute_Timeouts
332 .LM49:
333 .LBE3:
334 /* epilogue: frame size=0 */
335 0100 0895 ret
336 /* epilogue end (size=1) */
337 /* function Compute_Timeouts size 31 (30) */
338 .size Compute_Timeouts, .-Compute_Timeouts
339 .stabs "pom:r(4,4)",64,0,124,24
340 .stabn 192,0,0,.LBB3-Compute_Timeouts
341 .stabn 224,0,0,.LBE3-Compute_Timeouts
342 .Lscope2:
343 .stabs "",36,0,0,.Lscope2-Compute_Timeouts
344 .stabs "Send:F(0,20)",36,0,135,Send
345 .stabs "len:P(4,2)",64,0,134,17
346 .stabs "wait_time:P(4,4)",64,0,134,14
347 .global Send
348 .type Send, @function
349 Send:
129:level3.c ****
130:level3.c ****
131:level3.c **** //--------------------------------------------------------------
132:level3.c **** //send command and wait
133:level3.c **** //
134:level3.c **** void Send( uint8_t len , uint16_t wait_time )
135:level3.c **** {
350 .stabn 68,0,135,.LM50-Send
351 .LM50:
352 /* prologue: frame size=0 */
353 0102 EF92 push r14
354 0104 FF92 push r15
355 0106 0F93 push r16
356 0108 1F93 push r17
357 010a CF93 push r28
358 /* prologue end (size=5) */
359 010c 182F mov r17,r24
360 010e 7B01 movw r14,r22
136:level3.c **** uint8_t fwd_bit_count;
137:level3.c **** uint8_t i;
138:level3.c **** fwd_bit_count = Prepare_SOF( );
361 .stabn 68,0,138,.LM51-Send
362 .LM51:
363 .LBB4:
364 0110 00D0 rcall Prepare_SOF
365 0112 082F mov r16,r24
139:level3.c ****
140:level3.c **** for ( i = 0 ; i < len ; i++ )
366 .stabn 68,0,140,.LM52-Send
367 .LM52:
368 0114 C0E0 ldi r28,lo8(0)
369 0116 C117 cp r28,r17
370 0118 A0F0 brlo .L22
371 .L25:
141:level3.c **** fwd_bit_count += Prepare_Data( cmd_message[ i ] , len );
142:level3.c ****
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccmgaaaa.s page 10
143:level3.c **** fwd_bit_count += Prepare_EOF( len );
372 .stabn 68,0,143,.LM53-Send
373 .LM53:
374 011a 812F mov r24,r17
375 011c 00D0 rcall Prepare_EOF
376 011e 080F add r16,r24
144:level3.c ****
145:level3.c **** Compute_Timeouts( );
377 .stabn 68,0,145,.LM54-Send
378 .LM54:
379 0120 D1DF rcall Compute_Timeouts
146:level3.c ****
147:level3.c **** ClearCaptureBuffers( );
380 .stabn 68,0,147,.LM55-Send
381 .LM55:
382 0122 00D0 rcall ClearCaptureBuffers
148:level3.c ****
149:level3.c **** maxCaptureTime = ScaleTime( maxTGeneral );
383 .stabn 68,0,149,.LM56-Send
384 .LM56:
385 0124 8091 0000 lds r24,maxTGeneral
386 0128 9091 0000 lds r25,(maxTGeneral)+1
387 012c C8D0 rcall ScaleTime
388 012e 8093 0000 sts maxCaptureTime,r24
150:level3.c ****
151:level3.c **** SendForward( fwd_bit_count );
389 .stabn 68,0,151,.LM57-Send
390 .LM57:
391 0132 802F mov r24,r16
392 0134 00D0 rcall SendForward
152:level3.c ****
153:level3.c **** if ( wait_time != 0 )
393 .stabn 68,0,153,.LM58-Send
394 .LM58:
395 0136 E114 cp r14,__zero_reg__
396 0138 F104 cpc r15,__zero_reg__
397 013a 79F0 breq .L17
154:level3.c **** Wait( wait_time );
398 .stabn 68,0,154,.LM59-Send
399 .LM59:
400 013c C701 movw r24,r14
401 013e ADDF rcall Wait
402 0140 0CC0 rjmp .L17
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -