1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-29 18:52:13 +01:00

Removed three .lst files since I don't think they should be there.

This commit is contained in:
David A. Mellis 2006-08-27 09:46:12 +00:00
parent fc1ca8a066
commit 702229b2ec
3 changed files with 0 additions and 2888 deletions

View File

@ -1,390 +0,0 @@
1 .file "buffer.c"
2 .arch atmega8
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
12 .text
13 .Ltext0:
44 .global bufferInit
46 bufferInit:
1:../avrlib/buffer.c **** /*! \file buffer.c \brief Multipurpose byte buffer structure and methods. */
2:../avrlib/buffer.c **** //*****************************************************************************
3:../avrlib/buffer.c **** //
4:../avrlib/buffer.c **** // File Name : 'buffer.c'
5:../avrlib/buffer.c **** // Title : Multipurpose byte buffer structure and methods
6:../avrlib/buffer.c **** // Author : Pascal Stang - Copyright (C) 2001-2002
7:../avrlib/buffer.c **** // Created : 9/23/2001
8:../avrlib/buffer.c **** // Revised : 9/23/2001
9:../avrlib/buffer.c **** // Version : 1.0
10:../avrlib/buffer.c **** // Target MCU : any
11:../avrlib/buffer.c **** // Editor Tabs : 4
12:../avrlib/buffer.c **** //
13:../avrlib/buffer.c **** // This code is distributed under the GNU Public License
14:../avrlib/buffer.c **** // which can be found at http://www.gnu.org/licenses/gpl.txt
15:../avrlib/buffer.c **** //
16:../avrlib/buffer.c **** //*****************************************************************************
17:../avrlib/buffer.c ****
18:../avrlib/buffer.c **** #include "buffer.h"
19:../avrlib/buffer.c ****
20:../avrlib/buffer.c **** // global variables
21:../avrlib/buffer.c ****
22:../avrlib/buffer.c **** // initialization
23:../avrlib/buffer.c ****
24:../avrlib/buffer.c **** void bufferInit(cBuffer* buffer, unsigned char *start, unsigned short size)
25:../avrlib/buffer.c **** {
48 .LM1:
49 /* prologue: frame size=0 */
50 /* prologue end (size=0) */
51 0000 FC01 movw r30,r24
26:../avrlib/buffer.c **** // set start pointer of the buffer
27:../avrlib/buffer.c **** buffer->dataptr = start;
53 .LM2:
54 0002 6083 st Z,r22
55 0004 7183 std Z+1,r23
28:../avrlib/buffer.c **** buffer->size = size;
57 .LM3:
58 0006 4283 std Z+2,r20
59 0008 5383 std Z+3,r21
29:../avrlib/buffer.c **** // initialize index and length
30:../avrlib/buffer.c **** buffer->dataindex = 0;
61 .LM4:
62 000a 1682 std Z+6,__zero_reg__
63 000c 1782 std Z+7,__zero_reg__
31:../avrlib/buffer.c **** buffer->datalength = 0;
65 .LM5:
66 000e 1482 std Z+4,__zero_reg__
67 0010 1582 std Z+5,__zero_reg__
68 /* epilogue: frame size=0 */
69 0012 0895 ret
70 /* epilogue end (size=1) */
71 /* function bufferInit size 10 (9) */
73 .Lscope0:
77 .global bufferGetFromFront
79 bufferGetFromFront:
32:../avrlib/buffer.c **** }
33:../avrlib/buffer.c ****
34:../avrlib/buffer.c **** // access routines
35:../avrlib/buffer.c **** unsigned char bufferGetFromFront(cBuffer* buffer)
36:../avrlib/buffer.c **** {
81 .LM6:
82 /* prologue: frame size=0 */
83 0014 CF93 push r28
84 0016 DF93 push r29
85 /* prologue end (size=2) */
86 0018 EC01 movw r28,r24
37:../avrlib/buffer.c **** unsigned char data = 0;
88 .LM7:
89 001a E0E0 ldi r30,lo8(0)
38:../avrlib/buffer.c ****
39:../avrlib/buffer.c **** // check to see if there's data in the buffer
40:../avrlib/buffer.c **** if(buffer->datalength)
91 .LM8:
92 001c 2C81 ldd r18,Y+4
93 001e 3D81 ldd r19,Y+5
94 0020 2115 cp r18,__zero_reg__
95 0022 3105 cpc r19,__zero_reg__
96 0024 B1F0 breq .L3
41:../avrlib/buffer.c **** {
42:../avrlib/buffer.c **** // get the first character from buffer
43:../avrlib/buffer.c **** data = buffer->dataptr[buffer->dataindex];
98 .LM9:
99 0026 E881 ld r30,Y
100 0028 F981 ldd r31,Y+1
101 002a 8E81 ldd r24,Y+6
102 002c 9F81 ldd r25,Y+7
103 002e E80F add r30,r24
104 0030 F91F adc r31,r25
105 0032 E081 ld r30,Z
44:../avrlib/buffer.c **** // move index down and decrement length
45:../avrlib/buffer.c **** buffer->dataindex++;
107 .LM10:
108 0034 0196 adiw r24,1
109 0036 8E83 std Y+6,r24
110 0038 9F83 std Y+7,r25
46:../avrlib/buffer.c **** if(buffer->dataindex >= buffer->size)
112 .LM11:
113 003a 6A81 ldd r22,Y+2
114 003c 7B81 ldd r23,Y+3
115 003e 8617 cp r24,r22
116 0040 9707 cpc r25,r23
117 0042 18F0 brlo .L4
47:../avrlib/buffer.c **** {
48:../avrlib/buffer.c **** buffer->dataindex %= buffer->size;
119 .LM12:
120 0044 00D0 rcall __udivmodhi4
121 0046 8E83 std Y+6,r24
122 0048 9F83 std Y+7,r25
123 .L4:
49:../avrlib/buffer.c **** }
50:../avrlib/buffer.c **** buffer->datalength--;
125 .LM13:
126 004a 2150 subi r18,lo8(-(-1))
127 004c 3040 sbci r19,hi8(-(-1))
128 004e 2C83 std Y+4,r18
129 0050 3D83 std Y+5,r19
130 .L3:
51:../avrlib/buffer.c **** }
52:../avrlib/buffer.c **** // return
53:../avrlib/buffer.c **** return data;
54:../avrlib/buffer.c **** }
132 .LM14:
133 0052 8E2F mov r24,r30
134 0054 9927 clr r25
135 /* epilogue: frame size=0 */
136 0056 DF91 pop r29
137 0058 CF91 pop r28
138 005a 0895 ret
139 /* epilogue end (size=3) */
140 /* function bufferGetFromFront size 36 (31) */
145 .Lscope1:
150 .global bufferDumpFromFront
152 bufferDumpFromFront:
55:../avrlib/buffer.c ****
56:../avrlib/buffer.c **** void bufferDumpFromFront(cBuffer* buffer, unsigned short numbytes)
57:../avrlib/buffer.c **** {
154 .LM15:
155 /* prologue: frame size=0 */
156 005c CF93 push r28
157 005e DF93 push r29
158 /* prologue end (size=2) */
159 0060 FC01 movw r30,r24
160 0062 EB01 movw r28,r22
58:../avrlib/buffer.c **** // dump numbytes from the front of the buffer
59:../avrlib/buffer.c **** // are we dumping less than the entire buffer?
60:../avrlib/buffer.c **** if(numbytes < buffer->datalength)
162 .LM16:
163 0064 2481 ldd r18,Z+4
164 0066 3581 ldd r19,Z+5
165 0068 6217 cp r22,r18
166 006a 7307 cpc r23,r19
167 006c 98F4 brsh .L6
61:../avrlib/buffer.c **** {
62:../avrlib/buffer.c **** // move index down by numbytes and decrement length by numbytes
63:../avrlib/buffer.c **** buffer->dataindex += numbytes;
169 .LM17:
170 006e 8681 ldd r24,Z+6
171 0070 9781 ldd r25,Z+7
172 0072 860F add r24,r22
173 0074 971F adc r25,r23
174 0076 8683 std Z+6,r24
175 0078 9783 std Z+7,r25
64:../avrlib/buffer.c **** if(buffer->dataindex >= buffer->size)
177 .LM18:
178 007a 6281 ldd r22,Z+2
179 007c 7381 ldd r23,Z+3
180 007e 8617 cp r24,r22
181 0080 9707 cpc r25,r23
182 0082 18F0 brlo .L7
65:../avrlib/buffer.c **** {
66:../avrlib/buffer.c **** buffer->dataindex %= buffer->size;
184 .LM19:
185 0084 00D0 rcall __udivmodhi4
186 0086 8683 std Z+6,r24
187 0088 9783 std Z+7,r25
188 .L7:
67:../avrlib/buffer.c **** }
68:../avrlib/buffer.c **** buffer->datalength -= numbytes;
190 .LM20:
191 008a 2C1B sub r18,r28
192 008c 3D0B sbc r19,r29
193 008e 2483 std Z+4,r18
194 0090 3583 std Z+5,r19
195 0092 02C0 rjmp .L5
196 .L6:
69:../avrlib/buffer.c **** }
70:../avrlib/buffer.c **** else
71:../avrlib/buffer.c **** {
72:../avrlib/buffer.c **** // flush the whole buffer
73:../avrlib/buffer.c **** buffer->datalength = 0;
198 .LM21:
199 0094 1482 std Z+4,__zero_reg__
200 0096 1582 std Z+5,__zero_reg__
201 .L5:
202 /* epilogue: frame size=0 */
203 0098 DF91 pop r29
204 009a CF91 pop r28
205 009c 0895 ret
206 /* epilogue end (size=3) */
207 /* function bufferDumpFromFront size 33 (28) */
209 .Lscope2:
214 .global bufferGetAtIndex
216 bufferGetAtIndex:
74:../avrlib/buffer.c **** }
75:../avrlib/buffer.c **** }
76:../avrlib/buffer.c ****
77:../avrlib/buffer.c **** unsigned char bufferGetAtIndex(cBuffer* buffer, unsigned short index)
78:../avrlib/buffer.c **** {
218 .LM22:
219 /* prologue: frame size=0 */
220 /* prologue end (size=0) */
221 009e FC01 movw r30,r24
79:../avrlib/buffer.c **** // return character at index in buffer
80:../avrlib/buffer.c **** return buffer->dataptr[(buffer->dataindex+index)%(buffer->size)];
223 .LM23:
224 00a0 8681 ldd r24,Z+6
225 00a2 9781 ldd r25,Z+7
226 00a4 2281 ldd r18,Z+2
227 00a6 3381 ldd r19,Z+3
228 00a8 860F add r24,r22
229 00aa 971F adc r25,r23
230 00ac B901 movw r22,r18
231 00ae 00D0 rcall __udivmodhi4
232 00b0 0190 ld __tmp_reg__,Z+
233 00b2 F081 ld r31,Z
234 00b4 E02D mov r30,__tmp_reg__
235 00b6 E80F add r30,r24
236 00b8 F91F adc r31,r25
237 00ba 8081 ld r24,Z
81:../avrlib/buffer.c **** }
239 .LM24:
240 00bc 9927 clr r25
241 /* epilogue: frame size=0 */
242 00be 0895 ret
243 /* epilogue end (size=1) */
244 /* function bufferGetAtIndex size 17 (16) */
246 .Lscope3:
251 .global bufferAddToEnd
253 bufferAddToEnd:
82:../avrlib/buffer.c ****
83:../avrlib/buffer.c **** unsigned char bufferAddToEnd(cBuffer* buffer, unsigned char data)
84:../avrlib/buffer.c **** {
255 .LM25:
256 /* prologue: frame size=0 */
257 00c0 CF93 push r28
258 00c2 DF93 push r29
259 /* prologue end (size=2) */
260 00c4 EC01 movw r28,r24
261 00c6 462F mov r20,r22
85:../avrlib/buffer.c **** // make sure the buffer has room
86:../avrlib/buffer.c **** if(buffer->datalength < buffer->size)
263 .LM26:
264 00c8 2C81 ldd r18,Y+4
265 00ca 3D81 ldd r19,Y+5
266 00cc 6A81 ldd r22,Y+2
267 00ce 7B81 ldd r23,Y+3
268 00d0 2617 cp r18,r22
269 00d2 3707 cpc r19,r23
270 00d4 90F4 brsh .L11
87:../avrlib/buffer.c **** {
88:../avrlib/buffer.c **** // save data byte at end of buffer
89:../avrlib/buffer.c **** buffer->dataptr[(buffer->dataindex + buffer->datalength) % buffer->size] = data;
272 .LM27:
273 00d6 8E81 ldd r24,Y+6
274 00d8 9F81 ldd r25,Y+7
275 00da 820F add r24,r18
276 00dc 931F adc r25,r19
277 00de 00D0 rcall __udivmodhi4
278 00e0 E881 ld r30,Y
279 00e2 F981 ldd r31,Y+1
280 00e4 E80F add r30,r24
281 00e6 F91F adc r31,r25
282 00e8 4083 st Z,r20
90:../avrlib/buffer.c **** // increment the length
91:../avrlib/buffer.c **** buffer->datalength++;
284 .LM28:
285 00ea 8C81 ldd r24,Y+4
286 00ec 9D81 ldd r25,Y+5
287 00ee 0196 adiw r24,1
288 00f0 8C83 std Y+4,r24
289 00f2 9D83 std Y+5,r25
92:../avrlib/buffer.c **** // return success
93:../avrlib/buffer.c **** return -1;
291 .LM29:
292 00f4 8FEF ldi r24,lo8(255)
293 00f6 90E0 ldi r25,hi8(255)
294 00f8 02C0 rjmp .L10
295 .L11:
94:../avrlib/buffer.c **** }
95:../avrlib/buffer.c **** else return 0;
297 .LM30:
298 00fa 80E0 ldi r24,lo8(0)
299 00fc 90E0 ldi r25,hi8(0)
300 .L10:
301 /* epilogue: frame size=0 */
302 00fe DF91 pop r29
303 0100 CF91 pop r28
304 0102 0895 ret
305 /* epilogue end (size=3) */
306 /* function bufferAddToEnd size 34 (29) */
308 .Lscope4:
312 .global bufferIsNotFull
314 bufferIsNotFull:
96:../avrlib/buffer.c **** }
97:../avrlib/buffer.c ****
98:../avrlib/buffer.c **** unsigned char bufferIsNotFull(cBuffer* buffer)
99:../avrlib/buffer.c **** {
316 .LM31:
317 /* prologue: frame size=0 */
318 /* prologue end (size=0) */
319 0104 FC01 movw r30,r24
100:../avrlib/buffer.c **** // check to see if the buffer has room
101:../avrlib/buffer.c **** // return true if there is room
102:../avrlib/buffer.c **** return (buffer->datalength < buffer->size);
321 .LM32:
322 0106 40E0 ldi r20,lo8(0)
323 0108 50E0 ldi r21,hi8(0)
324 010a 2481 ldd r18,Z+4
325 010c 3581 ldd r19,Z+5
326 010e 8281 ldd r24,Z+2
327 0110 9381 ldd r25,Z+3
328 0112 2817 cp r18,r24
329 0114 3907 cpc r19,r25
330 0116 10F4 brsh .L14
332 .LM33:
333 0118 41E0 ldi r20,lo8(1)
334 011a 50E0 ldi r21,hi8(1)
335 .L14:
103:../avrlib/buffer.c **** }
337 .LM34:
338 011c CA01 movw r24,r20
339 /* epilogue: frame size=0 */
340 011e 0895 ret
341 /* epilogue end (size=1) */
342 /* function bufferIsNotFull size 14 (13) */
344 .Lscope5:
348 .global bufferFlush
350 bufferFlush:
104:../avrlib/buffer.c ****
105:../avrlib/buffer.c **** void bufferFlush(cBuffer* buffer)
106:../avrlib/buffer.c **** {
352 .LM35:
353 /* prologue: frame size=0 */
354 /* prologue end (size=0) */
107:../avrlib/buffer.c **** // flush contents of the buffer
108:../avrlib/buffer.c **** buffer->datalength = 0;
356 .LM36:
357 0120 FC01 movw r30,r24
358 0122 1482 std Z+4,__zero_reg__
359 0124 1582 std Z+5,__zero_reg__
360 /* epilogue: frame size=0 */
361 0126 0895 ret
362 /* epilogue end (size=1) */
363 /* function bufferFlush size 4 (3) */
365 .Lscope6:
367 .text
369 Letext:
370 /* File "../avrlib/buffer.c": code 148 = 0x0094 ( 129), prologues 6, epilogues 13 */
DEFINED SYMBOLS
*ABS*:00000000 buffer.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
/var/tmp//ccWNR2QI.s:46 .text:00000000 bufferInit
/var/tmp//ccWNR2QI.s:79 .text:00000014 bufferGetFromFront
/var/tmp//ccWNR2QI.s:152 .text:0000005c bufferDumpFromFront
/var/tmp//ccWNR2QI.s:216 .text:0000009e bufferGetAtIndex
/var/tmp//ccWNR2QI.s:253 .text:000000c0 bufferAddToEnd
/var/tmp//ccWNR2QI.s:314 .text:00000104 bufferIsNotFull
/var/tmp//ccWNR2QI.s:350 .text:00000120 bufferFlush
/var/tmp//ccWNR2QI.s:369 .text:00000128 Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
__udivmodhi4

View File

@ -1,1709 +0,0 @@
1 .file "timer.c"
2 .arch atmega8
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
12 .text
13 .Ltext0:
94 .global TimerRTCPrescaleFactor
95 .section .progmem.data,"a",@progbits
98 TimerRTCPrescaleFactor:
99 0000 0000 .word 0
100 0002 0100 .word 1
101 0004 0800 .word 8
102 0006 2000 .word 32
103 0008 4000 .word 64
104 000a 8000 .word 128
105 000c 0001 .word 256
106 000e 0004 .word 1024
107 .global TimerPrescaleFactor
110 TimerPrescaleFactor:
111 0010 0000 .word 0
112 0012 0100 .word 1
113 0014 0800 .word 8
114 0016 4000 .word 64
115 0018 0001 .word 256
116 001a 0004 .word 1024
117 .text
120 .global delay_us
122 delay_us:
1:../avrlib/timer.c **** /*! \file timer.c \brief System Timer function library. */
2:../avrlib/timer.c **** //*****************************************************************************
3:../avrlib/timer.c **** //
4:../avrlib/timer.c **** // File Name : 'timer.c'
5:../avrlib/timer.c **** // Title : System Timer function library
6:../avrlib/timer.c **** // Author : Pascal Stang - Copyright (C) 2000-2002
7:../avrlib/timer.c **** // Created : 11/22/2000
8:../avrlib/timer.c **** // Revised : 07/09/2003
9:../avrlib/timer.c **** // Version : 1.1
10:../avrlib/timer.c **** // Target MCU : Atmel AVR Series
11:../avrlib/timer.c **** // Editor Tabs : 4
12:../avrlib/timer.c **** //
13:../avrlib/timer.c **** // This code is distributed under the GNU Public License
14:../avrlib/timer.c **** // which can be found at http://www.gnu.org/licenses/gpl.txt
15:../avrlib/timer.c **** //
16:../avrlib/timer.c **** //*****************************************************************************
17:../avrlib/timer.c ****
18:../avrlib/timer.c **** #ifndef WIN32
19:../avrlib/timer.c **** #include <avr/io.h>
20:../avrlib/timer.c **** #include <avr/signal.h>
21:../avrlib/timer.c **** #include <avr/interrupt.h>
22:../avrlib/timer.c **** #include <avr/pgmspace.h>
23:../avrlib/timer.c **** #include <avr/sleep.h>
24:../avrlib/timer.c **** #endif
25:../avrlib/timer.c ****
26:../avrlib/timer.c **** #include "global.h"
27:../avrlib/timer.c **** #include "timer.h"
28:../avrlib/timer.c ****
29:../avrlib/timer.c **** #include "rprintf.h"
30:../avrlib/timer.c ****
31:../avrlib/timer.c **** // Program ROM constants
32:../avrlib/timer.c **** // the prescale division values stored in order of timer control register index
33:../avrlib/timer.c **** // STOP, CLK, CLK/8, CLK/64, CLK/256, CLK/1024
34:../avrlib/timer.c **** unsigned short __attribute__ ((progmem)) TimerPrescaleFactor[] = {0,1,8,64,256,1024};
35:../avrlib/timer.c **** // the prescale division values stored in order of timer control register index
36:../avrlib/timer.c **** // STOP, CLK, CLK/8, CLK/32, CLK/64, CLK/128, CLK/256, CLK/1024
37:../avrlib/timer.c **** unsigned short __attribute__ ((progmem)) TimerRTCPrescaleFactor[] = {0,1,8,32,64,128,256,1024};
38:../avrlib/timer.c ****
39:../avrlib/timer.c **** // Global variables
40:../avrlib/timer.c **** // time registers
41:../avrlib/timer.c **** volatile unsigned long TimerPauseReg;
42:../avrlib/timer.c **** volatile unsigned long Timer0Reg0;
43:../avrlib/timer.c **** volatile unsigned long Timer2Reg0;
44:../avrlib/timer.c ****
45:../avrlib/timer.c **** typedef void (*voidFuncPtr)(void);
46:../avrlib/timer.c **** volatile static voidFuncPtr TimerIntFunc[TIMER_NUM_INTERRUPTS];
47:../avrlib/timer.c ****
48:../avrlib/timer.c **** // delay for a minimum of <us> microseconds
49:../avrlib/timer.c **** // the time resolution is dependent on the time the loop takes
50:../avrlib/timer.c **** // e.g. with 4Mhz and 5 cycles per loop, the resolution is 1.25 us
51:../avrlib/timer.c **** void delay_us(unsigned short time_us)
52:../avrlib/timer.c **** {
124 .LM1:
125 /* prologue: frame size=0 */
126 /* prologue end (size=0) */
53:../avrlib/timer.c **** unsigned short delay_loops;
54:../avrlib/timer.c **** register unsigned short i;
55:../avrlib/timer.c ****
56:../avrlib/timer.c **** delay_loops = (time_us+3)/5*CYCLES_PER_US; // +3 for rounding up (dirty)
128 .LM2:
129 0000 0396 adiw r24,3
130 0002 65E0 ldi r22,lo8(5)
131 0004 70E0 ldi r23,hi8(5)
132 0006 00D0 rcall __udivmodhi4
133 0008 CB01 movw r24,r22
134 000a AA27 clr r26
135 000c BB27 clr r27
136 000e 24E0 ldi r18,4
137 0010 880F 1: lsl r24
138 0012 991F rol r25
139 0014 AA1F rol r26
140 0016 BB1F rol r27
141 0018 2A95 dec r18
142 001a D1F7 brne 1b
143 .L8:
57:../avrlib/timer.c ****
58:../avrlib/timer.c **** // one loop takes 5 cpu cycles
59:../avrlib/timer.c **** for (i=0; i < delay_loops; i++) {};
145 .LM3:
146 001c 0097 sbiw r24,0
147 001e 11F0 breq .L7
148 0020 0197 sbiw r24,1
149 0022 FCCF rjmp .L8
150 .L7:
151 0024 0895 ret
152 /* epilogue: frame size=0 */
153 /* epilogue: noreturn */
154 /* epilogue end (size=0) */
155 /* function delay_us size 19 (19) */
161 .Lscope0:
165 .global timerDetach
167 timerDetach:
60:../avrlib/timer.c **** }
61:../avrlib/timer.c **** /*
62:../avrlib/timer.c **** void delay_ms(unsigned char time_ms)
63:../avrlib/timer.c **** {
64:../avrlib/timer.c **** unsigned short delay_count = F_CPU / 4000;
65:../avrlib/timer.c ****
66:../avrlib/timer.c **** unsigned short cnt;
67:../avrlib/timer.c **** asm volatile ("\n"
68:../avrlib/timer.c **** "L_dl1%=:\n\t"
69:../avrlib/timer.c **** "mov %A0, %A2\n\t"
70:../avrlib/timer.c **** "mov %B0, %B2\n"
71:../avrlib/timer.c **** "L_dl2%=:\n\t"
72:../avrlib/timer.c **** "sbiw %A0, 1\n\t"
73:../avrlib/timer.c **** "brne L_dl2%=\n\t"
74:../avrlib/timer.c **** "dec %1\n\t" "brne L_dl1%=\n\t":"=&w" (cnt)
75:../avrlib/timer.c **** :"r"(time_ms), "r"((unsigned short) (delay_count))
76:../avrlib/timer.c **** );
77:../avrlib/timer.c **** }
78:../avrlib/timer.c **** */
79:../avrlib/timer.c **** void timerInit(void)
80:../avrlib/timer.c **** {
81:../avrlib/timer.c **** u08 intNum;
82:../avrlib/timer.c **** // detach all user functions from interrupts
83:../avrlib/timer.c **** for(intNum=0; intNum<TIMER_NUM_INTERRUPTS; intNum++)
84:../avrlib/timer.c **** timerDetach(intNum);
85:../avrlib/timer.c ****
86:../avrlib/timer.c **** // initialize all timers
87:../avrlib/timer.c **** timer0Init();
88:../avrlib/timer.c **** timer1Init();
89:../avrlib/timer.c **** #ifdef TCNT2 // support timer2 only if it exists
90:../avrlib/timer.c **** timer2Init();
91:../avrlib/timer.c **** #endif
92:../avrlib/timer.c **** // enable interrupts
93:../avrlib/timer.c **** sei();
94:../avrlib/timer.c **** }
95:../avrlib/timer.c ****
96:../avrlib/timer.c **** void timer0Init()
97:../avrlib/timer.c **** {
98:../avrlib/timer.c **** // initialize timer 0
99:../avrlib/timer.c **** timer0SetPrescaler( TIMER0PRESCALE ); // set prescaler
100:../avrlib/timer.c **** outb(TCNT0, 0); // reset TCNT0
101:../avrlib/timer.c **** sbi(TIMSK, TOIE0); // enable TCNT0 overflow interrupt
102:../avrlib/timer.c ****
103:../avrlib/timer.c **** timer0ClearOverflowCount(); // initialize time registers
104:../avrlib/timer.c **** }
105:../avrlib/timer.c ****
106:../avrlib/timer.c **** void timer1Init(void)
107:../avrlib/timer.c **** {
108:../avrlib/timer.c **** // initialize timer 1
109:../avrlib/timer.c **** timer1SetPrescaler( TIMER1PRESCALE ); // set prescaler
110:../avrlib/timer.c **** outb(TCNT1H, 0); // reset TCNT1
111:../avrlib/timer.c **** outb(TCNT1L, 0);
112:../avrlib/timer.c **** sbi(TIMSK, TOIE1); // enable TCNT1 overflow
113:../avrlib/timer.c **** }
114:../avrlib/timer.c ****
115:../avrlib/timer.c **** #ifdef TCNT2 // support timer2 only if it exists
116:../avrlib/timer.c **** void timer2Init(void)
117:../avrlib/timer.c **** {
118:../avrlib/timer.c **** // initialize timer 2
119:../avrlib/timer.c **** timer2SetPrescaler( TIMER2PRESCALE ); // set prescaler
120:../avrlib/timer.c **** outb(TCNT2, 0); // reset TCNT2
121:../avrlib/timer.c **** sbi(TIMSK, TOIE2); // enable TCNT2 overflow
122:../avrlib/timer.c ****
123:../avrlib/timer.c **** timer2ClearOverflowCount(); // initialize time registers
124:../avrlib/timer.c **** }
125:../avrlib/timer.c **** #endif
126:../avrlib/timer.c ****
127:../avrlib/timer.c **** void timer0SetPrescaler(u08 prescale)
128:../avrlib/timer.c **** {
129:../avrlib/timer.c **** // set prescaler on timer 0
130:../avrlib/timer.c **** outb(TCCR0, (inb(TCCR0) & ~TIMER_PRESCALE_MASK) | prescale);
131:../avrlib/timer.c **** }
132:../avrlib/timer.c ****
133:../avrlib/timer.c **** void timer1SetPrescaler(u08 prescale)
134:../avrlib/timer.c **** {
135:../avrlib/timer.c **** // set prescaler on timer 1
136:../avrlib/timer.c **** outb(TCCR1B, (inb(TCCR1B) & ~TIMER_PRESCALE_MASK) | prescale);
137:../avrlib/timer.c **** }
138:../avrlib/timer.c ****
139:../avrlib/timer.c **** #ifdef TCNT2 // support timer2 only if it exists
140:../avrlib/timer.c **** void timer2SetPrescaler(u08 prescale)
141:../avrlib/timer.c **** {
142:../avrlib/timer.c **** // set prescaler on timer 2
143:../avrlib/timer.c **** outb(TCCR2, (inb(TCCR2) & ~TIMER_PRESCALE_MASK) | prescale);
144:../avrlib/timer.c **** }
145:../avrlib/timer.c **** #endif
146:../avrlib/timer.c ****
147:../avrlib/timer.c **** u16 timer0GetPrescaler(void)
148:../avrlib/timer.c **** {
149:../avrlib/timer.c **** // get the current prescaler setting
150:../avrlib/timer.c **** return (pgm_read_word(TimerPrescaleFactor+(inb(TCCR0) & TIMER_PRESCALE_MASK)));
151:../avrlib/timer.c **** }
152:../avrlib/timer.c ****
153:../avrlib/timer.c **** u16 timer1GetPrescaler(void)
154:../avrlib/timer.c **** {
155:../avrlib/timer.c **** // get the current prescaler setting
156:../avrlib/timer.c **** return (pgm_read_word(TimerPrescaleFactor+(inb(TCCR1B) & TIMER_PRESCALE_MASK)));
157:../avrlib/timer.c **** }
158:../avrlib/timer.c ****
159:../avrlib/timer.c **** #ifdef TCNT2 // support timer2 only if it exists
160:../avrlib/timer.c **** u16 timer2GetPrescaler(void)
161:../avrlib/timer.c **** {
162:../avrlib/timer.c **** //TODO: can we assume for all 3-timer AVR processors,
163:../avrlib/timer.c **** // that timer2 is the RTC timer?
164:../avrlib/timer.c ****
165:../avrlib/timer.c **** // get the current prescaler setting
166:../avrlib/timer.c **** return (pgm_read_word(TimerRTCPrescaleFactor+(inb(TCCR2) & TIMER_PRESCALE_MASK)));
167:../avrlib/timer.c **** }
168:../avrlib/timer.c **** #endif
169:../avrlib/timer.c ****
170:../avrlib/timer.c **** void timerAttach(u08 interruptNum, void (*userFunc)(void) )
171:../avrlib/timer.c **** {
172:../avrlib/timer.c **** // make sure the interrupt number is within bounds
173:../avrlib/timer.c **** if(interruptNum < TIMER_NUM_INTERRUPTS)
174:../avrlib/timer.c **** {
175:../avrlib/timer.c **** // set the interrupt function to run
176:../avrlib/timer.c **** // the supplied user's function
177:../avrlib/timer.c **** TimerIntFunc[interruptNum] = userFunc;
178:../avrlib/timer.c **** }
179:../avrlib/timer.c **** }
180:../avrlib/timer.c ****
181:../avrlib/timer.c **** void timerDetach(u08 interruptNum)
182:../avrlib/timer.c **** {
169 .LM4:
170 /* prologue: frame size=0 */
171 /* prologue end (size=0) */
183:../avrlib/timer.c **** // make sure the interrupt number is within bounds
184:../avrlib/timer.c **** if(interruptNum < TIMER_NUM_INTERRUPTS)
173 .LM5:
174 0026 8730 cpi r24,lo8(7)
175 0028 40F4 brsh .L9
185:../avrlib/timer.c **** {
186:../avrlib/timer.c **** // set the interrupt function to run nothing
187:../avrlib/timer.c **** TimerIntFunc[interruptNum] = 0;
177 .LM6:
178 002a E82F mov r30,r24
179 002c FF27 clr r31
180 002e EE0F add r30,r30
181 0030 FF1F adc r31,r31
182 0032 E050 subi r30,lo8(-(TimerIntFunc))
183 0034 F040 sbci r31,hi8(-(TimerIntFunc))
184 0036 1082 st Z,__zero_reg__
185 0038 1182 std Z+1,__zero_reg__
186 .L9:
187 003a 0895 ret
188 /* epilogue: frame size=0 */
189 003c 0895 ret
190 /* epilogue end (size=1) */
191 /* function timerDetach size 12 (11) */
193 .Lscope1:
197 .global timer0SetPrescaler
199 timer0SetPrescaler:
201 .LM7:
202 /* prologue: frame size=0 */
203 /* prologue end (size=0) */
205 .LM8:
206 003e 93B7 in r25,83-0x20
207 0040 987F andi r25,lo8(-8)
208 0042 982B or r25,r24
209 0044 93BF out 83-0x20,r25
210 /* epilogue: frame size=0 */
211 0046 0895 ret
212 /* epilogue end (size=1) */
213 /* function timer0SetPrescaler size 5 (4) */
215 .Lscope2:
218 .global timer0ClearOverflowCount
220 timer0ClearOverflowCount:
188:../avrlib/timer.c **** }
189:../avrlib/timer.c **** }
190:../avrlib/timer.c **** /*
191:../avrlib/timer.c **** u32 timerMsToTics(u16 ms)
192:../avrlib/timer.c **** {
193:../avrlib/timer.c **** // calculate the prescaler division rate
194:../avrlib/timer.c **** u16 prescaleDiv = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0)));
195:../avrlib/timer.c **** // calculate the number of timer tics in x milliseconds
196:../avrlib/timer.c **** return (ms*(F_CPU/(prescaleDiv*256)))/1000;
197:../avrlib/timer.c **** }
198:../avrlib/timer.c ****
199:../avrlib/timer.c **** u16 timerTicsToMs(u32 tics)
200:../avrlib/timer.c **** {
201:../avrlib/timer.c **** // calculate the prescaler division rate
202:../avrlib/timer.c **** u16 prescaleDiv = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0)));
203:../avrlib/timer.c **** // calculate the number of milliseconds in x timer tics
204:../avrlib/timer.c **** return (tics*1000*(prescaleDiv*256))/F_CPU;
205:../avrlib/timer.c **** }
206:../avrlib/timer.c **** */
207:../avrlib/timer.c **** void timerPause(unsigned short pause_ms)
208:../avrlib/timer.c **** {
209:../avrlib/timer.c **** // pauses for exactly <pause_ms> number of milliseconds
210:../avrlib/timer.c **** u08 timerThres;
211:../avrlib/timer.c **** u32 ticRateHz;
212:../avrlib/timer.c **** u32 pause;
213:../avrlib/timer.c ****
214:../avrlib/timer.c **** // capture current pause timer value
215:../avrlib/timer.c **** timerThres = inb(TCNT0);
216:../avrlib/timer.c **** // reset pause timer overflow count
217:../avrlib/timer.c **** TimerPauseReg = 0;
218:../avrlib/timer.c **** // calculate delay for [pause_ms] milliseconds
219:../avrlib/timer.c **** // prescaler division = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0)))
220:../avrlib/timer.c **** ticRateHz = F_CPU/timer0GetPrescaler();
221:../avrlib/timer.c **** // precision management
222:../avrlib/timer.c **** // prevent overflow and precision underflow
223:../avrlib/timer.c **** // -could add more conditions to improve accuracy
224:../avrlib/timer.c **** if( ((ticRateHz < 429497) && (pause_ms <= 10000)) )
225:../avrlib/timer.c **** pause = (pause_ms*ticRateHz)/1000;
226:../avrlib/timer.c **** else
227:../avrlib/timer.c **** pause = pause_ms*(ticRateHz/1000);
228:../avrlib/timer.c ****
229:../avrlib/timer.c **** // loop until time expires
230:../avrlib/timer.c **** while( ((TimerPauseReg<<8) | inb(TCNT0)) < (pause+timerThres) )
231:../avrlib/timer.c **** {
232:../avrlib/timer.c **** if( TimerPauseReg < (pause>>8));
233:../avrlib/timer.c **** {
234:../avrlib/timer.c **** // save power by idling the processor
235:../avrlib/timer.c **** set_sleep_mode(SLEEP_MODE_IDLE);
236:../avrlib/timer.c **** sleep_mode();
237:../avrlib/timer.c **** }
238:../avrlib/timer.c **** }
239:../avrlib/timer.c ****
240:../avrlib/timer.c **** /* old inaccurate code, for reference
241:../avrlib/timer.c ****
242:../avrlib/timer.c **** // calculate delay for [pause_ms] milliseconds
243:../avrlib/timer.c **** u16 prescaleDiv = 1<<(pgm_read_byte(TimerPrescaleFactor+inb(TCCR0)));
244:../avrlib/timer.c **** u32 pause = (pause_ms*(F_CPU/(prescaleDiv*256)))/1000;
245:../avrlib/timer.c ****
246:../avrlib/timer.c **** TimerPauseReg = 0;
247:../avrlib/timer.c **** while(TimerPauseReg < pause);
248:../avrlib/timer.c ****
249:../avrlib/timer.c **** */
250:../avrlib/timer.c **** }
251:../avrlib/timer.c ****
252:../avrlib/timer.c **** void timer0ClearOverflowCount(void)
253:../avrlib/timer.c **** {
222 .LM9:
223 /* prologue: frame size=0 */
224 /* prologue end (size=0) */
254:../avrlib/timer.c **** // clear the timer overflow counter registers
255:../avrlib/timer.c **** Timer0Reg0 = 0; // initialize time registers
226 .LM10:
227 0048 1092 0000 sts Timer0Reg0,__zero_reg__
228 004c 1092 0000 sts (Timer0Reg0)+1,__zero_reg__
229 0050 1092 0000 sts (Timer0Reg0)+2,__zero_reg__
230 0054 1092 0000 sts (Timer0Reg0)+3,__zero_reg__
231 /* epilogue: frame size=0 */
232 0058 0895 ret
233 /* epilogue end (size=1) */
234 /* function timer0ClearOverflowCount size 9 (8) */
236 .Lscope3:
239 .global timer0Init
241 timer0Init:
243 .LM11:
244 /* prologue: frame size=0 */
245 /* prologue end (size=0) */
247 .LM12:
248 005a 82E0 ldi r24,lo8(2)
249 005c F0DF rcall timer0SetPrescaler
251 .LM13:
252 005e 12BE out 82-0x20,__zero_reg__
254 .LM14:
255 0060 89B7 in r24,89-0x20
256 0062 8160 ori r24,lo8(1)
257 0064 89BF out 89-0x20,r24
259 .LM15:
260 0066 F0DF rcall timer0ClearOverflowCount
261 /* epilogue: frame size=0 */
262 0068 0895 ret
263 /* epilogue end (size=1) */
264 /* function timer0Init size 8 (7) */
266 .Lscope4:
270 .global timer1SetPrescaler
272 timer1SetPrescaler:
274 .LM16:
275 /* prologue: frame size=0 */
276 /* prologue end (size=0) */
278 .LM17:
279 006a 9EB5 in r25,78-0x20
280 006c 987F andi r25,lo8(-8)
281 006e 982B or r25,r24
282 0070 9EBD out 78-0x20,r25
283 /* epilogue: frame size=0 */
284 0072 0895 ret
285 /* epilogue end (size=1) */
286 /* function timer1SetPrescaler size 5 (4) */
288 .Lscope5:
291 .global timer1Init
293 timer1Init:
295 .LM18:
296 /* prologue: frame size=0 */
297 /* prologue end (size=0) */
299 .LM19:
300 0074 83E0 ldi r24,lo8(3)
301 0076 F9DF rcall timer1SetPrescaler
303 .LM20:
304 0078 1DBC out 77-0x20,__zero_reg__
306 .LM21:
307 007a 1CBC out 76-0x20,__zero_reg__
309 .LM22:
310 007c 89B7 in r24,89-0x20
311 007e 8460 ori r24,lo8(4)
312 0080 89BF out 89-0x20,r24
313 /* epilogue: frame size=0 */
314 0082 0895 ret
315 /* epilogue end (size=1) */
316 /* function timer1Init size 8 (7) */
318 .Lscope6:
322 .global timer2SetPrescaler
324 timer2SetPrescaler:
326 .LM23:
327 /* prologue: frame size=0 */
328 /* prologue end (size=0) */
330 .LM24:
331 0084 95B5 in r25,69-0x20
332 0086 987F andi r25,lo8(-8)
333 0088 982B or r25,r24
334 008a 95BD out 69-0x20,r25
335 /* epilogue: frame size=0 */
336 008c 0895 ret
337 /* epilogue end (size=1) */
338 /* function timer2SetPrescaler size 5 (4) */
340 .Lscope7:
343 .global timer2ClearOverflowCount
345 timer2ClearOverflowCount:
256:../avrlib/timer.c **** }
257:../avrlib/timer.c ****
258:../avrlib/timer.c **** long timer0GetOverflowCount(void)
259:../avrlib/timer.c **** {
260:../avrlib/timer.c **** // return the current timer overflow count
261:../avrlib/timer.c **** // (this is since the last timer0ClearOverflowCount() command was called)
262:../avrlib/timer.c **** return Timer0Reg0;
263:../avrlib/timer.c **** }
264:../avrlib/timer.c ****
265:../avrlib/timer.c **** #ifdef TCNT2 // support timer2 only if it exists
266:../avrlib/timer.c **** void timer2ClearOverflowCount(void)
267:../avrlib/timer.c **** {
347 .LM25:
348 /* prologue: frame size=0 */
349 /* prologue end (size=0) */
268:../avrlib/timer.c **** // clear the timer overflow counter registers
269:../avrlib/timer.c **** Timer2Reg0 = 0; // initialize time registers
351 .LM26:
352 008e 1092 0000 sts Timer2Reg0,__zero_reg__
353 0092 1092 0000 sts (Timer2Reg0)+1,__zero_reg__
354 0096 1092 0000 sts (Timer2Reg0)+2,__zero_reg__
355 009a 1092 0000 sts (Timer2Reg0)+3,__zero_reg__
356 /* epilogue: frame size=0 */
357 009e 0895 ret
358 /* epilogue end (size=1) */
359 /* function timer2ClearOverflowCount size 9 (8) */
361 .Lscope8:
364 .global timer2Init
366 timer2Init:
368 .LM27:
369 /* prologue: frame size=0 */
370 /* prologue end (size=0) */
372 .LM28:
373 00a0 84E0 ldi r24,lo8(4)
374 00a2 F0DF rcall timer2SetPrescaler
376 .LM29:
377 00a4 14BC out 68-0x20,__zero_reg__
379 .LM30:
380 00a6 89B7 in r24,89-0x20
381 00a8 8064 ori r24,lo8(64)
382 00aa 89BF out 89-0x20,r24
384 .LM31:
385 00ac F0DF rcall timer2ClearOverflowCount
386 /* epilogue: frame size=0 */
387 00ae 0895 ret
388 /* epilogue end (size=1) */
389 /* function timer2Init size 8 (7) */
391 .Lscope9:
394 .global timerInit
396 timerInit:
398 .LM32:
399 /* prologue: frame size=0 */
400 00b0 CF93 push r28
401 /* prologue end (size=1) */
403 .LM33:
404 00b2 C0E0 ldi r28,lo8(0)
405 .L23:
407 .LM34:
408 00b4 8C2F mov r24,r28
409 00b6 B7DF rcall timerDetach
411 .LM35:
412 00b8 CF5F subi r28,lo8(-(1))
413 00ba C730 cpi r28,lo8(7)
414 00bc D8F3 brlo .L23
416 .LM36:
417 00be CDDF rcall timer0Init
419 .LM37:
420 00c0 D9DF rcall timer1Init
422 .LM38:
423 00c2 EEDF rcall timer2Init
425 .LM39:
426 /* #APP */
427 00c4 7894 sei
428 /* #NOAPP */
429 /* epilogue: frame size=0 */
430 00c6 CF91 pop r28
431 00c8 0895 ret
432 /* epilogue end (size=2) */
433 /* function timerInit size 14 (11) */
438 .Lscope10:
441 .global timer0GetPrescaler
443 timer0GetPrescaler:
445 .LM40:
446 /* prologue: frame size=0 */
447 /* prologue end (size=0) */
448 .LBB2:
450 .LM41:
451 00ca 83B7 in r24,83-0x20
452 00cc E82F mov r30,r24
453 00ce FF27 clr r31
454 00d0 E770 andi r30,lo8(7)
455 00d2 F070 andi r31,hi8(7)
456 00d4 EE0F add r30,r30
457 00d6 FF1F adc r31,r31
458 00d8 E050 subi r30,lo8(-(TimerPrescaleFactor))
459 00da F040 sbci r31,hi8(-(TimerPrescaleFactor))
460 .LBE2:
462 .LM42:
463 /* #APP */
464 00dc 8591 lpm r24, Z+
465 00de 9491 lpm r25, Z
466
467 /* #NOAPP */
468 /* epilogue: frame size=0 */
469 00e0 0895 ret
470 /* epilogue end (size=1) */
471 /* function timer0GetPrescaler size 16 (15) */
476 .Lscope11:
479 .global timer1GetPrescaler
481 timer1GetPrescaler:
483 .LM43:
484 /* prologue: frame size=0 */
485 /* prologue end (size=0) */
486 .LBB3:
488 .LM44:
489 00e2 8EB5 in r24,78-0x20
490 00e4 E82F mov r30,r24
491 00e6 FF27 clr r31
492 00e8 E770 andi r30,lo8(7)
493 00ea F070 andi r31,hi8(7)
494 00ec EE0F add r30,r30
495 00ee FF1F adc r31,r31
496 00f0 E050 subi r30,lo8(-(TimerPrescaleFactor))
497 00f2 F040 sbci r31,hi8(-(TimerPrescaleFactor))
498 .LBE3:
500 .LM45:
501 /* #APP */
502 00f4 8591 lpm r24, Z+
503 00f6 9491 lpm r25, Z
504
505 /* #NOAPP */
506 /* epilogue: frame size=0 */
507 00f8 0895 ret
508 /* epilogue end (size=1) */
509 /* function timer1GetPrescaler size 16 (15) */
514 .Lscope12:
517 .global timer2GetPrescaler
519 timer2GetPrescaler:
521 .LM46:
522 /* prologue: frame size=0 */
523 /* prologue end (size=0) */
524 .LBB4:
526 .LM47:
527 00fa 85B5 in r24,69-0x20
528 00fc E82F mov r30,r24
529 00fe FF27 clr r31
530 0100 E770 andi r30,lo8(7)
531 0102 F070 andi r31,hi8(7)
532 0104 EE0F add r30,r30
533 0106 FF1F adc r31,r31
534 0108 E050 subi r30,lo8(-(TimerRTCPrescaleFactor))
535 010a F040 sbci r31,hi8(-(TimerRTCPrescaleFactor))
536 .LBE4:
538 .LM48:
539 /* #APP */
540 010c 8591 lpm r24, Z+
541 010e 9491 lpm r25, Z
542
543 /* #NOAPP */
544 /* epilogue: frame size=0 */
545 0110 0895 ret
546 /* epilogue end (size=1) */
547 /* function timer2GetPrescaler size 16 (15) */
552 .Lscope13:
557 .global timerAttach
559 timerAttach:
561 .LM49:
562 /* prologue: frame size=0 */
563 /* prologue end (size=0) */
565 .LM50:
566 0112 8730 cpi r24,lo8(7)
567 0114 40F4 brsh .L29
569 .LM51:
570 0116 E82F mov r30,r24
571 0118 FF27 clr r31
572 011a EE0F add r30,r30
573 011c FF1F adc r31,r31
574 011e E050 subi r30,lo8(-(TimerIntFunc))
575 0120 F040 sbci r31,hi8(-(TimerIntFunc))
576 0122 6083 st Z,r22
577 0124 7183 std Z+1,r23
578 .L29:
579 0126 0895 ret
580 /* epilogue: frame size=0 */
581 0128 0895 ret
582 /* epilogue end (size=1) */
583 /* function timerAttach size 12 (11) */
585 .Lscope14:
589 .global timerPause
591 timerPause:
593 .LM52:
594 /* prologue: frame size=0 */
595 012a DF92 push r13
596 012c EF92 push r14
597 012e FF92 push r15
598 0130 0F93 push r16
599 0132 1F93 push r17
600 0134 CF93 push r28
601 0136 DF93 push r29
602 /* prologue end (size=7) */
603 0138 EC01 movw r28,r24
605 .LM53:
606 013a D2B6 in r13,82-0x20
608 .LM54:
609 013c 1092 0000 sts TimerPauseReg,__zero_reg__
610 0140 1092 0000 sts (TimerPauseReg)+1,__zero_reg__
611 0144 1092 0000 sts (TimerPauseReg)+2,__zero_reg__
612 0148 1092 0000 sts (TimerPauseReg)+3,__zero_reg__
614 .LM55:
615 014c BEDF rcall timer0GetPrescaler
616 014e 9C01 movw r18,r24
617 0150 4427 clr r20
618 0152 5527 clr r21
619 0154 60E0 ldi r22,lo8(16000000)
620 0156 74E2 ldi r23,hi8(16000000)
621 0158 84EF ldi r24,hlo8(16000000)
622 015a 90E0 ldi r25,hhi8(16000000)
623 015c 00D0 rcall __divmodsi4
625 .LM56:
626 015e 293B cpi r18,lo8(429497)
627 0160 8DE8 ldi r24,hi8(429497)
628 0162 3807 cpc r19,r24
629 0164 86E0 ldi r24,hlo8(429497)
630 0166 4807 cpc r20,r24
631 0168 80E0 ldi r24,hhi8(429497)
632 016a 5807 cpc r21,r24
633 016c B0F4 brsh .L32
635 .LM57:
636 016e 87E2 ldi r24,hi8(10001)
637 0170 C131 cpi r28,lo8(10001)
638 0172 D807 cpc r29,r24
639 0174 90F4 brsh .L32
641 .LM58:
642 0176 CE01 movw r24,r28
643 0178 AA27 clr r26
644 017a BB27 clr r27
645 017c BC01 movw r22,r24
646 017e CD01 movw r24,r26
647 0180 00D0 rcall __mulsi3
648 0182 DC01 movw r26,r24
649 0184 CB01 movw r24,r22
650 0186 BC01 movw r22,r24
651 0188 CD01 movw r24,r26
652 018a 28EE ldi r18,lo8(1000)
653 018c 33E0 ldi r19,hi8(1000)
654 018e 40E0 ldi r20,hlo8(1000)
655 0190 50E0 ldi r21,hhi8(1000)
656 0192 00D0 rcall __udivmodsi4
657 0194 FA01 movw r30,r20
658 0196 E901 movw r28,r18
659 0198 0FC0 rjmp .L33
660 .L32:
662 .LM59:
663 019a 7E01 movw r14,r28
664 019c 0027 clr r16
665 019e 1127 clr r17
666 01a0 CA01 movw r24,r20
667 01a2 B901 movw r22,r18
668 01a4 28EE ldi r18,lo8(1000)
669 01a6 33E0 ldi r19,hi8(1000)
670 01a8 40E0 ldi r20,hlo8(1000)
671 01aa 50E0 ldi r21,hhi8(1000)
672 01ac 00D0 rcall __udivmodsi4
673 01ae C801 movw r24,r16
674 01b0 B701 movw r22,r14
675 01b2 00D0 rcall __mulsi3
676 01b4 FC01 movw r30,r24
677 01b6 EB01 movw r28,r22
678 .L33:
680 .LM60:
681 01b8 8091 0000 lds r24,TimerPauseReg
682 01bc 9091 0000 lds r25,(TimerPauseReg)+1
683 01c0 A091 0000 lds r26,(TimerPauseReg)+2
684 01c4 B091 0000 lds r27,(TimerPauseReg)+3
685 01c8 2227 clr r18
686 01ca 382F mov r19,r24
687 01cc 492F mov r20,r25
688 01ce 5A2F mov r21,r26
689 01d0 82B7 in r24,82-0x20
690 01d2 9927 clr r25
691 01d4 AA27 clr r26
692 01d6 BB27 clr r27
693 01d8 282B or r18,r24
694 01da 392B or r19,r25
695 01dc 4A2B or r20,r26
696 01de 5B2B or r21,r27
697 01e0 CD0D add r28,r13
698 01e2 D11D adc r29,__zero_reg__
699 01e4 E11D adc r30,__zero_reg__
700 01e6 F11D adc r31,__zero_reg__
701 01e8 2C17 cp r18,r28
702 01ea 3D07 cpc r19,r29
703 01ec 4E07 cpc r20,r30
704 01ee 5F07 cpc r21,r31
705 01f0 58F5 brsh .L41
706 .L39:
708 .LM61:
709 01f2 8091 0000 lds r24,TimerPauseReg
710 01f6 9091 0000 lds r25,(TimerPauseReg)+1
711 01fa A091 0000 lds r26,(TimerPauseReg)+2
712 01fe B091 0000 lds r27,(TimerPauseReg)+3
714 .LM62:
715 0202 85B7 in r24,85-0x20
716 0204 8F78 andi r24,lo8(-113)
717 0206 85BF out 85-0x20,r24
719 .LM63:
720 0208 85B7 in r24,85-0x20
721 020a 8068 ori r24,lo8(-128)
722 020c 85BF out 85-0x20,r24
723 /* #APP */
724 020e 8895 sleep
725
726 /* #NOAPP */
727 0210 85B7 in r24,85-0x20
728 0212 8F77 andi r24,lo8(127)
729 0214 85BF out 85-0x20,r24
730 0216 8091 0000 lds r24,TimerPauseReg
731 021a 9091 0000 lds r25,(TimerPauseReg)+1
732 021e A091 0000 lds r26,(TimerPauseReg)+2
733 0222 B091 0000 lds r27,(TimerPauseReg)+3
734 0226 BA2F mov r27,r26
735 0228 A92F mov r26,r25
736 022a 982F mov r25,r24
737 022c 8827 clr r24
738 022e 22B7 in r18,82-0x20
739 0230 3327 clr r19
740 0232 4427 clr r20
741 0234 5527 clr r21
742 0236 822B or r24,r18
743 0238 932B or r25,r19
744 023a A42B or r26,r20
745 023c B52B or r27,r21
746 023e 8C17 cp r24,r28
747 0240 9D07 cpc r25,r29
748 0242 AE07 cpc r26,r30
749 0244 BF07 cpc r27,r31
750 0246 A8F2 brlo .L39
751 .L41:
752 /* epilogue: frame size=0 */
753 0248 DF91 pop r29
754 024a CF91 pop r28
755 024c 1F91 pop r17
756 024e 0F91 pop r16
757 0250 FF90 pop r15
758 0252 EF90 pop r14
759 0254 DF90 pop r13
760 0256 0895 ret
761 /* epilogue end (size=8) */
762 /* function timerPause size 154 (139) */
769 .Lscope15:
772 .global timer0GetOverflowCount
774 timer0GetOverflowCount:
776 .LM64:
777 /* prologue: frame size=0 */
778 /* prologue end (size=0) */
780 .LM65:
781 0258 8091 0000 lds r24,Timer0Reg0
782 025c 9091 0000 lds r25,(Timer0Reg0)+1
783 0260 A091 0000 lds r26,(Timer0Reg0)+2
784 0264 B091 0000 lds r27,(Timer0Reg0)+3
786 .LM66:
787 0268 BC01 movw r22,r24
788 026a CD01 movw r24,r26
789 /* epilogue: frame size=0 */
790 026c 0895 ret
791 /* epilogue end (size=1) */
792 /* function timer0GetOverflowCount size 11 (10) */
794 .Lscope16:
797 .global timer2GetOverflowCount
799 timer2GetOverflowCount:
270:../avrlib/timer.c **** }
271:../avrlib/timer.c ****
272:../avrlib/timer.c **** long timer2GetOverflowCount(void)
273:../avrlib/timer.c **** {
801 .LM67:
802 /* prologue: frame size=0 */
803 /* prologue end (size=0) */
274:../avrlib/timer.c **** // return the current timer overflow count
275:../avrlib/timer.c **** // (this is since the last timer2ClearOverflowCount() command was called)
276:../avrlib/timer.c **** return Timer2Reg0;
805 .LM68:
806 026e 8091 0000 lds r24,Timer2Reg0
807 0272 9091 0000 lds r25,(Timer2Reg0)+1
808 0276 A091 0000 lds r26,(Timer2Reg0)+2
809 027a B091 0000 lds r27,(Timer2Reg0)+3
277:../avrlib/timer.c **** }
811 .LM69:
812 027e BC01 movw r22,r24
813 0280 CD01 movw r24,r26
814 /* epilogue: frame size=0 */
815 0282 0895 ret
816 /* epilogue end (size=1) */
817 /* function timer2GetOverflowCount size 11 (10) */
819 .Lscope17:
823 .global timer1PWMInit
825 timer1PWMInit:
278:../avrlib/timer.c **** #endif
279:../avrlib/timer.c ****
280:../avrlib/timer.c **** void timer1PWMInit(u08 bitRes)
281:../avrlib/timer.c **** {
827 .LM70:
828 /* prologue: frame size=0 */
829 /* prologue end (size=0) */
282:../avrlib/timer.c **** // configures timer1 for use with PWM output
283:../avrlib/timer.c **** // on OC1A and OC1B pins
284:../avrlib/timer.c ****
285:../avrlib/timer.c **** // enable timer1 as 8,9,10bit PWM
286:../avrlib/timer.c **** if(bitRes == 9)
831 .LM71:
832 0284 8930 cpi r24,lo8(9)
833 0286 31F4 brne .L45
287:../avrlib/timer.c **** { // 9bit mode
288:../avrlib/timer.c **** sbi(TCCR1A,PWM11);
835 .LM72:
836 0288 8FB5 in r24,79-0x20
837 028a 8260 ori r24,lo8(2)
838 028c 8FBD out 79-0x20,r24
289:../avrlib/timer.c **** cbi(TCCR1A,PWM10);
840 .LM73:
841 028e 8FB5 in r24,79-0x20
842 0290 8E7F andi r24,lo8(-2)
843 0292 0AC0 rjmp .L50
844 .L45:
290:../avrlib/timer.c **** }
291:../avrlib/timer.c **** else if( bitRes == 10 )
846 .LM74:
847 0294 8A30 cpi r24,lo8(10)
848 0296 19F4 brne .L47
292:../avrlib/timer.c **** { // 10bit mode
293:../avrlib/timer.c **** sbi(TCCR1A,PWM11);
850 .LM75:
851 0298 8FB5 in r24,79-0x20
852 029a 8260 ori r24,lo8(2)
853 029c 02C0 rjmp .L49
854 .L47:
294:../avrlib/timer.c **** sbi(TCCR1A,PWM10);
295:../avrlib/timer.c **** }
296:../avrlib/timer.c **** else
297:../avrlib/timer.c **** { // default 8bit mode
298:../avrlib/timer.c **** cbi(TCCR1A,PWM11);
856 .LM76:
857 029e 8FB5 in r24,79-0x20
858 02a0 8D7F andi r24,lo8(-3)
859 .L49:
860 02a2 8FBD out 79-0x20,r24
299:../avrlib/timer.c **** sbi(TCCR1A,PWM10);
862 .LM77:
863 02a4 8FB5 in r24,79-0x20
864 02a6 8160 ori r24,lo8(1)
865 .L50:
866 02a8 8FBD out 79-0x20,r24
300:../avrlib/timer.c **** }
301:../avrlib/timer.c ****
302:../avrlib/timer.c **** // clear output compare value A
303:../avrlib/timer.c **** outb(OCR1AH, 0);
868 .LM78:
869 02aa 1BBC out 75-0x20,__zero_reg__
304:../avrlib/timer.c **** outb(OCR1AL, 0);
871 .LM79:
872 02ac 1ABC out 74-0x20,__zero_reg__
305:../avrlib/timer.c **** // clear output compare value B
306:../avrlib/timer.c **** outb(OCR1BH, 0);
874 .LM80:
875 02ae 19BC out 73-0x20,__zero_reg__
307:../avrlib/timer.c **** outb(OCR1BL, 0);
877 .LM81:
878 02b0 18BC out 72-0x20,__zero_reg__
879 /* epilogue: frame size=0 */
880 02b2 0895 ret
881 /* epilogue end (size=1) */
882 /* function timer1PWMInit size 24 (23) */
884 .Lscope18:
888 .global timer1PWMInitICR
890 timer1PWMInitICR:
308:../avrlib/timer.c **** }
309:../avrlib/timer.c ****
310:../avrlib/timer.c **** #ifdef WGM10
311:../avrlib/timer.c **** // include support for arbitrary top-count PWM
312:../avrlib/timer.c **** // on new AVR processors that support it
313:../avrlib/timer.c **** void timer1PWMInitICR(u16 topcount)
314:../avrlib/timer.c **** {
892 .LM82:
893 /* prologue: frame size=0 */
894 /* prologue end (size=0) */
895 02b4 9C01 movw r18,r24
315:../avrlib/timer.c **** // set PWM mode with ICR top-count
316:../avrlib/timer.c **** cbi(TCCR1A,WGM10);
897 .LM83:
898 02b6 8FB5 in r24,79-0x20
899 02b8 8E7F andi r24,lo8(-2)
900 02ba 8FBD out 79-0x20,r24
317:../avrlib/timer.c **** sbi(TCCR1A,WGM11);
902 .LM84:
903 02bc 8FB5 in r24,79-0x20
904 02be 8260 ori r24,lo8(2)
905 02c0 8FBD out 79-0x20,r24
318:../avrlib/timer.c **** sbi(TCCR1B,WGM12);
907 .LM85:
908 02c2 8EB5 in r24,78-0x20
909 02c4 8860 ori r24,lo8(8)
910 02c6 8EBD out 78-0x20,r24
319:../avrlib/timer.c **** sbi(TCCR1B,WGM13);
912 .LM86:
913 02c8 8EB5 in r24,78-0x20
914 02ca 8061 ori r24,lo8(16)
915 02cc 8EBD out 78-0x20,r24
320:../avrlib/timer.c ****
321:../avrlib/timer.c **** // set top count value
322:../avrlib/timer.c **** ICR1 = topcount;
917 .LM87:
918 02ce 37BD out (70)+1-0x20,r19
919 02d0 26BD out 70-0x20,r18
323:../avrlib/timer.c ****
324:../avrlib/timer.c **** // clear output compare value A
325:../avrlib/timer.c **** OCR1A = 0;
921 .LM88:
922 02d2 1BBC out (74)+1-0x20,__zero_reg__
923 02d4 1ABC out 74-0x20,__zero_reg__
326:../avrlib/timer.c **** // clear output compare value B
327:../avrlib/timer.c **** OCR1B = 0;
925 .LM89:
926 02d6 19BC out (72)+1-0x20,__zero_reg__
927 02d8 18BC out 72-0x20,__zero_reg__
928 /* epilogue: frame size=0 */
929 02da 0895 ret
930 /* epilogue end (size=1) */
931 /* function timer1PWMInitICR size 20 (19) */
933 .Lscope19:
936 .global timer1PWMAOff
938 timer1PWMAOff:
328:../avrlib/timer.c ****
329:../avrlib/timer.c **** }
330:../avrlib/timer.c **** #endif
331:../avrlib/timer.c ****
332:../avrlib/timer.c **** void timer1PWMOff(void)
333:../avrlib/timer.c **** {
334:../avrlib/timer.c **** // turn off timer1 PWM mode
335:../avrlib/timer.c **** cbi(TCCR1A,PWM11);
336:../avrlib/timer.c **** cbi(TCCR1A,PWM10);
337:../avrlib/timer.c **** // set PWM1A/B (OutputCompare action) to none
338:../avrlib/timer.c **** timer1PWMAOff();
339:../avrlib/timer.c **** timer1PWMBOff();
340:../avrlib/timer.c **** }
341:../avrlib/timer.c ****
342:../avrlib/timer.c **** void timer1PWMAOn(void)
343:../avrlib/timer.c **** {
344:../avrlib/timer.c **** // turn on channel A (OC1A) PWM output
345:../avrlib/timer.c **** // set OC1A as non-inverted PWM
346:../avrlib/timer.c **** sbi(TCCR1A,COM1A1);
347:../avrlib/timer.c **** cbi(TCCR1A,COM1A0);
348:../avrlib/timer.c **** }
349:../avrlib/timer.c ****
350:../avrlib/timer.c **** void timer1PWMBOn(void)
351:../avrlib/timer.c **** {
352:../avrlib/timer.c **** // turn on channel B (OC1B) PWM output
353:../avrlib/timer.c **** // set OC1B as non-inverted PWM
354:../avrlib/timer.c **** sbi(TCCR1A,COM1B1);
355:../avrlib/timer.c **** cbi(TCCR1A,COM1B0);
356:../avrlib/timer.c **** }
357:../avrlib/timer.c ****
358:../avrlib/timer.c **** void timer1PWMAOff(void)
359:../avrlib/timer.c **** {
940 .LM90:
941 /* prologue: frame size=0 */
942 /* prologue end (size=0) */
360:../avrlib/timer.c **** // turn off channel A (OC1A) PWM output
361:../avrlib/timer.c **** // set OC1A (OutputCompare action) to none
362:../avrlib/timer.c **** cbi(TCCR1A,COM1A1);
944 .LM91:
945 02dc 8FB5 in r24,79-0x20
946 02de 8F77 andi r24,lo8(127)
947 02e0 8FBD out 79-0x20,r24
363:../avrlib/timer.c **** cbi(TCCR1A,COM1A0);
949 .LM92:
950 02e2 8FB5 in r24,79-0x20
951 02e4 8F7B andi r24,lo8(-65)
952 02e6 8FBD out 79-0x20,r24
953 /* epilogue: frame size=0 */
954 02e8 0895 ret
955 /* epilogue end (size=1) */
956 /* function timer1PWMAOff size 7 (6) */
958 .Lscope20:
961 .global timer1PWMBOff
963 timer1PWMBOff:
364:../avrlib/timer.c **** }
365:../avrlib/timer.c ****
366:../avrlib/timer.c **** void timer1PWMBOff(void)
367:../avrlib/timer.c **** {
965 .LM93:
966 /* prologue: frame size=0 */
967 /* prologue end (size=0) */
368:../avrlib/timer.c **** // turn off channel B (OC1B) PWM output
369:../avrlib/timer.c **** // set OC1B (OutputCompare action) to none
370:../avrlib/timer.c **** cbi(TCCR1A,COM1B1);
969 .LM94:
970 02ea 8FB5 in r24,79-0x20
971 02ec 8F7D andi r24,lo8(-33)
972 02ee 8FBD out 79-0x20,r24
371:../avrlib/timer.c **** cbi(TCCR1A,COM1B0);
974 .LM95:
975 02f0 8FB5 in r24,79-0x20
976 02f2 8F7E andi r24,lo8(-17)
977 02f4 8FBD out 79-0x20,r24
978 /* epilogue: frame size=0 */
979 02f6 0895 ret
980 /* epilogue end (size=1) */
981 /* function timer1PWMBOff size 7 (6) */
983 .Lscope21:
986 .global timer1PWMOff
988 timer1PWMOff:
990 .LM96:
991 /* prologue: frame size=0 */
992 /* prologue end (size=0) */
994 .LM97:
995 02f8 8FB5 in r24,79-0x20
996 02fa 8D7F andi r24,lo8(-3)
997 02fc 8FBD out 79-0x20,r24
999 .LM98:
1000 02fe 8FB5 in r24,79-0x20
1001 0300 8E7F andi r24,lo8(-2)
1002 0302 8FBD out 79-0x20,r24
1004 .LM99:
1005 0304 EBDF rcall timer1PWMAOff
1007 .LM100:
1008 0306 F1DF rcall timer1PWMBOff
1009 /* epilogue: frame size=0 */
1010 0308 0895 ret
1011 /* epilogue end (size=1) */
1012 /* function timer1PWMOff size 9 (8) */
1014 .Lscope22:
1017 .global timer1PWMAOn
1019 timer1PWMAOn:
1021 .LM101:
1022 /* prologue: frame size=0 */
1023 /* prologue end (size=0) */
1025 .LM102:
1026 030a 8FB5 in r24,79-0x20
1027 030c 8068 ori r24,lo8(-128)
1028 030e 8FBD out 79-0x20,r24
1030 .LM103:
1031 0310 8FB5 in r24,79-0x20
1032 0312 8F7B andi r24,lo8(-65)
1033 0314 8FBD out 79-0x20,r24
1034 /* epilogue: frame size=0 */
1035 0316 0895 ret
1036 /* epilogue end (size=1) */
1037 /* function timer1PWMAOn size 7 (6) */
1039 .Lscope23:
1042 .global timer1PWMBOn
1044 timer1PWMBOn:
1046 .LM104:
1047 /* prologue: frame size=0 */
1048 /* prologue end (size=0) */
1050 .LM105:
1051 0318 8FB5 in r24,79-0x20
1052 031a 8062 ori r24,lo8(32)
1053 031c 8FBD out 79-0x20,r24
1055 .LM106:
1056 031e 8FB5 in r24,79-0x20
1057 0320 8F7E andi r24,lo8(-17)
1058 0322 8FBD out 79-0x20,r24
1059 /* epilogue: frame size=0 */
1060 0324 0895 ret
1061 /* epilogue end (size=1) */
1062 /* function timer1PWMBOn size 7 (6) */
1064 .Lscope24:
1068 .global timer1PWMASet
1070 timer1PWMASet:
372:../avrlib/timer.c **** }
373:../avrlib/timer.c ****
374:../avrlib/timer.c **** void timer1PWMASet(u16 pwmDuty)
375:../avrlib/timer.c **** {
1072 .LM107:
1073 /* prologue: frame size=0 */
1074 /* prologue end (size=0) */
376:../avrlib/timer.c **** // set PWM (output compare) duty for channel A
377:../avrlib/timer.c **** // this PWM output is generated on OC1A pin
378:../avrlib/timer.c **** // NOTE: pwmDuty should be in the range 0-255 for 8bit PWM
379:../avrlib/timer.c **** // pwmDuty should be in the range 0-511 for 9bit PWM
380:../avrlib/timer.c **** // pwmDuty should be in the range 0-1023 for 10bit PWM
381:../avrlib/timer.c **** //outp( (pwmDuty>>8), OCR1AH); // set the high 8bits of OCR1A
382:../avrlib/timer.c **** //outp( (pwmDuty&0x00FF), OCR1AL); // set the low 8bits of OCR1A
383:../avrlib/timer.c **** OCR1A = pwmDuty;
1076 .LM108:
1077 0326 9BBD out (74)+1-0x20,r25
1078 0328 8ABD out 74-0x20,r24
1079 /* epilogue: frame size=0 */
1080 032a 0895 ret
1081 /* epilogue end (size=1) */
1082 /* function timer1PWMASet size 3 (2) */
1084 .Lscope25:
1088 .global timer1PWMBSet
1090 timer1PWMBSet:
384:../avrlib/timer.c **** }
385:../avrlib/timer.c ****
386:../avrlib/timer.c **** void timer1PWMBSet(u16 pwmDuty)
387:../avrlib/timer.c **** {
1092 .LM109:
1093 /* prologue: frame size=0 */
1094 /* prologue end (size=0) */
388:../avrlib/timer.c **** // set PWM (output compare) duty for channel B
389:../avrlib/timer.c **** // this PWM output is generated on OC1B pin
390:../avrlib/timer.c **** // NOTE: pwmDuty should be in the range 0-255 for 8bit PWM
391:../avrlib/timer.c **** // pwmDuty should be in the range 0-511 for 9bit PWM
392:../avrlib/timer.c **** // pwmDuty should be in the range 0-1023 for 10bit PWM
393:../avrlib/timer.c **** //outp( (pwmDuty>>8), OCR1BH); // set the high 8bits of OCR1B
394:../avrlib/timer.c **** //outp( (pwmDuty&0x00FF), OCR1BL); // set the low 8bits of OCR1B
395:../avrlib/timer.c **** OCR1B = pwmDuty;
1096 .LM110:
1097 032c 99BD out (72)+1-0x20,r25
1098 032e 88BD out 72-0x20,r24
1099 /* epilogue: frame size=0 */
1100 0330 0895 ret
1101 /* epilogue end (size=1) */
1102 /* function timer1PWMBSet size 3 (2) */
1104 .Lscope26:
1107 .global __vector_9
1109 __vector_9:
396:../avrlib/timer.c **** }
397:../avrlib/timer.c ****
398:../avrlib/timer.c **** //! Interrupt handler for tcnt0 overflow interrupt
399:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW0)
400:../avrlib/timer.c **** {
1111 .LM111:
1112 /* prologue: frame size=0 */
1113 0332 1F92 push __zero_reg__
1114 0334 0F92 push __tmp_reg__
1115 0336 0FB6 in __tmp_reg__,__SREG__
1116 0338 0F92 push __tmp_reg__
1117 033a 1124 clr __zero_reg__
1118 033c 2F93 push r18
1119 033e 3F93 push r19
1120 0340 4F93 push r20
1121 0342 5F93 push r21
1122 0344 6F93 push r22
1123 0346 7F93 push r23
1124 0348 8F93 push r24
1125 034a 9F93 push r25
1126 034c AF93 push r26
1127 034e BF93 push r27
1128 0350 EF93 push r30
1129 0352 FF93 push r31
1130 /* prologue end (size=17) */
401:../avrlib/timer.c **** Timer0Reg0++; // increment low-order counter
1132 .LM112:
1133 0354 8091 0000 lds r24,Timer0Reg0
1134 0358 9091 0000 lds r25,(Timer0Reg0)+1
1135 035c A091 0000 lds r26,(Timer0Reg0)+2
1136 0360 B091 0000 lds r27,(Timer0Reg0)+3
1137 0364 0196 adiw r24,1
1138 0366 A11D adc r26,__zero_reg__
1139 0368 B11D adc r27,__zero_reg__
1140 036a 8093 0000 sts Timer0Reg0,r24
1141 036e 9093 0000 sts (Timer0Reg0)+1,r25
1142 0372 A093 0000 sts (Timer0Reg0)+2,r26
1143 0376 B093 0000 sts (Timer0Reg0)+3,r27
402:../avrlib/timer.c ****
403:../avrlib/timer.c **** // increment pause counter
404:../avrlib/timer.c **** TimerPauseReg++;
1145 .LM113:
1146 037a 8091 0000 lds r24,TimerPauseReg
1147 037e 9091 0000 lds r25,(TimerPauseReg)+1
1148 0382 A091 0000 lds r26,(TimerPauseReg)+2
1149 0386 B091 0000 lds r27,(TimerPauseReg)+3
1150 038a 0196 adiw r24,1
1151 038c A11D adc r26,__zero_reg__
1152 038e B11D adc r27,__zero_reg__
1153 0390 8093 0000 sts TimerPauseReg,r24
1154 0394 9093 0000 sts (TimerPauseReg)+1,r25
1155 0398 A093 0000 sts (TimerPauseReg)+2,r26
1156 039c B093 0000 sts (TimerPauseReg)+3,r27
405:../avrlib/timer.c ****
406:../avrlib/timer.c **** // if a user function is defined, execute it too
407:../avrlib/timer.c **** if(TimerIntFunc[TIMER0OVERFLOW_INT])
1158 .LM114:
1159 03a0 8091 0000 lds r24,TimerIntFunc
1160 03a4 9091 0000 lds r25,(TimerIntFunc)+1
1161 03a8 892B or r24,r25
1162 03aa 29F0 breq .L59
408:../avrlib/timer.c **** TimerIntFunc[TIMER0OVERFLOW_INT]();
1164 .LM115:
1165 03ac E091 0000 lds r30,TimerIntFunc
1166 03b0 F091 0000 lds r31,(TimerIntFunc)+1
1167 03b4 0995 icall
1168 .L59:
1169 /* epilogue: frame size=0 */
1170 03b6 FF91 pop r31
1171 03b8 EF91 pop r30
1172 03ba BF91 pop r27
1173 03bc AF91 pop r26
1174 03be 9F91 pop r25
1175 03c0 8F91 pop r24
1176 03c2 7F91 pop r23
1177 03c4 6F91 pop r22
1178 03c6 5F91 pop r21
1179 03c8 4F91 pop r20
1180 03ca 3F91 pop r19
1181 03cc 2F91 pop r18
1182 03ce 0F90 pop __tmp_reg__
1183 03d0 0FBE out __SREG__,__tmp_reg__
1184 03d2 0F90 pop __tmp_reg__
1185 03d4 1F90 pop __zero_reg__
1186 03d6 1895 reti
1187 /* epilogue end (size=17) */
1188 /* function __vector_9 size 83 (49) */
1190 .Lscope27:
1193 .global __vector_8
1195 __vector_8:
409:../avrlib/timer.c **** }
410:../avrlib/timer.c ****
411:../avrlib/timer.c **** //! Interrupt handler for tcnt1 overflow interrupt
412:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW1)
413:../avrlib/timer.c **** {
1197 .LM116:
1198 /* prologue: frame size=0 */
1199 03d8 1F92 push __zero_reg__
1200 03da 0F92 push __tmp_reg__
1201 03dc 0FB6 in __tmp_reg__,__SREG__
1202 03de 0F92 push __tmp_reg__
1203 03e0 1124 clr __zero_reg__
1204 03e2 2F93 push r18
1205 03e4 3F93 push r19
1206 03e6 4F93 push r20
1207 03e8 5F93 push r21
1208 03ea 6F93 push r22
1209 03ec 7F93 push r23
1210 03ee 8F93 push r24
1211 03f0 9F93 push r25
1212 03f2 AF93 push r26
1213 03f4 BF93 push r27
1214 03f6 EF93 push r30
1215 03f8 FF93 push r31
1216 /* prologue end (size=17) */
414:../avrlib/timer.c **** // if a user function is defined, execute it
415:../avrlib/timer.c **** if(TimerIntFunc[TIMER1OVERFLOW_INT])
1218 .LM117:
1219 03fa 8091 0000 lds r24,TimerIntFunc+2
1220 03fe 9091 0000 lds r25,(TimerIntFunc+2)+1
1221 0402 892B or r24,r25
1222 0404 29F0 breq .L61
416:../avrlib/timer.c **** TimerIntFunc[TIMER1OVERFLOW_INT]();
1224 .LM118:
1225 0406 E091 0000 lds r30,TimerIntFunc+2
1226 040a F091 0000 lds r31,(TimerIntFunc+2)+1
1227 040e 0995 icall
1228 .L61:
1229 /* epilogue: frame size=0 */
1230 0410 FF91 pop r31
1231 0412 EF91 pop r30
1232 0414 BF91 pop r27
1233 0416 AF91 pop r26
1234 0418 9F91 pop r25
1235 041a 8F91 pop r24
1236 041c 7F91 pop r23
1237 041e 6F91 pop r22
1238 0420 5F91 pop r21
1239 0422 4F91 pop r20
1240 0424 3F91 pop r19
1241 0426 2F91 pop r18
1242 0428 0F90 pop __tmp_reg__
1243 042a 0FBE out __SREG__,__tmp_reg__
1244 042c 0F90 pop __tmp_reg__
1245 042e 1F90 pop __zero_reg__
1246 0430 1895 reti
1247 /* epilogue end (size=17) */
1248 /* function __vector_8 size 45 (11) */
1250 .Lscope28:
1253 .global __vector_4
1255 __vector_4:
417:../avrlib/timer.c **** }
418:../avrlib/timer.c ****
419:../avrlib/timer.c **** #ifdef TCNT2 // support timer2 only if it exists
420:../avrlib/timer.c **** //! Interrupt handler for tcnt2 overflow interrupt
421:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW2)
422:../avrlib/timer.c **** {
1257 .LM119:
1258 /* prologue: frame size=0 */
1259 0432 1F92 push __zero_reg__
1260 0434 0F92 push __tmp_reg__
1261 0436 0FB6 in __tmp_reg__,__SREG__
1262 0438 0F92 push __tmp_reg__
1263 043a 1124 clr __zero_reg__
1264 043c 2F93 push r18
1265 043e 3F93 push r19
1266 0440 4F93 push r20
1267 0442 5F93 push r21
1268 0444 6F93 push r22
1269 0446 7F93 push r23
1270 0448 8F93 push r24
1271 044a 9F93 push r25
1272 044c AF93 push r26
1273 044e BF93 push r27
1274 0450 EF93 push r30
1275 0452 FF93 push r31
1276 /* prologue end (size=17) */
423:../avrlib/timer.c **** Timer2Reg0++; // increment low-order counter
1278 .LM120:
1279 0454 8091 0000 lds r24,Timer2Reg0
1280 0458 9091 0000 lds r25,(Timer2Reg0)+1
1281 045c A091 0000 lds r26,(Timer2Reg0)+2
1282 0460 B091 0000 lds r27,(Timer2Reg0)+3
1283 0464 0196 adiw r24,1
1284 0466 A11D adc r26,__zero_reg__
1285 0468 B11D adc r27,__zero_reg__
1286 046a 8093 0000 sts Timer2Reg0,r24
1287 046e 9093 0000 sts (Timer2Reg0)+1,r25
1288 0472 A093 0000 sts (Timer2Reg0)+2,r26
1289 0476 B093 0000 sts (Timer2Reg0)+3,r27
424:../avrlib/timer.c ****
425:../avrlib/timer.c **** // if a user function is defined, execute it
426:../avrlib/timer.c **** if(TimerIntFunc[TIMER2OVERFLOW_INT])
1291 .LM121:
1292 047a 8091 0000 lds r24,TimerIntFunc+10
1293 047e 9091 0000 lds r25,(TimerIntFunc+10)+1
1294 0482 892B or r24,r25
1295 0484 29F0 breq .L63
427:../avrlib/timer.c **** TimerIntFunc[TIMER2OVERFLOW_INT]();
1297 .LM122:
1298 0486 E091 0000 lds r30,TimerIntFunc+10
1299 048a F091 0000 lds r31,(TimerIntFunc+10)+1
1300 048e 0995 icall
1301 .L63:
1302 /* epilogue: frame size=0 */
1303 0490 FF91 pop r31
1304 0492 EF91 pop r30
1305 0494 BF91 pop r27
1306 0496 AF91 pop r26
1307 0498 9F91 pop r25
1308 049a 8F91 pop r24
1309 049c 7F91 pop r23
1310 049e 6F91 pop r22
1311 04a0 5F91 pop r21
1312 04a2 4F91 pop r20
1313 04a4 3F91 pop r19
1314 04a6 2F91 pop r18
1315 04a8 0F90 pop __tmp_reg__
1316 04aa 0FBE out __SREG__,__tmp_reg__
1317 04ac 0F90 pop __tmp_reg__
1318 04ae 1F90 pop __zero_reg__
1319 04b0 1895 reti
1320 /* epilogue end (size=17) */
1321 /* function __vector_4 size 64 (30) */
1323 .Lscope29:
1326 .global __vector_6
1328 __vector_6:
428:../avrlib/timer.c **** }
429:../avrlib/timer.c **** #endif
430:../avrlib/timer.c ****
431:../avrlib/timer.c **** #ifdef OCR0
432:../avrlib/timer.c **** // include support for Output Compare 0 for new AVR processors that support it
433:../avrlib/timer.c **** //! Interrupt handler for OutputCompare0 match (OC0) interrupt
434:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE0)
435:../avrlib/timer.c **** {
436:../avrlib/timer.c **** // if a user function is defined, execute it
437:../avrlib/timer.c **** if(TimerIntFunc[TIMER0OUTCOMPARE_INT])
438:../avrlib/timer.c **** TimerIntFunc[TIMER0OUTCOMPARE_INT]();
439:../avrlib/timer.c **** }
440:../avrlib/timer.c **** #endif
441:../avrlib/timer.c ****
442:../avrlib/timer.c **** //! Interrupt handler for CutputCompare1A match (OC1A) interrupt
443:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1A)
444:../avrlib/timer.c **** {
1330 .LM123:
1331 /* prologue: frame size=0 */
1332 04b2 1F92 push __zero_reg__
1333 04b4 0F92 push __tmp_reg__
1334 04b6 0FB6 in __tmp_reg__,__SREG__
1335 04b8 0F92 push __tmp_reg__
1336 04ba 1124 clr __zero_reg__
1337 04bc 2F93 push r18
1338 04be 3F93 push r19
1339 04c0 4F93 push r20
1340 04c2 5F93 push r21
1341 04c4 6F93 push r22
1342 04c6 7F93 push r23
1343 04c8 8F93 push r24
1344 04ca 9F93 push r25
1345 04cc AF93 push r26
1346 04ce BF93 push r27
1347 04d0 EF93 push r30
1348 04d2 FF93 push r31
1349 /* prologue end (size=17) */
445:../avrlib/timer.c **** // if a user function is defined, execute it
446:../avrlib/timer.c **** if(TimerIntFunc[TIMER1OUTCOMPAREA_INT])
1351 .LM124:
1352 04d4 8091 0000 lds r24,TimerIntFunc+4
1353 04d8 9091 0000 lds r25,(TimerIntFunc+4)+1
1354 04dc 892B or r24,r25
1355 04de 29F0 breq .L65
447:../avrlib/timer.c **** TimerIntFunc[TIMER1OUTCOMPAREA_INT]();
1357 .LM125:
1358 04e0 E091 0000 lds r30,TimerIntFunc+4
1359 04e4 F091 0000 lds r31,(TimerIntFunc+4)+1
1360 04e8 0995 icall
1361 .L65:
1362 /* epilogue: frame size=0 */
1363 04ea FF91 pop r31
1364 04ec EF91 pop r30
1365 04ee BF91 pop r27
1366 04f0 AF91 pop r26
1367 04f2 9F91 pop r25
1368 04f4 8F91 pop r24
1369 04f6 7F91 pop r23
1370 04f8 6F91 pop r22
1371 04fa 5F91 pop r21
1372 04fc 4F91 pop r20
1373 04fe 3F91 pop r19
1374 0500 2F91 pop r18
1375 0502 0F90 pop __tmp_reg__
1376 0504 0FBE out __SREG__,__tmp_reg__
1377 0506 0F90 pop __tmp_reg__
1378 0508 1F90 pop __zero_reg__
1379 050a 1895 reti
1380 /* epilogue end (size=17) */
1381 /* function __vector_6 size 45 (11) */
1383 .Lscope30:
1386 .global __vector_7
1388 __vector_7:
448:../avrlib/timer.c **** }
449:../avrlib/timer.c ****
450:../avrlib/timer.c **** //! Interrupt handler for OutputCompare1B match (OC1B) interrupt
451:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1B)
452:../avrlib/timer.c **** {
1390 .LM126:
1391 /* prologue: frame size=0 */
1392 050c 1F92 push __zero_reg__
1393 050e 0F92 push __tmp_reg__
1394 0510 0FB6 in __tmp_reg__,__SREG__
1395 0512 0F92 push __tmp_reg__
1396 0514 1124 clr __zero_reg__
1397 0516 2F93 push r18
1398 0518 3F93 push r19
1399 051a 4F93 push r20
1400 051c 5F93 push r21
1401 051e 6F93 push r22
1402 0520 7F93 push r23
1403 0522 8F93 push r24
1404 0524 9F93 push r25
1405 0526 AF93 push r26
1406 0528 BF93 push r27
1407 052a EF93 push r30
1408 052c FF93 push r31
1409 /* prologue end (size=17) */
453:../avrlib/timer.c **** // if a user function is defined, execute it
454:../avrlib/timer.c **** if(TimerIntFunc[TIMER1OUTCOMPAREB_INT])
1411 .LM127:
1412 052e 8091 0000 lds r24,TimerIntFunc+6
1413 0532 9091 0000 lds r25,(TimerIntFunc+6)+1
1414 0536 892B or r24,r25
1415 0538 29F0 breq .L67
455:../avrlib/timer.c **** TimerIntFunc[TIMER1OUTCOMPAREB_INT]();
1417 .LM128:
1418 053a E091 0000 lds r30,TimerIntFunc+6
1419 053e F091 0000 lds r31,(TimerIntFunc+6)+1
1420 0542 0995 icall
1421 .L67:
1422 /* epilogue: frame size=0 */
1423 0544 FF91 pop r31
1424 0546 EF91 pop r30
1425 0548 BF91 pop r27
1426 054a AF91 pop r26
1427 054c 9F91 pop r25
1428 054e 8F91 pop r24
1429 0550 7F91 pop r23
1430 0552 6F91 pop r22
1431 0554 5F91 pop r21
1432 0556 4F91 pop r20
1433 0558 3F91 pop r19
1434 055a 2F91 pop r18
1435 055c 0F90 pop __tmp_reg__
1436 055e 0FBE out __SREG__,__tmp_reg__
1437 0560 0F90 pop __tmp_reg__
1438 0562 1F90 pop __zero_reg__
1439 0564 1895 reti
1440 /* epilogue end (size=17) */
1441 /* function __vector_7 size 45 (11) */
1443 .Lscope31:
1446 .global __vector_5
1448 __vector_5:
456:../avrlib/timer.c **** }
457:../avrlib/timer.c ****
458:../avrlib/timer.c **** //! Interrupt handler for InputCapture1 (IC1) interrupt
459:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_INPUT_CAPTURE1)
460:../avrlib/timer.c **** {
1450 .LM129:
1451 /* prologue: frame size=0 */
1452 0566 1F92 push __zero_reg__
1453 0568 0F92 push __tmp_reg__
1454 056a 0FB6 in __tmp_reg__,__SREG__
1455 056c 0F92 push __tmp_reg__
1456 056e 1124 clr __zero_reg__
1457 0570 2F93 push r18
1458 0572 3F93 push r19
1459 0574 4F93 push r20
1460 0576 5F93 push r21
1461 0578 6F93 push r22
1462 057a 7F93 push r23
1463 057c 8F93 push r24
1464 057e 9F93 push r25
1465 0580 AF93 push r26
1466 0582 BF93 push r27
1467 0584 EF93 push r30
1468 0586 FF93 push r31
1469 /* prologue end (size=17) */
461:../avrlib/timer.c **** // if a user function is defined, execute it
462:../avrlib/timer.c **** if(TimerIntFunc[TIMER1INPUTCAPTURE_INT])
1471 .LM130:
1472 0588 8091 0000 lds r24,TimerIntFunc+8
1473 058c 9091 0000 lds r25,(TimerIntFunc+8)+1
1474 0590 892B or r24,r25
1475 0592 29F0 breq .L69
463:../avrlib/timer.c **** TimerIntFunc[TIMER1INPUTCAPTURE_INT]();
1477 .LM131:
1478 0594 E091 0000 lds r30,TimerIntFunc+8
1479 0598 F091 0000 lds r31,(TimerIntFunc+8)+1
1480 059c 0995 icall
1481 .L69:
1482 /* epilogue: frame size=0 */
1483 059e FF91 pop r31
1484 05a0 EF91 pop r30
1485 05a2 BF91 pop r27
1486 05a4 AF91 pop r26
1487 05a6 9F91 pop r25
1488 05a8 8F91 pop r24
1489 05aa 7F91 pop r23
1490 05ac 6F91 pop r22
1491 05ae 5F91 pop r21
1492 05b0 4F91 pop r20
1493 05b2 3F91 pop r19
1494 05b4 2F91 pop r18
1495 05b6 0F90 pop __tmp_reg__
1496 05b8 0FBE out __SREG__,__tmp_reg__
1497 05ba 0F90 pop __tmp_reg__
1498 05bc 1F90 pop __zero_reg__
1499 05be 1895 reti
1500 /* epilogue end (size=17) */
1501 /* function __vector_5 size 45 (11) */
1503 .Lscope32:
1506 .global __vector_3
1508 __vector_3:
464:../avrlib/timer.c **** }
465:../avrlib/timer.c ****
466:../avrlib/timer.c **** //! Interrupt handler for OutputCompare2 match (OC2) interrupt
467:../avrlib/timer.c **** TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE2)
468:../avrlib/timer.c **** {
1510 .LM132:
1511 /* prologue: frame size=0 */
1512 05c0 1F92 push __zero_reg__
1513 05c2 0F92 push __tmp_reg__
1514 05c4 0FB6 in __tmp_reg__,__SREG__
1515 05c6 0F92 push __tmp_reg__
1516 05c8 1124 clr __zero_reg__
1517 05ca 2F93 push r18
1518 05cc 3F93 push r19
1519 05ce 4F93 push r20
1520 05d0 5F93 push r21
1521 05d2 6F93 push r22
1522 05d4 7F93 push r23
1523 05d6 8F93 push r24
1524 05d8 9F93 push r25
1525 05da AF93 push r26
1526 05dc BF93 push r27
1527 05de EF93 push r30
1528 05e0 FF93 push r31
1529 /* prologue end (size=17) */
469:../avrlib/timer.c **** // if a user function is defined, execute it
470:../avrlib/timer.c **** if(TimerIntFunc[TIMER2OUTCOMPARE_INT])
1531 .LM133:
1532 05e2 8091 0000 lds r24,TimerIntFunc+12
1533 05e6 9091 0000 lds r25,(TimerIntFunc+12)+1
1534 05ea 892B or r24,r25
1535 05ec 29F0 breq .L71
471:../avrlib/timer.c **** TimerIntFunc[TIMER2OUTCOMPARE_INT]();
1537 .LM134:
1538 05ee E091 0000 lds r30,TimerIntFunc+12
1539 05f2 F091 0000 lds r31,(TimerIntFunc+12)+1
1540 05f6 0995 icall
1541 .L71:
1542 /* epilogue: frame size=0 */
1543 05f8 FF91 pop r31
1544 05fa EF91 pop r30
1545 05fc BF91 pop r27
1546 05fe AF91 pop r26
1547 0600 9F91 pop r25
1548 0602 8F91 pop r24
1549 0604 7F91 pop r23
1550 0606 6F91 pop r22
1551 0608 5F91 pop r21
1552 060a 4F91 pop r20
1553 060c 3F91 pop r19
1554 060e 2F91 pop r18
1555 0610 0F90 pop __tmp_reg__
1556 0612 0FBE out __SREG__,__tmp_reg__
1557 0614 0F90 pop __tmp_reg__
1558 0616 1F90 pop __zero_reg__
1559 0618 1895 reti
1560 /* epilogue end (size=17) */
1561 /* function __vector_3 size 45 (11) */
1563 .Lscope33:
1565 .comm TimerPauseReg,4,1
1566 .comm Timer0Reg0,4,1
1567 .comm Timer2Reg0,4,1
1568 .lcomm TimerIntFunc,14
1575 .text
1577 Letext:
1578 /* File "../avrlib/timer.c": code 797 = 0x031d ( 517), prologues 127, epilogues 153 */
DEFINED SYMBOLS
*ABS*:00000000 timer.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
/var/tmp//cca6lG7e.s:98 .progmem.data:00000000 TimerRTCPrescaleFactor
/var/tmp//cca6lG7e.s:110 .progmem.data:00000010 TimerPrescaleFactor
/var/tmp//cca6lG7e.s:122 .text:00000000 delay_us
/var/tmp//cca6lG7e.s:167 .text:00000026 timerDetach
.bss:00000000 TimerIntFunc
/var/tmp//cca6lG7e.s:199 .text:0000003e timer0SetPrescaler
/var/tmp//cca6lG7e.s:220 .text:00000048 timer0ClearOverflowCount
*COM*:00000004 Timer0Reg0
/var/tmp//cca6lG7e.s:241 .text:0000005a timer0Init
/var/tmp//cca6lG7e.s:272 .text:0000006a timer1SetPrescaler
/var/tmp//cca6lG7e.s:293 .text:00000074 timer1Init
/var/tmp//cca6lG7e.s:324 .text:00000084 timer2SetPrescaler
/var/tmp//cca6lG7e.s:345 .text:0000008e timer2ClearOverflowCount
*COM*:00000004 Timer2Reg0
/var/tmp//cca6lG7e.s:366 .text:000000a0 timer2Init
/var/tmp//cca6lG7e.s:396 .text:000000b0 timerInit
/var/tmp//cca6lG7e.s:443 .text:000000ca timer0GetPrescaler
/var/tmp//cca6lG7e.s:481 .text:000000e2 timer1GetPrescaler
/var/tmp//cca6lG7e.s:519 .text:000000fa timer2GetPrescaler
/var/tmp//cca6lG7e.s:559 .text:00000112 timerAttach
/var/tmp//cca6lG7e.s:591 .text:0000012a timerPause
*COM*:00000004 TimerPauseReg
/var/tmp//cca6lG7e.s:774 .text:00000258 timer0GetOverflowCount
/var/tmp//cca6lG7e.s:799 .text:0000026e timer2GetOverflowCount
/var/tmp//cca6lG7e.s:825 .text:00000284 timer1PWMInit
/var/tmp//cca6lG7e.s:890 .text:000002b4 timer1PWMInitICR
/var/tmp//cca6lG7e.s:938 .text:000002dc timer1PWMAOff
/var/tmp//cca6lG7e.s:963 .text:000002ea timer1PWMBOff
/var/tmp//cca6lG7e.s:988 .text:000002f8 timer1PWMOff
/var/tmp//cca6lG7e.s:1019 .text:0000030a timer1PWMAOn
/var/tmp//cca6lG7e.s:1044 .text:00000318 timer1PWMBOn
/var/tmp//cca6lG7e.s:1070 .text:00000326 timer1PWMASet
/var/tmp//cca6lG7e.s:1090 .text:0000032c timer1PWMBSet
/var/tmp//cca6lG7e.s:1109 .text:00000332 __vector_9
/var/tmp//cca6lG7e.s:1195 .text:000003d8 __vector_8
/var/tmp//cca6lG7e.s:1255 .text:00000432 __vector_4
/var/tmp//cca6lG7e.s:1328 .text:000004b2 __vector_6
/var/tmp//cca6lG7e.s:1388 .text:0000050c __vector_7
/var/tmp//cca6lG7e.s:1448 .text:00000566 __vector_5
/var/tmp//cca6lG7e.s:1508 .text:000005c0 __vector_3
/var/tmp//cca6lG7e.s:1577 .text:0000061a Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
__udivmodhi4
__divmodsi4
__mulsi3
__udivmodsi4

View File

@ -1,789 +0,0 @@
1 .file "uart.c"
2 .arch atmega8
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
12 .text
13 .Ltext0:
86 .global uartSetBaudRate
88 uartSetBaudRate:
1:../avrlib/uart.c **** /*! \file uart.c \brief UART driver with buffer support. */
2:../avrlib/uart.c **** // *****************************************************************************
3:../avrlib/uart.c **** //
4:../avrlib/uart.c **** // File Name : 'uart.c'
5:../avrlib/uart.c **** // Title : UART driver with buffer support
6:../avrlib/uart.c **** // Author : Pascal Stang - Copyright (C) 2000-2002
7:../avrlib/uart.c **** // Created : 11/22/2000
8:../avrlib/uart.c **** // Revised : 06/09/2003
9:../avrlib/uart.c **** // Version : 1.3
10:../avrlib/uart.c **** // Target MCU : ATMEL AVR Series
11:../avrlib/uart.c **** // Editor Tabs : 4
12:../avrlib/uart.c **** //
13:../avrlib/uart.c **** // This code is distributed under the GNU Public License
14:../avrlib/uart.c **** // which can be found at http://www.gnu.org/licenses/gpl.txt
15:../avrlib/uart.c **** //
16:../avrlib/uart.c **** // *****************************************************************************
17:../avrlib/uart.c ****
18:../avrlib/uart.c **** #include <avr/io.h>
19:../avrlib/uart.c **** #include <avr/interrupt.h>
20:../avrlib/uart.c **** #include <avr/signal.h>
21:../avrlib/uart.c ****
22:../avrlib/uart.c **** #include "buffer.h"
23:../avrlib/uart.c **** #include "uart.h"
24:../avrlib/uart.c ****
25:../avrlib/uart.c **** // UART global variables
26:../avrlib/uart.c **** // flag variables
27:../avrlib/uart.c **** volatile u08 uartReadyTx; ///< uartReadyTx flag
28:../avrlib/uart.c **** volatile u08 uartBufferedTx; ///< uartBufferedTx flag
29:../avrlib/uart.c **** // receive and transmit buffers
30:../avrlib/uart.c **** cBuffer uartRxBuffer; ///< uart receive buffer
31:../avrlib/uart.c **** cBuffer uartTxBuffer; ///< uart transmit buffer
32:../avrlib/uart.c **** unsigned short uartRxOverflow; ///< receive overflow counter
33:../avrlib/uart.c ****
34:../avrlib/uart.c **** #ifndef UART_BUFFERS_EXTERNAL_RAM
35:../avrlib/uart.c **** // using internal ram,
36:../avrlib/uart.c **** // automatically allocate space in ram for each buffer
37:../avrlib/uart.c **** static char uartRxData[UART_RX_BUFFER_SIZE];
38:../avrlib/uart.c **** static char uartTxData[UART_TX_BUFFER_SIZE];
39:../avrlib/uart.c **** #endif
40:../avrlib/uart.c ****
41:../avrlib/uart.c **** typedef void (*voidFuncPtru08)(unsigned char);
42:../avrlib/uart.c **** volatile static voidFuncPtru08 UartRxFunc;
43:../avrlib/uart.c ****
44:../avrlib/uart.c **** //! enable and initialize the uart
45:../avrlib/uart.c **** void uartInit(void)
46:../avrlib/uart.c **** {
47:../avrlib/uart.c **** // initialize the buffers
48:../avrlib/uart.c **** uartInitBuffers();
49:../avrlib/uart.c **** // initialize user receive handler
50:../avrlib/uart.c **** UartRxFunc = 0;
51:../avrlib/uart.c ****
52:../avrlib/uart.c **** // enable RxD/TxD and interrupts
53:../avrlib/uart.c **** outb(UCR, BV(RXCIE)|BV(TXCIE)|BV(RXEN)|BV(TXEN));
54:../avrlib/uart.c ****
55:../avrlib/uart.c **** // set default baud rate
56:../avrlib/uart.c **** uartSetBaudRate(UART_DEFAULT_BAUD_RATE);
57:../avrlib/uart.c **** // initialize states
58:../avrlib/uart.c **** uartReadyTx = TRUE;
59:../avrlib/uart.c **** uartBufferedTx = FALSE;
60:../avrlib/uart.c **** // clear overflow count
61:../avrlib/uart.c **** uartRxOverflow = 0;
62:../avrlib/uart.c **** // enable interrupts
63:../avrlib/uart.c **** sei();
64:../avrlib/uart.c **** }
65:../avrlib/uart.c ****
66:../avrlib/uart.c **** //! create and initialize the uart transmit and receive buffers
67:../avrlib/uart.c **** void uartInitBuffers(void)
68:../avrlib/uart.c **** {
69:../avrlib/uart.c **** #ifndef UART_BUFFERS_EXTERNAL_RAM
70:../avrlib/uart.c **** // initialize the UART receive buffer
71:../avrlib/uart.c **** bufferInit(&uartRxBuffer, uartRxData, UART_RX_BUFFER_SIZE);
72:../avrlib/uart.c **** // initialize the UART transmit buffer
73:../avrlib/uart.c **** bufferInit(&uartTxBuffer, uartTxData, UART_TX_BUFFER_SIZE);
74:../avrlib/uart.c **** #else
75:../avrlib/uart.c **** // initialize the UART receive buffer
76:../avrlib/uart.c **** bufferInit(&uartRxBuffer, (u08*) UART_RX_BUFFER_ADDR, UART_RX_BUFFER_SIZE);
77:../avrlib/uart.c **** // initialize the UART transmit buffer
78:../avrlib/uart.c **** bufferInit(&uartTxBuffer, (u08*) UART_TX_BUFFER_ADDR, UART_TX_BUFFER_SIZE);
79:../avrlib/uart.c **** #endif
80:../avrlib/uart.c **** }
81:../avrlib/uart.c ****
82:../avrlib/uart.c **** //! redirects received data to a user function
83:../avrlib/uart.c **** void uartSetRxHandler(void (*rx_func)(unsigned char c))
84:../avrlib/uart.c **** {
85:../avrlib/uart.c **** // set the receive interrupt to run the supplied user function
86:../avrlib/uart.c **** UartRxFunc = rx_func;
87:../avrlib/uart.c **** }
88:../avrlib/uart.c ****
89:../avrlib/uart.c **** //! set the uart baud rate
90:../avrlib/uart.c **** void uartSetBaudRate(u32 baudrate)
91:../avrlib/uart.c **** {
90 .LM1:
91 /* prologue: frame size=0 */
92 /* prologue end (size=0) */
93 0000 DC01 movw r26,r24
94 0002 CB01 movw r24,r22
92:../avrlib/uart.c **** // calculate division factor for requested baud rate, and set it
93:../avrlib/uart.c **** u16 bauddiv = ((F_CPU+(baudrate*8L))/(baudrate*16L)-1);
96 .LM2:
97 0004 73E0 ldi r23,3
98 0006 880F 1: lsl r24
99 0008 991F rol r25
100 000a AA1F rol r26
101 000c BB1F rol r27
102 000e 7A95 dec r23
103 0010 D1F7 brne 1b
104 0012 9C01 movw r18,r24
105 0014 AD01 movw r20,r26
106 0016 220F lsl r18
107 0018 331F rol r19
108 001a 441F rol r20
109 001c 551F rol r21
110 001e 8050 subi r24,lo8(-(16000000))
111 0020 9C4D sbci r25,hi8(-(16000000))
112 0022 AB40 sbci r26,hlo8(-(16000000))
113 0024 BF4F sbci r27,hhi8(-(16000000))
114 0026 BC01 movw r22,r24
115 0028 CD01 movw r24,r26
116 002a 00D0 rcall __udivmodsi4
117 002c DA01 movw r26,r20
118 002e C901 movw r24,r18
119 0030 0197 sbiw r24,1
94:../avrlib/uart.c **** outb(UBRRL, bauddiv);
121 .LM3:
122 0032 89B9 out 41-0x20,r24
95:../avrlib/uart.c **** #ifdef UBRRH
96:../avrlib/uart.c **** outb(UBRRH, bauddiv>>8);
124 .LM4:
125 0034 892F mov r24,r25
126 0036 9927 clr r25
127 0038 80BD out 64-0x20,r24
128 /* epilogue: frame size=0 */
129 003a 0895 ret
130 /* epilogue end (size=1) */
131 /* function uartSetBaudRate size 30 (29) */
136 .Lscope0:
139 .global uartInitBuffers
141 uartInitBuffers:
143 .LM5:
144 /* prologue: frame size=0 */
145 /* prologue end (size=0) */
147 .LM6:
148 003c 40E4 ldi r20,lo8(64)
149 003e 50E0 ldi r21,hi8(64)
150 0040 60E0 ldi r22,lo8(uartRxData)
151 0042 70E0 ldi r23,hi8(uartRxData)
152 0044 80E0 ldi r24,lo8(uartRxBuffer)
153 0046 90E0 ldi r25,hi8(uartRxBuffer)
154 0048 00D0 rcall bufferInit
156 .LM7:
157 004a 40E4 ldi r20,lo8(64)
158 004c 50E0 ldi r21,hi8(64)
159 004e 60E0 ldi r22,lo8(uartTxData)
160 0050 70E0 ldi r23,hi8(uartTxData)
161 0052 80E0 ldi r24,lo8(uartTxBuffer)
162 0054 90E0 ldi r25,hi8(uartTxBuffer)
163 0056 00D0 rcall bufferInit
164 /* epilogue: frame size=0 */
165 0058 0895 ret
166 /* epilogue end (size=1) */
167 /* function uartInitBuffers size 15 (14) */
169 .Lscope1:
172 .global uartInit
174 uartInit:
176 .LM8:
177 /* prologue: frame size=0 */
178 /* prologue end (size=0) */
180 .LM9:
181 005a F0DF rcall uartInitBuffers
183 .LM10:
184 005c 1092 0000 sts (UartRxFunc)+1,__zero_reg__
185 0060 1092 0000 sts UartRxFunc,__zero_reg__
187 .LM11:
188 0064 88ED ldi r24,lo8(-40)
189 0066 8AB9 out 42-0x20,r24
191 .LM12:
192 0068 60E8 ldi r22,lo8(9600)
193 006a 75E2 ldi r23,hi8(9600)
194 006c 80E0 ldi r24,hlo8(9600)
195 006e 90E0 ldi r25,hhi8(9600)
196 0070 C7DF rcall uartSetBaudRate
198 .LM13:
199 0072 8FEF ldi r24,lo8(-1)
200 0074 8093 0000 sts uartReadyTx,r24
202 .LM14:
203 0078 1092 0000 sts uartBufferedTx,__zero_reg__
205 .LM15:
206 007c 1092 0000 sts (uartRxOverflow)+1,__zero_reg__
207 0080 1092 0000 sts uartRxOverflow,__zero_reg__
209 .LM16:
210 /* #APP */
211 0084 7894 sei
212 /* #NOAPP */
213 /* epilogue: frame size=0 */
214 0086 0895 ret
215 /* epilogue end (size=1) */
216 /* function uartInit size 24 (23) */
218 .Lscope2:
222 .global uartSetRxHandler
224 uartSetRxHandler:
226 .LM17:
227 /* prologue: frame size=0 */
228 /* prologue end (size=0) */
230 .LM18:
231 0088 9093 0000 sts (UartRxFunc)+1,r25
232 008c 8093 0000 sts UartRxFunc,r24
233 /* epilogue: frame size=0 */
234 0090 0895 ret
235 /* epilogue end (size=1) */
236 /* function uartSetRxHandler size 5 (4) */
238 .Lscope3:
241 .global uartGetRxBuffer
243 uartGetRxBuffer:
97:../avrlib/uart.c **** #endif
98:../avrlib/uart.c **** }
99:../avrlib/uart.c ****
100:../avrlib/uart.c **** //! returns the receive buffer structure
101:../avrlib/uart.c **** cBuffer* uartGetRxBuffer(void)
102:../avrlib/uart.c **** {
245 .LM19:
246 /* prologue: frame size=0 */
247 /* prologue end (size=0) */
103:../avrlib/uart.c **** // return rx buffer pointer
104:../avrlib/uart.c **** return &uartRxBuffer;
105:../avrlib/uart.c **** }
249 .LM20:
250 0092 80E0 ldi r24,lo8(uartRxBuffer)
251 0094 90E0 ldi r25,hi8(uartRxBuffer)
252 /* epilogue: frame size=0 */
253 0096 0895 ret
254 /* epilogue end (size=1) */
255 /* function uartGetRxBuffer size 3 (2) */
257 .Lscope4:
260 .global uartGetTxBuffer
262 uartGetTxBuffer:
106:../avrlib/uart.c ****
107:../avrlib/uart.c **** //! returns the transmit buffer structure
108:../avrlib/uart.c **** cBuffer* uartGetTxBuffer(void)
109:../avrlib/uart.c **** {
264 .LM21:
265 /* prologue: frame size=0 */
266 /* prologue end (size=0) */
110:../avrlib/uart.c **** // return tx buffer pointer
111:../avrlib/uart.c **** return &uartTxBuffer;
112:../avrlib/uart.c **** }
268 .LM22:
269 0098 80E0 ldi r24,lo8(uartTxBuffer)
270 009a 90E0 ldi r25,hi8(uartTxBuffer)
271 /* epilogue: frame size=0 */
272 009c 0895 ret
273 /* epilogue end (size=1) */
274 /* function uartGetTxBuffer size 3 (2) */
276 .Lscope5:
280 .global uartSendByte
282 uartSendByte:
113:../avrlib/uart.c ****
114:../avrlib/uart.c **** //! transmits a byte over the uart
115:../avrlib/uart.c **** void uartSendByte(u08 txData)
116:../avrlib/uart.c **** {
284 .LM23:
285 /* prologue: frame size=0 */
286 /* prologue end (size=0) */
287 009e 982F mov r25,r24
288 .L8:
117:../avrlib/uart.c **** // wait for the transmitter to be ready
118:../avrlib/uart.c **** while(!uartReadyTx);
290 .LM24:
291 00a0 8091 0000 lds r24,uartReadyTx
292 00a4 8823 tst r24
293 00a6 E1F3 breq .L8
119:../avrlib/uart.c **** // send byte
120:../avrlib/uart.c **** outb(UDR, txData);
295 .LM25:
296 00a8 9CB9 out 44-0x20,r25
121:../avrlib/uart.c **** // set ready state to FALSE
122:../avrlib/uart.c **** uartReadyTx = FALSE;
298 .LM26:
299 00aa 1092 0000 sts uartReadyTx,__zero_reg__
300 /* epilogue: frame size=0 */
301 00ae 0895 ret
302 /* epilogue end (size=1) */
303 /* function uartSendByte size 9 (8) */
305 .Lscope6:
309 .global uartReceiveByte
311 uartReceiveByte:
123:../avrlib/uart.c **** }
124:../avrlib/uart.c ****
125:../avrlib/uart.c **** //! gets a single byte from the uart receive buffer (getchar-style)
126:../avrlib/uart.c **** int uartGetByte(void)
127:../avrlib/uart.c **** {
128:../avrlib/uart.c **** u08 c;
129:../avrlib/uart.c **** if(uartReceiveByte(&c))
130:../avrlib/uart.c **** return c;
131:../avrlib/uart.c **** else
132:../avrlib/uart.c **** return -1;
133:../avrlib/uart.c **** }
134:../avrlib/uart.c ****
135:../avrlib/uart.c **** //! gets a byte (if available) from the uart receive buffer
136:../avrlib/uart.c **** u08 uartReceiveByte(u08* rxData)
137:../avrlib/uart.c **** {
313 .LM27:
314 /* prologue: frame size=0 */
315 00b0 CF93 push r28
316 00b2 DF93 push r29
317 /* prologue end (size=2) */
318 00b4 EC01 movw r28,r24
138:../avrlib/uart.c **** // make sure we have a receive buffer
139:../avrlib/uart.c **** if(uartRxBuffer.size)
320 .LM28:
321 00b6 8091 0000 lds r24,uartRxBuffer+2
322 00ba 9091 0000 lds r25,(uartRxBuffer+2)+1
323 00be 0097 sbiw r24,0
324 00c0 61F0 breq .L11
140:../avrlib/uart.c **** {
141:../avrlib/uart.c **** // make sure we have data
142:../avrlib/uart.c **** if(uartRxBuffer.datalength)
326 .LM29:
327 00c2 8091 0000 lds r24,uartRxBuffer+4
328 00c6 9091 0000 lds r25,(uartRxBuffer+4)+1
329 00ca 0097 sbiw r24,0
330 00cc 31F0 breq .L11
143:../avrlib/uart.c **** {
144:../avrlib/uart.c **** // get byte from beginning of buffer
145:../avrlib/uart.c **** *rxData = bufferGetFromFront(&uartRxBuffer);
332 .LM30:
333 00ce 80E0 ldi r24,lo8(uartRxBuffer)
334 00d0 90E0 ldi r25,hi8(uartRxBuffer)
335 00d2 00D0 rcall bufferGetFromFront
336 00d4 8883 st Y,r24
146:../avrlib/uart.c **** return TRUE;
338 .LM31:
339 00d6 8FEF ldi r24,lo8(255)
340 00d8 90E0 ldi r25,hi8(255)
341 .L11:
342 /* epilogue: frame size=0 */
343 00da DF91 pop r29
344 00dc CF91 pop r28
345 00de 0895 ret
346 /* epilogue end (size=3) */
347 /* function uartReceiveByte size 24 (19) */
349 .Lscope7:
352 .global uartGetByte
354 uartGetByte:
356 .LM32:
357 /* prologue: frame size=1 */
358 00e0 CF93 push r28
359 00e2 DF93 push r29
360 00e4 CDB7 in r28,__SP_L__
361 00e6 DEB7 in r29,__SP_H__
362 00e8 2197 sbiw r28,1
363 00ea 0FB6 in __tmp_reg__,__SREG__
364 00ec F894 cli
365 00ee DEBF out __SP_H__,r29
366 00f0 0FBE out __SREG__,__tmp_reg__
367 00f2 CDBF out __SP_L__,r28
368 /* prologue end (size=10) */
370 .LM33:
371 00f4 CE01 movw r24,r28
372 00f6 0196 adiw r24,1
373 00f8 DBDF rcall uartReceiveByte
374 00fa 8823 tst r24
375 00fc 19F0 breq .L17
377 .LM34:
378 00fe 8981 ldd r24,Y+1
379 0100 9927 clr r25
380 0102 02C0 rjmp .L16
381 .L17:
383 .LM35:
384 0104 8FEF ldi r24,lo8(-1)
385 0106 9FEF ldi r25,hi8(-1)
386 .L16:
387 /* epilogue: frame size=1 */
388 0108 2196 adiw r28,1
389 010a 0FB6 in __tmp_reg__,__SREG__
390 010c F894 cli
391 010e DEBF out __SP_H__,r29
392 0110 0FBE out __SREG__,__tmp_reg__
393 0112 CDBF out __SP_L__,r28
394 0114 DF91 pop r29
395 0116 CF91 pop r28
396 0118 0895 ret
397 /* epilogue end (size=9) */
398 /* function uartGetByte size 29 (10) */
403 .Lscope8:
406 .global uartFlushReceiveBuffer
408 uartFlushReceiveBuffer:
147:../avrlib/uart.c **** }
148:../avrlib/uart.c **** else
149:../avrlib/uart.c **** {
150:../avrlib/uart.c **** // no data
151:../avrlib/uart.c **** return FALSE;
152:../avrlib/uart.c **** }
153:../avrlib/uart.c **** }
154:../avrlib/uart.c **** else
155:../avrlib/uart.c **** {
156:../avrlib/uart.c **** // no buffer
157:../avrlib/uart.c **** return FALSE;
158:../avrlib/uart.c **** }
159:../avrlib/uart.c **** }
160:../avrlib/uart.c ****
161:../avrlib/uart.c **** //! flush all data out of the receive buffer
162:../avrlib/uart.c **** void uartFlushReceiveBuffer(void)
163:../avrlib/uart.c **** {
410 .LM36:
411 /* prologue: frame size=0 */
412 /* prologue end (size=0) */
164:../avrlib/uart.c **** // flush all data from receive buffer
165:../avrlib/uart.c **** //bufferFlush(&uartRxBuffer);
166:../avrlib/uart.c **** // same effect as above
167:../avrlib/uart.c **** uartRxBuffer.datalength = 0;
414 .LM37:
415 011a 1092 0000 sts (uartRxBuffer+4)+1,__zero_reg__
416 011e 1092 0000 sts uartRxBuffer+4,__zero_reg__
417 /* epilogue: frame size=0 */
418 0122 0895 ret
419 /* epilogue end (size=1) */
420 /* function uartFlushReceiveBuffer size 5 (4) */
422 .Lscope9:
425 .global uartReceiveBufferIsEmpty
427 uartReceiveBufferIsEmpty:
168:../avrlib/uart.c **** }
169:../avrlib/uart.c ****
170:../avrlib/uart.c **** //! return true if uart receive buffer is empty
171:../avrlib/uart.c **** u08 uartReceiveBufferIsEmpty(void)
172:../avrlib/uart.c **** {
429 .LM38:
430 /* prologue: frame size=0 */
431 /* prologue end (size=0) */
173:../avrlib/uart.c **** if(uartRxBuffer.datalength == 0)
433 .LM39:
434 0124 8091 0000 lds r24,uartRxBuffer+4
435 0128 9091 0000 lds r25,(uartRxBuffer+4)+1
436 012c 892B or r24,r25
437 012e 19F4 brne .L21
174:../avrlib/uart.c **** {
175:../avrlib/uart.c **** return TRUE;
439 .LM40:
440 0130 8FEF ldi r24,lo8(255)
441 0132 90E0 ldi r25,hi8(255)
442 0134 0895 ret
443 .L21:
176:../avrlib/uart.c **** }
177:../avrlib/uart.c **** else
178:../avrlib/uart.c **** {
179:../avrlib/uart.c **** return FALSE;
445 .LM41:
446 0136 80E0 ldi r24,lo8(0)
447 0138 90E0 ldi r25,hi8(0)
180:../avrlib/uart.c **** }
181:../avrlib/uart.c **** }
449 .LM42:
450 013a 0895 ret
451 /* epilogue: frame size=0 */
452 013c 0895 ret
453 /* epilogue end (size=1) */
454 /* function uartReceiveBufferIsEmpty size 13 (12) */
456 .Lscope10:
460 .global uartAddToTxBuffer
462 uartAddToTxBuffer:
182:../avrlib/uart.c ****
183:../avrlib/uart.c **** //! add byte to end of uart Tx buffer
184:../avrlib/uart.c **** void uartAddToTxBuffer(u08 data)
185:../avrlib/uart.c **** {
464 .LM43:
465 /* prologue: frame size=0 */
466 /* prologue end (size=0) */
186:../avrlib/uart.c **** // add data byte to the end of the tx buffer
187:../avrlib/uart.c **** bufferAddToEnd(&uartTxBuffer, data);
468 .LM44:
469 013e 682F mov r22,r24
470 0140 80E0 ldi r24,lo8(uartTxBuffer)
471 0142 90E0 ldi r25,hi8(uartTxBuffer)
472 0144 00D0 rcall bufferAddToEnd
473 /* epilogue: frame size=0 */
474 0146 0895 ret
475 /* epilogue end (size=1) */
476 /* function uartAddToTxBuffer size 5 (4) */
478 .Lscope11:
481 .global uartSendTxBuffer
483 uartSendTxBuffer:
188:../avrlib/uart.c **** }
189:../avrlib/uart.c ****
190:../avrlib/uart.c **** //! start transmission of the current uart Tx buffer contents
191:../avrlib/uart.c **** void uartSendTxBuffer(void)
192:../avrlib/uart.c **** {
485 .LM45:
486 /* prologue: frame size=0 */
487 /* prologue end (size=0) */
193:../avrlib/uart.c **** // turn on buffered transmit
194:../avrlib/uart.c **** uartBufferedTx = TRUE;
489 .LM46:
490 0148 8FEF ldi r24,lo8(-1)
491 014a 8093 0000 sts uartBufferedTx,r24
195:../avrlib/uart.c **** // send the first byte to get things going by interrupts
196:../avrlib/uart.c **** uartSendByte(bufferGetFromFront(&uartTxBuffer));
493 .LM47:
494 014e 80E0 ldi r24,lo8(uartTxBuffer)
495 0150 90E0 ldi r25,hi8(uartTxBuffer)
496 0152 00D0 rcall bufferGetFromFront
497 0154 A4DF rcall uartSendByte
498 /* epilogue: frame size=0 */
499 0156 0895 ret
500 /* epilogue end (size=1) */
501 /* function uartSendTxBuffer size 8 (7) */
503 .Lscope12:
506 .global __vector_13
508 __vector_13:
197:../avrlib/uart.c **** }
198:../avrlib/uart.c **** /*
199:../avrlib/uart.c **** //! transmit nBytes from buffer out the uart
200:../avrlib/uart.c **** u08 uartSendBuffer(char *buffer, u16 nBytes)
201:../avrlib/uart.c **** {
202:../avrlib/uart.c **** register u08 first;
203:../avrlib/uart.c **** register u16 i;
204:../avrlib/uart.c ****
205:../avrlib/uart.c **** // check if there's space (and that we have any bytes to send at all)
206:../avrlib/uart.c **** if((uartTxBuffer.datalength + nBytes < uartTxBuffer.size) && nBytes)
207:../avrlib/uart.c **** {
208:../avrlib/uart.c **** // grab first character
209:../avrlib/uart.c **** first = *buffer++;
210:../avrlib/uart.c **** // copy user buffer to uart transmit buffer
211:../avrlib/uart.c **** for(i = 0; i < nBytes-1; i++)
212:../avrlib/uart.c **** {
213:../avrlib/uart.c **** // put data bytes at end of buffer
214:../avrlib/uart.c **** bufferAddToEnd(&uartTxBuffer, *buffer++);
215:../avrlib/uart.c **** }
216:../avrlib/uart.c ****
217:../avrlib/uart.c **** // send the first byte to get things going by interrupts
218:../avrlib/uart.c **** uartBufferedTx = TRUE;
219:../avrlib/uart.c **** uartSendByte(first);
220:../avrlib/uart.c **** // return success
221:../avrlib/uart.c **** return TRUE;
222:../avrlib/uart.c **** }
223:../avrlib/uart.c **** else
224:../avrlib/uart.c **** {
225:../avrlib/uart.c **** // return failure
226:../avrlib/uart.c **** return FALSE;
227:../avrlib/uart.c **** }
228:../avrlib/uart.c **** }
229:../avrlib/uart.c **** */
230:../avrlib/uart.c **** //! UART Transmit Complete Interrupt Handler
231:../avrlib/uart.c **** UART_INTERRUPT_HANDLER(SIG_UART_TRANS)
232:../avrlib/uart.c **** {
510 .LM48:
511 /* prologue: frame size=0 */
512 0158 1F92 push __zero_reg__
513 015a 0F92 push __tmp_reg__
514 015c 0FB6 in __tmp_reg__,__SREG__
515 015e 0F92 push __tmp_reg__
516 0160 1124 clr __zero_reg__
517 0162 2F93 push r18
518 0164 3F93 push r19
519 0166 4F93 push r20
520 0168 5F93 push r21
521 016a 6F93 push r22
522 016c 7F93 push r23
523 016e 8F93 push r24
524 0170 9F93 push r25
525 0172 AF93 push r26
526 0174 BF93 push r27
527 0176 EF93 push r30
528 0178 FF93 push r31
529 /* prologue end (size=17) */
233:../avrlib/uart.c **** // check if buffered tx is enabled
234:../avrlib/uart.c **** if(uartBufferedTx)
531 .LM49:
532 017a 8091 0000 lds r24,uartBufferedTx
533 017e 8823 tst r24
534 0180 69F0 breq .L26
235:../avrlib/uart.c **** {
236:../avrlib/uart.c **** // check if there's data left in the buffer
237:../avrlib/uart.c **** if(uartTxBuffer.datalength)
536 .LM50:
537 0182 8091 0000 lds r24,uartTxBuffer+4
538 0186 9091 0000 lds r25,(uartTxBuffer+4)+1
539 018a 892B or r24,r25
540 018c 29F0 breq .L27
238:../avrlib/uart.c **** {
239:../avrlib/uart.c **** // send byte from top of buffer
240:../avrlib/uart.c **** outb(UDR, bufferGetFromFront(&uartTxBuffer));
542 .LM51:
543 018e 80E0 ldi r24,lo8(uartTxBuffer)
544 0190 90E0 ldi r25,hi8(uartTxBuffer)
545 0192 00D0 rcall bufferGetFromFront
546 0194 8CB9 out 44-0x20,r24
547 0196 05C0 rjmp .L25
548 .L27:
241:../avrlib/uart.c **** }
242:../avrlib/uart.c **** else
243:../avrlib/uart.c **** {
244:../avrlib/uart.c **** // no data left
245:../avrlib/uart.c **** uartBufferedTx = FALSE;
550 .LM52:
551 0198 1092 0000 sts uartBufferedTx,__zero_reg__
552 .L26:
246:../avrlib/uart.c **** // return to ready state
247:../avrlib/uart.c **** uartReadyTx = TRUE;
248:../avrlib/uart.c **** }
249:../avrlib/uart.c **** }
250:../avrlib/uart.c **** else
251:../avrlib/uart.c **** {
252:../avrlib/uart.c **** // we're using single-byte tx mode
253:../avrlib/uart.c **** // indicate transmit complete, back to ready
254:../avrlib/uart.c **** uartReadyTx = TRUE;
554 .LM53:
555 019c 8FEF ldi r24,lo8(-1)
556 019e 8093 0000 sts uartReadyTx,r24
557 .L25:
558 /* epilogue: frame size=0 */
559 01a2 FF91 pop r31
560 01a4 EF91 pop r30
561 01a6 BF91 pop r27
562 01a8 AF91 pop r26
563 01aa 9F91 pop r25
564 01ac 8F91 pop r24
565 01ae 7F91 pop r23
566 01b0 6F91 pop r22
567 01b2 5F91 pop r21
568 01b4 4F91 pop r20
569 01b6 3F91 pop r19
570 01b8 2F91 pop r18
571 01ba 0F90 pop __tmp_reg__
572 01bc 0FBE out __SREG__,__tmp_reg__
573 01be 0F90 pop __tmp_reg__
574 01c0 1F90 pop __zero_reg__
575 01c2 1895 reti
576 /* epilogue end (size=17) */
577 /* function __vector_13 size 54 (20) */
579 .Lscope13:
582 .global __vector_11
584 __vector_11:
255:../avrlib/uart.c **** }
256:../avrlib/uart.c **** }
257:../avrlib/uart.c ****
258:../avrlib/uart.c **** //! UART Receive Complete Interrupt Handler
259:../avrlib/uart.c **** UART_INTERRUPT_HANDLER(SIG_UART_RECV)
260:../avrlib/uart.c **** {
586 .LM54:
587 /* prologue: frame size=0 */
588 01c4 1F92 push __zero_reg__
589 01c6 0F92 push __tmp_reg__
590 01c8 0FB6 in __tmp_reg__,__SREG__
591 01ca 0F92 push __tmp_reg__
592 01cc 1124 clr __zero_reg__
593 01ce 2F93 push r18
594 01d0 3F93 push r19
595 01d2 4F93 push r20
596 01d4 5F93 push r21
597 01d6 6F93 push r22
598 01d8 7F93 push r23
599 01da 8F93 push r24
600 01dc 9F93 push r25
601 01de AF93 push r26
602 01e0 BF93 push r27
603 01e2 EF93 push r30
604 01e4 FF93 push r31
605 /* prologue end (size=17) */
261:../avrlib/uart.c **** u08 c;
262:../avrlib/uart.c ****
263:../avrlib/uart.c **** // get received char
264:../avrlib/uart.c **** c = inb(UDR);
607 .LM55:
608 01e6 6CB1 in r22,44-0x20
265:../avrlib/uart.c ****
266:../avrlib/uart.c **** // if there's a user function to handle this receive event
267:../avrlib/uart.c **** if(UartRxFunc)
610 .LM56:
611 01e8 8091 0000 lds r24,UartRxFunc
612 01ec 9091 0000 lds r25,(UartRxFunc)+1
613 01f0 892B or r24,r25
614 01f2 39F0 breq .L31
268:../avrlib/uart.c **** {
269:../avrlib/uart.c **** // call it and pass the received data
270:../avrlib/uart.c **** UartRxFunc(c);
616 .LM57:
617 01f4 E091 0000 lds r30,UartRxFunc
618 01f8 F091 0000 lds r31,(UartRxFunc)+1
619 01fc 862F mov r24,r22
620 01fe 0995 icall
621 0200 0EC0 rjmp .L30
622 .L31:
271:../avrlib/uart.c **** }
272:../avrlib/uart.c **** else
273:../avrlib/uart.c **** {
274:../avrlib/uart.c **** // otherwise do default processing
275:../avrlib/uart.c **** // put received char in buffer
276:../avrlib/uart.c **** // check if there's space
277:../avrlib/uart.c **** if( !bufferAddToEnd(&uartRxBuffer, c) )
624 .LM58:
625 0202 80E0 ldi r24,lo8(uartRxBuffer)
626 0204 90E0 ldi r25,hi8(uartRxBuffer)
627 0206 00D0 rcall bufferAddToEnd
628 0208 8823 tst r24
629 020a 49F4 brne .L30
278:../avrlib/uart.c **** {
279:../avrlib/uart.c **** // no space in buffer
280:../avrlib/uart.c **** // count overflow
281:../avrlib/uart.c **** uartRxOverflow++;
631 .LM59:
632 020c 8091 0000 lds r24,uartRxOverflow
633 0210 9091 0000 lds r25,(uartRxOverflow)+1
634 0214 0196 adiw r24,1
635 0216 9093 0000 sts (uartRxOverflow)+1,r25
636 021a 8093 0000 sts uartRxOverflow,r24
637 .L30:
638 /* epilogue: frame size=0 */
639 021e FF91 pop r31
640 0220 EF91 pop r30
641 0222 BF91 pop r27
642 0224 AF91 pop r26
643 0226 9F91 pop r25
644 0228 8F91 pop r24
645 022a 7F91 pop r23
646 022c 6F91 pop r22
647 022e 5F91 pop r21
648 0230 4F91 pop r20
649 0232 3F91 pop r19
650 0234 2F91 pop r18
651 0236 0F90 pop __tmp_reg__
652 0238 0FBE out __SREG__,__tmp_reg__
653 023a 0F90 pop __tmp_reg__
654 023c 1F90 pop __zero_reg__
655 023e 1895 reti
656 /* epilogue end (size=17) */
657 /* function __vector_11 size 62 (28) */
662 .Lscope14:
664 .comm uartReadyTx,1,1
665 .comm uartBufferedTx,1,1
666 .comm uartRxBuffer,8,1
667 .comm uartTxBuffer,8,1
668 .comm uartRxOverflow,2,1
669 .lcomm uartRxData,64
670 .lcomm uartTxData,64
671 .lcomm UartRxFunc,2
680 .text
682 Letext:
683 /* File "../avrlib/uart.c": code 289 = 0x0121 ( 186), prologues 46, epilogues 57 */
DEFINED SYMBOLS
*ABS*:00000000 uart.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
/var/tmp//cclgUhYv.s:88 .text:00000000 uartSetBaudRate
/var/tmp//cclgUhYv.s:141 .text:0000003c uartInitBuffers
.bss:00000000 uartRxData
*COM*:00000008 uartRxBuffer
/var/tmp//cclgUhYv.s:669 .bss:00000040 uartTxData
*COM*:00000008 uartTxBuffer
/var/tmp//cclgUhYv.s:174 .text:0000005a uartInit
/var/tmp//cclgUhYv.s:670 .bss:00000080 UartRxFunc
*COM*:00000001 uartReadyTx
*COM*:00000001 uartBufferedTx
*COM*:00000002 uartRxOverflow
/var/tmp//cclgUhYv.s:224 .text:00000088 uartSetRxHandler
/var/tmp//cclgUhYv.s:243 .text:00000092 uartGetRxBuffer
/var/tmp//cclgUhYv.s:262 .text:00000098 uartGetTxBuffer
/var/tmp//cclgUhYv.s:282 .text:0000009e uartSendByte
/var/tmp//cclgUhYv.s:311 .text:000000b0 uartReceiveByte
/var/tmp//cclgUhYv.s:354 .text:000000e0 uartGetByte
/var/tmp//cclgUhYv.s:408 .text:0000011a uartFlushReceiveBuffer
/var/tmp//cclgUhYv.s:427 .text:00000124 uartReceiveBufferIsEmpty
/var/tmp//cclgUhYv.s:462 .text:0000013e uartAddToTxBuffer
/var/tmp//cclgUhYv.s:483 .text:00000148 uartSendTxBuffer
/var/tmp//cclgUhYv.s:508 .text:00000158 __vector_13
/var/tmp//cclgUhYv.s:584 .text:000001c4 __vector_11
/var/tmp//cclgUhYv.s:682 .text:00000240 Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
__udivmodsi4
bufferInit
bufferGetFromFront
bufferAddToEnd