radiocontrol.lst

来自「一个WSN的树状路由,对于那些学WSN路由方面的朋友应该有说帮助.」· LST 代码 · 共 989 行 · 第 1/3 页

LST
989
字号
 594 0244 8091 0000 		lds r24,PreambleCount
 595 0248 8F5F      		subi r24,lo8(-(1))
 596 024a 8093 0000 		sts PreambleCount,r24
 269:radiocontrol.c ****             if (PreambleCount > VALID_PRECURSOR) {			// 接收到足够的导频字节
 598               	.LM92:
 599 024e 8630      		cpi r24,lo8(6)
 600 0250 30F0      		brlo .L34
 270:radiocontrol.c **** 				state = SYNC_START;
 602               	.LM93:
 603 0252 83E0      		ldi r24,lo8(3)
 604 0254 8093 0000 		sts state,r24
 605 0258 02C0      		rjmp .L34
 606               	.L31:
 271:radiocontrol.c **** 			}
 272:radiocontrol.c **** 		} else {
 273:radiocontrol.c **** 			PreambleCount = 0;								// 导频计数置0
 608               	.LM94:
 609 025a 1092 0000 		sts PreambleCount,__zero_reg__
 610               	.L34:
 274:radiocontrol.c **** 		}
 275:radiocontrol.c **** 		if (carrSenTime > 0)	{							// 调用ADC采集监听数据
 612               	.LM95:
 613 025e 8091 0000 		lds r24,carrSenTime
 614 0262 9091 0000 		lds r25,(carrSenTime)+1
 615 0266 892B      		or r24,r25
 616 0268 09F4      		brne .+2
 617 026a 83C0      		rjmp .L22
 276:radiocontrol.c **** 			ADCGetData(OS_ADC_CC_RSSI_PORT);	
 619               	.LM96:
 620 026c 80E0      		ldi r24,lo8(0)
 621 026e 0E94 0000 		call ADCGetData
 622 0272 7FC0      		rjmp .L22
 623               	.L30:
 277:radiocontrol.c ****             }			
 278:radiocontrol.c **** 	} else if (state == SYNC_START) {						// 接收同步字
 625               	.LM97:
 626 0274 8330      		cpi r24,lo8(3)
 627 0276 09F0      		breq .+2
 628 0278 61C0      		rjmp .L37
 629               	.LBB2:
 279:radiocontrol.c **** 		uint8_t i;
 280:radiocontrol.c **** 		if (data == 0xaa || data == 0x55) {
 631               	.LM98:
 632 027a 2A3A      		cpi r18,lo8(-86)
 633 027c 11F0      		breq .L39
 634 027e 2535      		cpi r18,lo8(85)
 635 0280 19F4      		brne .L38
 636               	.L39:
 281:radiocontrol.c **** 			SOFCount = 0;									// 再收到同步字节则丢弃
 638               	.LM99:
 639 0282 1092 0000 		sts SOFCount,__zero_reg__
 640 0286 75C0      		rjmp .L22
 641               	.L38:
 642               	.LBB3:
 282:radiocontrol.c **** 		} else {											// 进行同步
 283:radiocontrol.c ****             uint8_t usTmp;
 284:radiocontrol.c ****             SOFCount++;
 644               	.LM100:
 645 0288 8091 0000 		lds r24,SOFCount
 646 028c 8F5F      		subi r24,lo8(-(1))
 647 028e 8093 0000 		sts SOFCount,r24
 285:radiocontrol.c ****             switch (SOFCount) {
 649               	.LM101:
 650 0292 9927      		clr r25
 651 0294 8230      		cpi r24,2
 652 0296 9105      		cpc r25,__zero_reg__
 653 0298 61F0      		breq .L43
 654 029a 8330      		cpi r24,3
 655 029c 9105      		cpc r25,__zero_reg__
 656 029e 1CF4      		brge .L55
 657 02a0 0197      		sbiw r24,1
 658 02a2 21F0      		breq .L42
 659 02a4 48C0      		rjmp .L54
 660               	.L55:
 661 02a6 0397      		sbiw r24,3
 662 02a8 C9F0      		breq .L46
 663 02aa 45C0      		rjmp .L54
 664               	.L42:
 286:radiocontrol.c ****             case 1:
 287:radiocontrol.c **** 				RxShiftBuf.MSB = data;
 666               	.LM102:
 667 02ac 2093 0000 		sts RxShiftBuf+1,r18
 288:radiocontrol.c **** 				break;
 669               	.LM103:
 670 02b0 60C0      		rjmp .L22
 671               	.L43:
 289:radiocontrol.c ****             case 2:
 290:radiocontrol.c **** 				RxShiftBuf.LSB = data;
 673               	.LM104:
 674 02b2 2093 0000 		sts RxShiftBuf,r18
 291:radiocontrol.c **** 				if (RxShiftBuf.W == SYNC_WORD) {
 676               	.LM105:
 677 02b6 8091 0000 		lds r24,RxShiftBuf
 678 02ba 9091 0000 		lds r25,(RxShiftBuf)+1
 679 02be 8C5C      		subi r24,lo8(13260)
 680 02c0 9343      		sbci r25,hi8(13260)
 681 02c2 09F0      		breq .+2
 682 02c4 56C0      		rjmp .L22
 292:radiocontrol.c **** 					state = RECEIVE;
 684               	.LM106:
 685 02c6 84E0      		ldi r24,lo8(4)
 686 02c8 8093 0000 		sts state,r24
 293:radiocontrol.c **** 					RxBitOffset = 0;						// 通知上层检测到起始符号且同步完成
 688               	.LM107:
 689 02cc 1092 0000 		sts RxBitOffset,__zero_reg__
 294:radiocontrol.c **** 					if (PhysicalStartSymDetected() == FAIL) {
 691               	.LM108:
 692 02d0 0E94 0000 		call PhysicalStartSymDetected
 693 02d4 8823      		tst r24
 694 02d6 09F0      		breq .+2
 695 02d8 4CC0      		rjmp .L22
 696 02da 2DC0      		rjmp .L54
 697               	.L46:
 295:radiocontrol.c **** 						RadiocontrolIdle();
 296:radiocontrol.c **** 					}
 297:radiocontrol.c **** 				} 
 298:radiocontrol.c **** 				break;            
 299:radiocontrol.c ****             case 3: 
 300:radiocontrol.c **** 				usTmp = data;
 699               	.LM109:
 700 02dc 322F      		mov r19,r18
 301:radiocontrol.c **** 				for(i = 0; i < 8; i++) {
 702               	.LM110:
 703 02de 40E0      		ldi r20,lo8(0)
 704               	.L53:
 302:radiocontrol.c **** 					RxShiftBuf.W <<= 1;
 706               	.LM111:
 707 02e0 8091 0000 		lds r24,RxShiftBuf
 708 02e4 9091 0000 		lds r25,(RxShiftBuf)+1
 709 02e8 880F      		lsl r24
 710 02ea 991F      		rol r25
 711 02ec 9093 0000 		sts (RxShiftBuf)+1,r25
 712 02f0 8093 0000 		sts RxShiftBuf,r24
 303:radiocontrol.c **** 					if(usTmp & 0x80)
 714               	.LM112:
 715 02f4 37FF      		sbrs r19,7
 716 02f6 05C0      		rjmp .L50
 304:radiocontrol.c **** 						RxShiftBuf.W |= 0x1;
 718               	.LM113:
 719 02f8 8160      		ori r24,lo8(1)
 720 02fa 9093 0000 		sts (RxShiftBuf)+1,r25
 721 02fe 8093 0000 		sts RxShiftBuf,r24
 722               	.L50:
 305:radiocontrol.c **** 					usTmp <<= 1;
 724               	.LM114:
 725 0302 330F      		lsl r19
 306:radiocontrol.c **** 					if (RxShiftBuf.W == SYNC_WORD) {
 727               	.LM115:
 728 0304 8091 0000 		lds r24,RxShiftBuf
 729 0308 9091 0000 		lds r25,(RxShiftBuf)+1
 730 030c 8C5C      		subi r24,lo8(13260)
 731 030e 9343      		sbci r25,hi8(13260)
 732 0310 71F4      		brne .L49
 307:radiocontrol.c **** 						state = RECEIVE;
 734               	.LM116:
 735 0312 84E0      		ldi r24,lo8(4)
 736 0314 8093 0000 		sts state,r24
 308:radiocontrol.c **** 						RxBitOffset = 7-i;
 738               	.LM117:
 739 0318 87E0      		ldi r24,lo8(7)
 740 031a 841B      		sub r24,r20
 741 031c 8093 0000 		sts RxBitOffset,r24
 309:radiocontrol.c **** 						RxShiftBuf.LSB = data;				// 通知上层检测到起始符号且同步完成
 743               	.LM118:
 744 0320 2093 0000 		sts RxShiftBuf,r18
 310:radiocontrol.c **** 						if (PhysicalStartSymDetected() == FAIL) {
 746               	.LM119:
 747 0324 0E94 0000 		call PhysicalStartSymDetected
 748 0328 8823      		tst r24
 749 032a 19F5      		brne .L22
 750 032c 04C0      		rjmp .L54
 751               	.L49:
 753               	.LM120:
 754 032e 4F5F      		subi r20,lo8(-(1))
 755 0330 4830      		cpi r20,lo8(8)
 756 0332 B0F2      		brlo .L53
 311:radiocontrol.c **** 							RadiocontrolIdle();
 312:radiocontrol.c **** 						}
 313:radiocontrol.c **** 						break;
 314:radiocontrol.c **** 					}
 315:radiocontrol.c **** 				}
 316:radiocontrol.c **** 				break;
 758               	.LM121:
 759 0334 1EC0      		rjmp .L22
 760               	.L54:
 317:radiocontrol.c ****             default:
 318:radiocontrol.c **** 				RadiocontrolIdle();
 762               	.LM122:
 763 0336 0E94 0000 		call RadiocontrolIdle
 764               	.LBE3:
 765               	.LBE2:
 319:radiocontrol.c **** 				break;
 767               	.LM123:
 768 033a 1BC0      		rjmp .L22
 769               	.L37:
 320:radiocontrol.c ****             }
 321:radiocontrol.c **** 		}
 322:radiocontrol.c **** 	}else if (state == RECEIVE) {							// 根据偏移量接收数据
 771               	.LM124:
 772 033c 8430      		cpi r24,lo8(4)
 773 033e C9F4      		brne .L22
 774               	.LBB4:
 323:radiocontrol.c **** 		char Byte;
 324:radiocontrol.c **** 		RxShiftBuf.W <<=8;									// 移去已经接收的字节
 776               	.LM125:
 777 0340 8091 0000 		lds r24,RxShiftBuf
 778 0344 9091 0000 		lds r25,(RxShiftBuf)+1
 779 0348 982F      		mov r25,r24
 780 034a 8827      		clr r24
 781 034c 9093 0000 		sts (RxShiftBuf)+1,r25
 782 0350 8093 0000 		sts RxShiftBuf,r24
 325:radiocontrol.c **** 		RxShiftBuf.LSB = data;								// 存入刚刚收到的字节到低八位
 784               	.LM126:
 785 0354 2093 0000 		sts RxShiftBuf,r18
 326:radiocontrol.c **** 		Byte = (RxShiftBuf.W >> RxBitOffset);				// 根据偏移量取出字节
 787               	.LM127:
 788 0358 8091 0000 		lds r24,RxShiftBuf
 789 035c 9091 0000 		lds r25,(RxShiftBuf)+1
 790 0360 0090 0000 		lds r0,RxBitOffset
 791 0364 02C0      		rjmp 2f
 792 0366 9695      	1:	lsr r25
 793 0368 8795      		ror r24
 794 036a 0A94      	2:	dec r0
 795 036c E2F7      		brpl 1b
 327:radiocontrol.c **** 
 328:radiocontrol.c **** 		PhysicalRxByteDone(Byte);							// 通知上层处理接收到的字节
 797               	.LM128:
 798 036e 0E94 0000 		call PhysicalRxByteDone
 799               	.L22:
 800               	.LBE4:
 801               	/* epilogue: frame size=0 */
 802 0372 FF91      		pop r31
 803 0374 EF91      		pop r30
 804 0376 BF91      		pop r27
 805 0378 AF91      		pop r26
 806 037a 9F91      		pop r25
 807 037c 8F91      		pop r24
 808 037e 7F91      		pop r23
 809 0380 6F91      		pop r22
 810 0382 5F91      		pop r21
 811 0384 4F91      		pop r20
 812 0386 3F91      		pop r19
 813 0388 2F91      		pop r18
 814 038a 0F90      		pop __tmp_reg__
 815 038c 0FBE      		out __SREG__,__tmp_reg__
 816 038e 0F90      		pop __tmp_reg__
 817 0390 1F90      		pop __zero_reg__
 818 0392 1895      		reti
 819               	/* epilogue end (size=17) */
 820               	/* function __vector_17 size 236 (202) */
 829               		.comm RecordPassed,30,1
 830               		.lcomm state,1
 831               		.lcomm carrSenTime,2
 832               		.lcomm backofftime,2
 833               		.lcomm idlecount,1
 834               		.lcomm sendslot,1
 835               		.lcomm csVal1,2
 836               		.lcomm csValAve,2
 837               		.lcomm nextByte,1
 838               		.lcomm txCount,1
 839               		.lcomm bManchesterBad,1
 840               		.lcomm bInvertRxData,1
 841               		.lcomm PreambleCount,1
 842               		.lcomm SOFCount,1
 843               		.comm RxShiftBuf,2,1
 844               		.lcomm RxBitOffset,1
 862               		.text
 864               	Letext:
 865               	/* File "radiocontrol.c": code  465 = 0x01d1 ( 424), prologues  17, epilogues  24 */
DEFINED SYMBOLS
                            *ABS*:00000000 radiocontrol.c
                            *ABS*:0000003f __SREG__
                            *ABS*:0000003e __SP_H__
                            *ABS*:0000003d __SP_L__
                            *ABS*:00000000 __tmp_reg__
                            *ABS*:00000001 __zero_reg__
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:96     .data:00000000 start
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:103    .text:00000000 RadiocontrolIdle
                             .bss:00000000 state
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:161    .text:00000034 RadiocontrolInit
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:831    .bss:00000003 backofftime
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:830    .bss:00000001 carrSenTime
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:832    .bss:00000005 idlecount
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:833    .bss:00000006 sendslot
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:839    .bss:0000000e bInvertRxData
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:220    .text:0000007c RadiocontrolSleep
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:254    .text:00000096 RadiocontrolCarrierSenseStart
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:834    .bss:00000007 csVal1
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:322    .text:000000f4 RadiocontrolRSSIADCDataReady
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:835    .bss:00000009 csValAve
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:416    .text:00000182 RadiocontrolStartTx
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:836    .bss:0000000b nextByte
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:837    .bss:0000000c txCount
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:478    .text:000001bc RadiocontrolTxNextByte
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:498    .text:000001c6 __vector_17
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:838    .bss:0000000d bManchesterBad
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:840    .bss:0000000f PreambleCount
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:841    .bss:00000010 SOFCount
                            *COM*:00000002 RxShiftBuf
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:842    .bss:00000011 RxBitOffset
                            *COM*:0000001e RecordPassed
D:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccc3aaaa.s:864    .text:00000394 Letext

UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
CC1000ControlStdControlStart
CC1000ControlRxMode
OSH_MAKE_MISO_INPUT
OSH_MAKE_MOSI_INPUT
OSH_MAKE_SPI_SCK_INPUT
CC1000ControlStdControlInit
CC1000ControlSelectLock
CC1000ControlGetLOStatus
ADCBindPort
ADCControlInit
CC1000ControlStdControlStop
RandomLFSRGen
__udivmodhi4
MACChannelBusy
MACChannelIdle
CC1000ControlTxMode
OSH_MAKE_MISO_OUTPUT
OSH_MAKE_MOSI_OUTPUT
PhysicalTxByteReady
ADCGetData
PhysicalStartSymDetected
PhysicalRxByteDone

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?