⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 systime.lst

📁 无线传感器星型网络的节点的基站程序,采用802.15.4协议
💻 LST
📖 第 1 页 / 共 4 页
字号:
 485 00c2 1F93      		push r17
 486               	/* prologue end (size=4) */
 487 00c4 7B01      		movw r14,r22
 488 00c6 8C01      		movw r16,r24
 140:systime.c     ****        uint32_t temp;
 141:systime.c     **** 	uint16_t  tcnt_1;
 142:systime.c     **** 	//tcnt_1=TCNT1;
 143:systime.c     **** 	//printf("\nthe current TCNT1 is %04x",tcnt_1);
 144:systime.c     **** 	//printf("\nthe current interval is %04x",interval);
 145:systime.c     ****        //temp=(uint32_t)interval;
 146:systime.c     **** 	temp=(interval<<1)+systime32();   
 490               	.LM42:
 491 00c8 EE0C      		lsl r14
 492 00ca FF1C      		rol r15
 493 00cc 001F      		rol r16
 494 00ce 111F      		rol r17
 495 00d0 0E94 0000 		call systime32
 496 00d4 DC01      		movw r26,r24
 497 00d6 CB01      		movw r24,r22
 498 00d8 E80E      		add r14,r24
 499 00da F91E      		adc r15,r25
 500 00dc 0A1F      		adc r16,r26
 501 00de 1B1F      		adc r17,r27
 147:systime.c     **** 	//printf("\nthe current temp is %08lx",systime32());   
 148:systime.c     **** 	// (temp>=65535) temp=temp-65535;
 149:systime.c     **** 	return (temp);
 150:systime.c     **** }
 503               	.LM43:
 504 00e0 C801      		movw r24,r16
 505 00e2 B701      		movw r22,r14
 506               	/* epilogue: frame size=0 */
 507 00e4 1F91      		pop r17
 508 00e6 0F91      		pop r16
 509 00e8 FF90      		pop r15
 510 00ea EF90      		pop r14
 511 00ec 0895      		ret
 512               	/* epilogue end (size=5) */
 513               	/* function Timer1_acquireInterval size 25 (16) */
 517               	.global	Timer1_adjustInterval
 519               	Timer1_adjustInterval:
 151:systime.c     **** 
 152:systime.c     **** uint8_t    Timer1_adjustInterval(uint16_t interval)
 153:systime.c     **** {
 521               	.LM44:
 522               	/* prologue: frame size=0 */
 523 00ee 0F93      		push r16
 524 00f0 1F93      		push r17
 525               	/* prologue end (size=2) */
 526 00f2 8C01      		movw r16,r24
 527               	.LBB6:
 154:systime.c     ****    { os_atomic_t _nesc_atomic = os_atomic_start();
 529               	.LM45:
 530 00f4 0E94 0000 		call os_atomic_start
 155:systime.c     ****      {
 156:systime.c     **** 	//if(interval<65536)
 157:systime.c     **** 	  	OCR1A = interval;//this is the scale
 532               	.LM46:
 533 00f8 1BBD      		out (74)+1-0x20,r17
 534 00fa 0ABD      		out 74-0x20,r16
 158:systime.c     **** 	//else
 159:systime.c     **** 	//  	OCR1A =interval-65535;
 160:systime.c     ****      }
 161:systime.c     ****     os_atomic_end(_nesc_atomic); }

 536               	.LM47:
 537 00fc 0E94 0000 		call os_atomic_end
 538               	.LBE6:
 162:systime.c     ****     return 1;
 163:systime.c     **** }
 164:systime.c     **** //供底层调用获得定时器比较寄存器应当设置的值,下一个定时任务
 540               	.LM48:
 541 0100 81E0      		ldi r24,lo8(1)
 542 0102 90E0      		ldi r25,hi8(1)
 543               	/* epilogue: frame size=0 */
 544 0104 1F91      		pop r17
 545 0106 0F91      		pop r16
 546 0108 0895      		ret
 547               	/* epilogue end (size=3) */
 548               	/* function Timer1_adjustInterval size 14 (9) */
 551               	.global	Timer1_getnextInterval
 553               	Timer1_getnextInterval:
 165:systime.c     **** uint16_t  Timer1_getnextInterval(void)
 166:systime.c     **** {
 167:systime.c     ****      //返回定时器下一个定时值
 555               	.LM49:
 556               	/* prologue: frame size=0 */
 557               	/* prologue end (size=0) */
 168:systime.c     ****      //如果没有,则返回零
 169:systime.c     ****      systimer_queue_pointer  temp;
 170:systime.c     ****      temp=head_of_systimer_queue->next;
 171:systime.c     ****      if(temp!=NULL) 
 559               	.LM50:
 560 010a E091 0000 		lds r30,head_of_systimer_queue
 561 010e F091 0000 		lds r31,(head_of_systimer_queue)+1
 562 0112 0784      		ldd __tmp_reg__,Z+15
 563 0114 F089      		ldd r31,Z+16
 564 0116 E02D      		mov r30,__tmp_reg__
 172:systime.c     ****      	{//printf("temp is %04x\n",temp->ticks);
 566               	.LM51:
 567 0118 3097      		sbiw r30,0
 568 011a 19F0      		breq .L13
 173:systime.c     **** 	 return (temp->ticks);
 174:systime.c     ****      	}
 570               	.LM52:
 571 011c 8181      		ldd r24,Z+1
 572 011e 9281      		ldd r25,Z+2
 573 0120 0895      		ret
 574               	.L13:
 175:systime.c     ****      else
 176:systime.c     **** 	 return 0;
 177:systime.c     **** }
 576               	.LM53:
 577 0122 CF01      		movw r24,r30
 178:systime.c     **** 
 579               	.LM54:
 580 0124 0895      		ret
 581               	/* epilogue: frame size=0 */
 582 0126 0895      		ret
 583               	/* epilogue end (size=1) */
 584               	/* function Timer1_getnextInterval size 15 (14) */
 591               	.global	systimer_start_task
 593               	systimer_start_task:
 179:systime.c     **** //---------------------------------------------------------------------------
 180:systime.c     **** //   change timer1 to be systimer,time3 for other usage.  modified by zhouqiang in2005.12.04
 181:systime.c     **** //             add a timequeue here for tasks,such as receive or transmit a beacon 
 182:systime.c     **** //---------------------------------------------------------------------------
 183:systime.c     **** systimer_queue_pointer  systimer_start_task(systimer_queue_pointer queue_head,uint8_t  timer_reason
 184:systime.c     **** {
 185:systime.c     **** 	 systimer_queue_pointer   temp;
 595               	.LM55:
 596               	/* prologue: frame size=0 */
 597 0128 2F92      		push r2
 598 012a 3F92      		push r3
 599 012c 4F92      		push r4
 600 012e 5F92      		push r5
 601 0130 6F92      		push r6
 602 0132 7F92      		push r7
 603 0134 8F92      		push r8
 604 0136 9F92      		push r9
 605 0138 AF92      		push r10
 606 013a BF92      		push r11
 607 013c CF92      		push r12
 608 013e DF92      		push r13
 609 0140 EF92      		push r14
 610 0142 FF92      		push r15
 611 0144 0F93      		push r16
 612 0146 1F93      		push r17
 613 0148 CF93      		push r28
 614 014a DF93      		push r29
 615               	/* prologue end (size=18) */
 616 014c 3C01      		movw r6,r24
 617 014e 162F      		mov r17,r22
 618 0150 1901      		movw r2,r18
 619 0152 2A01      		movw r4,r20
 186:systime.c     **** 	 systimer_queue_pointer   p_temp1,p_temp2;
 187:systime.c     **** 	 uint32_t  compare_reg;
 188:systime.c     **** 	 uint32_t  temp_time;
 189:systime.c     **** 	    temp=(systimer_queue_pointer)malloc(sizeof(struct systimer_queue));
 190:systime.c     **** 	    temp->next=NULL;
 621               	.LM56:
 622 0154 81E1      		ldi r24,lo8(17)
 623 0156 90E0      		ldi r25,hi8(17)
 624 0158 0E94 0000 		call malloc
 625 015c 4C01      		movw r8,r24
 191:systime.c     **** 	    temp->timer_reason=timer_reason;
 627               	.LM57:
 628 015e FC01      		movw r30,r24
 629 0160 1786      		std Z+15,__zero_reg__
 630 0162 108A      		std Z+16,__zero_reg__
 192:systime.c     ****       	 if(queue_head==NULL)	   
 632               	.LM58:
 633 0164 1083      		st Z,r17
 193:systime.c     **** 	 	{
 635               	.LM59:
 636 0166 6114      		cp r6,__zero_reg__
 637 0168 7104      		cpc r7,__zero_reg__
 638 016a 89F5      		brne .L16
 194:systime.c     **** 	 	     compare_reg=Timer1_acquireInterval(ticks);
 195:systime.c     **** 		     //printf("\n******* the compare reg is %08lx",compare_reg);	 
 640               	.LM60:
 641 016c C201      		movw r24,r4
 642 016e B101      		movw r22,r2
 643 0170 0E94 0000 		call Timer1_acquireInterval
 644 0174 7B01      		movw r14,r22
 645 0176 8C01      		movw r16,r24
 196:systime.c     **** 		     if(compare_reg<65535)
 197:systime.c     **** 			 	Timer1_setInterval((uint16_t)compare_reg);
 647               	.LM61:
 648 0178 6F3F      		cpi r22,lo8(65535)
 649 017a FFEF      		ldi r31,hi8(65535)
 650 017c 7F07      		cpc r23,r31
 651 017e F0E0      		ldi r31,hlo8(65535)
 652 0180 8F07      		cpc r24,r31
 653 0182 F0E0      		ldi r31,hhi8(65535)
 654 0184 9F07      		cpc r25,r31
 655 0186 10F4      		brsh .L17
 198:systime.c     **** 		     else  
 657               	.LM62:
 658 0188 CB01      		movw r24,r22
 659 018a 0BC0      		rjmp .L30
 660               	.L17:
 199:systime.c     **** 		     	{
 200:systime.c     **** 		     	   temp_time=compare_reg&0x0000ffff;
 201:systime.c     **** 			   //printf("\n******* the real compare reg is %04x",(uint16_t)(temp_time));	   
 662               	.LM63:
 663 018c 2FEF      		ldi r18,lo8(65535)
 664 018e A22E      		mov r10,r18
 665 0190 2FEF      		ldi r18,hi8(65535)
 666 0192 B22E      		mov r11,r18
 667 0194 C12C      		mov r12,__zero_reg__
 668 0196 D12C      		mov r13,__zero_reg__
 669 0198 A622      		and r10,r22
 670 019a B722      		and r11,r23
 671 019c C822      		and r12,r24
 672 019e D922      		and r13,r25
 202:systime.c     **** 			   Timer1_setInterval((uint16_t)(temp_time));
 203:systime.c     **** 		     	}
 674               	.LM64:
 675 01a0 C501      		movw r24,r10
 676               	.L30:
 677 01a2 0E94 0000 		call Timer1_setInterval
 204:systime.c     **** 		     temp->ticks=(uint16_t)((compare_reg>65535)? ((uint16_t)(temp_time)):compare_reg);
 205:systime.c     ****                    temp->ticksLeft=compare_reg;
 679               	.LM65:
 680 01a6 80E0      		ldi r24,lo8(65536)
 681 01a8 E816      		cp r14,r24
 682 01aa 80E0      		ldi r24,hi8(65536)
 683 01ac F806      		cpc r15,r24
 684 01ae 81E0      		ldi r24,hlo8(65536)
 685 01b0 0807      		cpc r16,r24
 686 01b2 80E0      		ldi r24,hhi8(65536)
 687 01b4 1807      		cpc r17,r24
 688 01b6 10F0      		brlo .L19
 689 01b8 C501      		movw r24,r10
 690 01ba 01C0      		rjmp .L20
 691               	.L19:
 692 01bc C701      		movw r24,r14
 693               	.L20:
 694 01be F401      		movw r30,r8
 695 01c0 8183      		std Z+1,r24
 696 01c2 9283      		std Z+2,r25
 206:systime.c     **** 		     //temp->high_left=compare_reg&0xc0000000;
 698               	.LM66:
 699 01c4 E382      		std Z+3,r14
 700 01c6 F482      		std Z+4,r15
 701 01c8 0583      		std Z+5,r16
 702 01ca 1683      		std Z+6,r17
 703 01cc 59C0      		rjmp .L31
 704               	.L16:
 207:systime.c     **** 			 //printf("\n high left is %08lx",temp->high_left);
 208:systime.c     **** 		     //temp->high_ticks=compare_reg&0xc0000000;
 209:systime.c     ****  	    	     queue_head=temp;	
 210:systime.c     **** 		     //printf("\nhead ticks is %04x,ticksleft is %08lx,reason is %02x,head->reason is %02x\n",tem
 211:systime.c     **** 		}
 212:systime.c     ****         else
 213:systime.c     **** 		{
 214:systime.c     **** 	              //插入到定时队列中去,按temp->ticks的顺序
 215:systime.c     ****                    compare_reg=Timer1_acquireInterval(ticks);
 216:systime.c     **** 		     
 706               	.LM67:
 707 01ce C201      		movw r24,r4
 708 01d0 B101      		movw r22,r2
 709 01d2 0E94 0000 		call Timer1_acquireInterval
 710 01d6 7B01      		movw r14,r22
 711 01d8 8C01      		movw r16,r24
 217:systime.c     **** 		     //printf("\n----compare-reg is %08lx\n",compare_reg);
 218:systime.c     **** 		     temp_time=compare_reg&0x0000ffff;
 219:systime.c     **** 		     temp->ticks=(uint16_t)((compare_reg>65535)? ((uint16_t)(temp_time)):compare_reg);
 713               	.LM68:
 714 01da 9FEF      		ldi r25,lo8(65535)
 715 01dc A92E      		mov r10,r25
 716 01de 9FEF      		ldi r25,hi8(65535)
 717 01e0 B92E      		mov r11,r25
 718 01e2 C12C      		mov r12,__zero_reg__
 719 01e4 D12C      		mov r13,__zero_reg__
 720 01e6 AE20      		and r10,r14
 721 01e8 BF20      		and r11,r15
 722 01ea C022      		and r12,r16
 723 01ec D122      		and r13,r17
 220:systime.c     ****                    temp->ticksLeft=compare_reg;
 725               	.LM69:
 726 01ee F0E0      		ldi r31,lo8(65536)
 727 01f0 EF16      		cp r14,r31
 728 01f2 F0E0      		ldi r31,hi8(65536)
 729 01f4 FF06      		cpc r15,r31
 730 01f6 F1E0      		ldi r31,hlo8(65536)
 731 01f8 0F07      		cpc r16,r31
 732 01fa F0E0      		ldi r31,hhi8(65536)
 733 01fc 1F07      		cpc r17,r31
 734 01fe 10F0      		brlo .L22
 735 0200 C501      		movw r24,r10
 736 0202 01C0      		rjmp .L23
 737               	.L22:
 738 0204 C701      		movw r24,r14
 739               	.L23:
 740 0206 F401      		movw r30,r8
 741 0208 8183      		std Z+1,r24
 742 020a 9283      		std Z+2,r25
 221:systime.c     **** 		     //temp->high_left=compare_reg&0xc0000000;
 744               	.LM70:
 745 020c E382      		std Z+3,r14
 746 020e F482      		std Z+4,r15
 747 0210 0583      		std Z+5,r16
 748 0212 1683      		std Z+6,r17
 222:systime.c     **** 		     //temp->high_ticks=compare_reg&0xc0000000;
 223:systime.c     **** 	            p_temp1=queue_head;
 224:systime.c     ****                    p_temp2=queue_head;
 750               	.LM71:
 751 0214 6301      		movw r12,r6
 225:systime.c     **** 			/*while(((temp->high_left)>=(p_temp2->high_left))&&(p_temp2!=NULL))
 753               	.LM72:
 754 0216 E301      		movw r28,r6
 226:systime.c     **** 				{
 227:systime.c     **** 				    if((((temp->ticksLeft)&0x3fffffff)<=((p_temp2->ticksLeft)&0x3fffffff))&&((temp->high_left)=
 228:systime.c     **** 				    	{
 229:systime.c     **** 				    	    break;
 230:systime.c     **** 				    	}
 231:systime.c     **** 				   else*/
 232:systime.c     **** 			while((p_temp2!=NULL)&&((temp->ticksLeft)>=(p_temp2->ticksLeft))&&(p_temp2!=NULL))	   
 233:systime.c     **** 				      {
 234:systime.c     **** 				          p_temp1=p_temp2;
 235:systime.c     **** 				          p_temp2=p_temp1->next;	
 236:systime.c     **** 				    	}		  
 756               	.LM73:
 757 0218 6114      		cp r6,__zero_reg__
 758 021a 7104      		cpc r7,__zero_reg__
 759 021c E9F0      		breq .L25
 760 021e 8B81      		ldd r24,Y+3
 761 0220 9C81      		ldd r25,Y+4
 762 0222 AD81      		ldd r26,Y+5
 763 0224 BE81      		ldd r27,Y+6
 764 0226 E816      		cp r14,r24
 765 0228 F906      		cpc r15,r25
 766 022a 0A07      		cpc r16,r26
 767 022c 1B07      		cpc r17,r27
 768 022e A0F0      		brlo .L25
 769               	.L26:
 771               	.LM74:
 772 0230 6E01      		movw r12,r28
 774               	.LM75:

⌨️ 快捷键说明

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