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

📄 timer3.lst

📁 无线传感器星型网络的节点的基站程序,采用802.15.4协议
💻 LST
📖 第 1 页 / 共 2 页
字号:
   1               		.file	"timer3.c"
   2               		.arch atmega128
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  11               		.text
  12               	.Ltext0:
 223               	.global	Timer3_intDisable
 225               	Timer3_intDisable:
   1:timer3.c      **** //----------------------------------------------------//
   2:timer3.c      **** //-------Institute Of  Computing Technology-----------//
   3:timer3.c      **** //------------Chinese Academic  Science---------------//
   4:timer3.c      **** //-----中国科学院计算技术研究所先进测试技术实验室-----//
   5:timer3.c      **** //----------------------------------------------------//
   6:timer3.c      **** 
   7:timer3.c      **** /**
   8:timer3.c      ****  * @copyright:nbicc_lpp
   9:timer3.c      ****  * @this is timer1 driver code
  10:timer3.c      ****  * @author liulingyi      (lingyiliu@ict.ac.cn)
  11:timer3.c      ****  *         zhouqiang      (zhouhongren@163.com)
  12:timer3.c      ****  *              
  13:timer3.c      ****  * @data:2005.11.28
  14:timer3.c      ****  * @version:0.0.1
  15:timer3.c      ****  * @updata:$
  16:timer3.c      ****  *
  17:timer3.c      ****  */
  18:timer3.c      **** 
  19:timer3.c      ****  #include "timer3.h"
  20:timer3.c      **** 
  21:timer3.c      **** extern  uint16_t  timer3queue_getnextinterval(void);
  22:timer3.c      **** extern  void  timer3queue_interrupt(void);
  23:timer3.c      **** 
  24:timer3.c      ****  void Timer3_intDisable(void)
  25:timer3.c      ****  {
 227               	.LM1:
 228               	/* prologue: frame size=0 */
 229               	/* prologue end (size=0) */
 230               	.LBB2:
  26:timer3.c      ****       { os_atomic_t _nesc_atomic = os_atomic_start();
 232               	.LM2:
 233 0000 0E94 0000 		call os_atomic_start
  27:timer3.c      ****        	{
  28:timer3.c      **** 	 ETIMSK &= 0xef;
 235               	.LM3:
 236 0004 9091 7D00 		lds r25,125
 237 0008 9F7E      		andi r25,lo8(-17)
 238 000a 9093 7D00 		sts 125,r25
  29:timer3.c      **** 	 //TCCR3B = 5;
  30:timer3.c      **** 	 //OCR3A=0;
  31:timer3.c      **** 	 //TCNT3 = 0x0000;
  32:timer3.c      **** 	 //TCCR3B=0x00;
  33:timer3.c      **** 	ETIFR |=(1<<OCF3A);
 240               	.LM4:
 241 000e 9091 7C00 		lds r25,124
 242 0012 9061      		ori r25,lo8(16)
 243 0014 9093 7C00 		sts 124,r25
  34:timer3.c      **** 	 
  35:timer3.c      **** 	}
  36:timer3.c      ****       os_atomic_end(_nesc_atomic); }        	
 245               	.LM5:
 246 0018 0E94 0000 		call os_atomic_end
 247               	.LBE2:
 248               	/* epilogue: frame size=0 */
 249 001c 0895      		ret
 250               	/* epilogue end (size=1) */
 251               	/* function Timer3_intDisable size 15 (14) */
 254               	.global	Timer3_fire
 256               	Timer3_fire:
  37:timer3.c      ****  }
  38:timer3.c      **** 
  39:timer3.c      **** uint8_t  Timer3_fire(void)
  40:timer3.c      **** {
 258               	.LM6:
 259               	/* prologue: frame size=0 */
 260               	/* prologue end (size=0) */
  41:timer3.c      ****           timer3queue_interrupt();
 262               	.LM7:
 263 001e 0E94 0000 		call timer3queue_interrupt
 264               	/* epilogue: frame size=0 */
 265 0022 0895      		ret
 266               	/* epilogue end (size=1) */
 267               	/* function Timer3_fire size 3 (2) */
 269               		.data
 270               	.LC0:
 271 0000 0A73 6361 		.string	"\nscale is out of scope\n"
 271      6C65 2069 
 271      7320 6F75 
 271      7420 6F66 
 271      2073 636F 
 272               		.text
 276               	.global	Timer3_setIntervalAndScale
 278               	Timer3_setIntervalAndScale:
  42:timer3.c      ****          //OS_post(timer3queue_interrupt);
  43:timer3.c      **** }
  44:timer3.c      **** 
  45:timer3.c      **** uint8_t  Timer3_setIntervalAndScale(uint16_t interval, uint8_t scale)
  46:timer3.c      **** {
 280               	.LM8:
 281               	/* prologue: frame size=0 */
 282 0024 1F93      		push r17
 283 0026 CF93      		push r28
 284 0028 DF93      		push r29
 285               	/* prologue end (size=3) */
 286 002a EC01      		movw r28,r24
 287 002c 162F      		mov r17,r22
  47:timer3.c      ****     if (scale > 7) {
 289               	.LM9:
 290 002e 6830      		cpi r22,lo8(8)
 291 0030 28F0      		brlo .L4
  48:timer3.c      ****           error("\nscale is out of scope\n");
 293               	.LM10:
 294 0032 80E0      		ldi r24,lo8(.LC0)
 295 0034 90E0      		ldi r25,hi8(.LC0)
 296 0036 0E94 0000 		call error
  49:timer3.c      ****           return 0;
 298               	.LM11:
 299 003a 24C0      		rjmp .L3
 300               	.L4:
 301               	.LBB3:
  50:timer3.c      ****     }
  51:timer3.c      **** //uint16_t  temp_test_tnt3;
  52:timer3.c      **** //uint32_t  sys_time;
  53:timer3.c      **** { os_atomic_t _nesc_atomic = os_atomic_start();
 303               	.LM12:
 304 003c 0E94 0000 		call os_atomic_start
  54:timer3.c      ****     {
  55:timer3.c      ****        //temp_test_tnt3=TCNT3 ;
  56:timer3.c      **** 	ETIFR |=(1<<OCF3A);   
 306               	.LM13:
 307 0040 9091 7C00 		lds r25,124
 308 0044 9061      		ori r25,lo8(16)
 309 0046 9093 7C00 		sts 124,r25
  57:timer3.c      **** 	OCR3A = interval;//this is the scale
 311               	.LM14:
 312 004a D093 8700 		sts (134)+1,r29
 313 004e C093 8600 		sts 134,r28
  58:timer3.c      **** 	OCR3B = 0x0000;
 315               	.LM15:
 316 0052 1092 8500 		sts (132)+1,__zero_reg__
 317 0056 1092 8400 		sts 132,__zero_reg__
  59:timer3.c      **** 	OCR3C = 0x0000;
 319               	.LM16:
 320 005a 1092 8300 		sts (130)+1,__zero_reg__
 321 005e 1092 8200 		sts 130,__zero_reg__
  60:timer3.c      **** 	TCNT3 = 0x0000; //this is the counter
 323               	.LM17:
 324 0062 1092 8900 		sts (136)+1,__zero_reg__
 325 0066 1092 8800 		sts 136,__zero_reg__
  61:timer3.c      **** 	TCCR3A = 0x00;//Output: A: Disconnected, B: Disconnected, C: Disconnected,WGM[1..0]=00
 327               	.LM18:
 328 006a 1092 8B00 		sts 139,__zero_reg__
  62:timer3.c      **** 	//scale |= 0x08;//
  63:timer3.c      **** 	TCCR3B = scale;//clk/(scale),WGM[3..2]=01
 330               	.LM19:
 331 006e 1093 8A00 		sts 138,r17
  64:timer3.c      **** 	TCCR3C = 0x00;//
 333               	.LM20:
 334 0072 1092 8C00 		sts 140,__zero_reg__
  65:timer3.c      **** 	ETIMSK |= 0x10;//OCIE1A is enable 
 336               	.LM21:
 337 0076 9091 7D00 		lds r25,125
 338 007a 9061      		ori r25,lo8(16)
 339 007c 9093 7D00 		sts 125,r25
  66:timer3.c      **** 	//sys_time=systime32();
  67:timer3.c      ****     }
  68:timer3.c      ****     os_atomic_end(_nesc_atomic); }
 341               	.LM22:
 342 0080 0E94 0000 		call os_atomic_end
 343               	.L3:
 344               	.LBE3:
  69:timer3.c      ****    //printf("\n**TCNT3 is %04x\n",temp_test_tnt3);	 	
  70:timer3.c      ****    //printf("sys time is %08lx",sys_time);
  71:timer3.c      ****   return SUCCESS;
  72:timer3.c      **** }
 346               	.LM23:
 347 0084 80E0      		ldi r24,lo8(0)
 348 0086 90E0      		ldi r25,hi8(0)
 349               	/* epilogue: frame size=0 */
 350 0088 DF91      		pop r29
 351 008a CF91      		pop r28
 352 008c 1F91      		pop r17
 353 008e 0895      		ret
 354               	/* epilogue end (size=4) */
 355               	/* function Timer3_setIntervalAndScale size 54 (47) */
 359               	.global	Timer3_sethalfsymbol
 361               	Timer3_sethalfsymbol:
  73:timer3.c      **** 
  74:timer3.c      **** //供高层调用的定时开始函数。
  75:timer3.c      **** void      Timer3_sethalfsymbol(uint16_t symbols)
  76:timer3.c      **** {
 363               	.LM24:
 364               	/* prologue: frame size=0 */
 365               	/* prologue end (size=0) */
  77:timer3.c      ****       uint32_t halfsymbols;
  78:timer3.c      ****       halfsymbols=((uint32_t)symbols)<<1;
 367               	.LM25:
 368 0090 AA27      		clr r26
 369 0092 BB27      		clr r27
 370 0094 880F      		lsl r24
 371 0096 991F      		rol r25
 372 0098 AA1F      		rol r26
 373 009a BB1F      		rol r27
  79:timer3.c      ****       if(halfsymbols<=65535)	  
 375               	.LM26:
 376 009c 8030      		cpi r24,lo8(65536)
 377 009e 20E0      		ldi r18,hi8(65536)
 378 00a0 9207      		cpc r25,r18
 379 00a2 21E0      		ldi r18,hlo8(65536)
 380 00a4 A207      		cpc r26,r18
 381 00a6 20E0      		ldi r18,hhi8(65536)
 382 00a8 B207      		cpc r27,r18
 383 00aa 10F4      		brsh .L6
  80:timer3.c      ****       Timer3_setIntervalAndScale(halfsymbols, 0x5);
 385               	.LM27:

⌨️ 快捷键说明

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