📄 timer3.lst
字号:
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:
120 .global Timer3_intDisable
122 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 **** * www.wsn.net.cn
9:timer3.c **** * @copyright:nbicc_lpp
10:timer3.c **** * @data:2005.11.22
11:timer3.c **** * @version:0.0.1
12:timer3.c **** * @updata:$
13:timer3.c **** *
14:timer3.c **** */
15:timer3.c **** #include "timer3.h"
16:timer3.c **** // Timer/Counter3 Clock source: System Clock
17:timer3.c **** // Timer/Counter3 Clock value: Set
18:timer3.c **** // Timer/Counter3 Mode: CTC-OCRa
19:timer3.c **** // Timer/Counter3 Output: A: Disconnected, B: Disconnected, C: Disconnected
20:timer3.c ****
21:timer3.c **** //-------------------------------------------------------------------------------
22:timer3.c **** inline void Timer3_intDisable(void)
23:timer3.c **** {
124 .LM1:
125 /* prologue: frame size=0 */
126 /* prologue end (size=0) */
127 .LBB2:
24:timer3.c **** { os_atomic_t _nesc_atomic = os_atomic_start();
129 .LM2:
130 0000 0E94 0000 call os_atomic_start
25:timer3.c **** {
26:timer3.c **** ETIMSK &= 0xef;
132 .LM3:
133 0004 9091 7D00 lds r25,125
134 0008 9F7E andi r25,lo8(-17)
135 000a 9093 7D00 sts 125,r25
27:timer3.c **** }
28:timer3.c **** os_atomic_end(_nesc_atomic); }
137 .LM4:
138 000e 0E94 0000 call os_atomic_end
139 .LBE2:
140 /* epilogue: frame size=0 */
141 0012 0895 ret
142 /* epilogue end (size=1) */
143 /* function Timer3_intDisable size 10 (9) */
145 .data
146 .LC0:
147 0000 2564 0A00 .string "%d\n"
148 .text
150 .global Timer3_fire
152 Timer3_fire:
29:timer3.c **** }
30:timer3.c ****
31:timer3.c ****
32:timer3.c ****
33:timer3.c **** inline uint8_t Timer3_fire(void){
154 .LM5:
155 /* prologue: frame size=0 */
156 /* prologue end (size=0) */
34:timer3.c ****
35:timer3.c **** cc2420_writetxfifo(((demopacket->length)-1), (uint8_t *) demopacket);
158 .LM6:
159 0014 E091 0000 lds r30,demopacket
160 0018 F091 0000 lds r31,(demopacket)+1
161 001c 8081 ld r24,Z
162 001e BF01 movw r22,r30
163 0020 8150 subi r24,lo8(-(-1))
164 0022 0E94 0000 call cc2420_writetxfifo
36:timer3.c **** printf("%d\n",demopacket->payload);
166 .LM7:
167 0026 E091 0000 lds r30,demopacket
168 002a F091 0000 lds r31,(demopacket)+1
169 002e 8485 ldd r24,Z+12
170 0030 9585 ldd r25,Z+13
171 0032 9F93 push r25
172 0034 8F93 push r24
173 0036 80E0 ldi r24,lo8(.LC0)
174 0038 90E0 ldi r25,hi8(.LC0)
175 003a 9F93 push r25
176 003c 8F93 push r24
177 003e 0E94 0000 call printf
37:timer3.c **** Leds_redToggle();
179 .LM8:
180 0042 0E94 0000 call Leds_redToggle
181 0046 0F90 pop __tmp_reg__
182 0048 0F90 pop __tmp_reg__
183 004a 0F90 pop __tmp_reg__
184 004c 0F90 pop __tmp_reg__
185 /* epilogue: frame size=0 */
186 004e 0895 ret
187 /* epilogue end (size=1) */
188 /* function Timer3_fire size 30 (29) */
193 .global Timer3_setIntervalAndScale
195 Timer3_setIntervalAndScale:
38:timer3.c ****
39:timer3.c **** //while (OS_READ_CC_SFD_PIN()==1);//SFD引脚输出高电平说明收到物理帧的SFD字段
40:timer3.c ****
41:timer3.c **** /*
42:timer3.c ****
43:timer3.c **** cc2420_writetxfifo(((demopacket->length)-1), (uint8_t *) demopacket);
44:timer3.c **** (demopacket->dsn)++;
45:timer3.c **** demopacket->address.destination_address=(++demopacket->address.destination_address)&0x02;
46:timer3.c ****
47:timer3.c **** cc2420_setrxmode();
48:timer3.c ****
49:timer3.c **** Leds_greenToggle();
50:timer3.c **** Leds_redToggle();
51:timer3.c **** Leds_yellowOff();
52:timer3.c **** */
53:timer3.c ****
54:timer3.c **** }
55:timer3.c ****
56:timer3.c **** uint8_t Timer3_setIntervalAndScale(uint16_t interval, uint8_t scale)
57:timer3.c **** {
197 .LM9:
198 /* prologue: frame size=0 */
199 0050 0F93 push r16
200 0052 1F93 push r17
201 0054 CF93 push r28
202 /* prologue end (size=3) */
203 0056 8C01 movw r16,r24
204 0058 C62F mov r28,r22
58:timer3.c ****
59:timer3.c **** if (scale > 7) {
206 .LM10:
207 005a 6830 cpi r22,lo8(8)
208 005c 18F0 brlo .L4
60:timer3.c **** return FAIL;
210 .LM11:
211 005e 80E0 ldi r24,lo8(0)
212 0060 90E0 ldi r25,hi8(0)
213 0062 25C0 rjmp .L3
214 .L4:
215 .LBB3:
61:timer3.c **** }
62:timer3.c ****
63:timer3.c **** { os_atomic_t _nesc_atomic = os_atomic_start();
217 .LM12:
218 0064 0E94 0000 call os_atomic_start
64:timer3.c **** {
65:timer3.c ****
66:timer3.c **** OCR3A = interval;//this is the scale
220 .LM13:
221 0068 1093 8700 sts (134)+1,r17
222 006c 0093 8600 sts 134,r16
67:timer3.c **** OCR3B = 0x0000;
224 .LM14:
225 0070 1092 8500 sts (132)+1,__zero_reg__
226 0074 1092 8400 sts 132,__zero_reg__
68:timer3.c **** OCR3C = 0x0000;
228 .LM15:
229 0078 1092 8300 sts (130)+1,__zero_reg__
230 007c 1092 8200 sts 130,__zero_reg__
69:timer3.c **** TCNT3 = 0x0000; //this is the counter
232 .LM16:
233 0080 1092 8900 sts (136)+1,__zero_reg__
234 0084 1092 8800 sts 136,__zero_reg__
70:timer3.c **** TCCR3A = 0x00;//Output: A: Disconnected, B: Disconnected, C: Disconnected,WGM[1..0]=00
236 .LM17:
237 0088 1092 8B00 sts 139,__zero_reg__
71:timer3.c **** scale |= 0x08;//
239 .LM18:
240 008c C860 ori r28,lo8(8)
72:timer3.c **** TCCR3B |= scale;//clk/(scale),WGM[3..2]=01
242 .LM19:
243 008e 9091 8A00 lds r25,138
244 0092 9C2B or r25,r28
245 0094 9093 8A00 sts 138,r25
73:timer3.c **** TCCR3C = 0x00;//
247 .LM20:
248 0098 1092 8C00 sts 140,__zero_reg__
74:timer3.c **** ETIMSK |= 0x10;//OCIE3 is enable
250 .LM21:
251 009c 9091 7D00 lds r25,125
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -