288 lines
17 KiB
Plaintext
288 lines
17 KiB
Plaintext
1 .file "party.c"
|
|
2 __SP_H__ = 0x3e
|
|
3 __SP_L__ = 0x3d
|
|
4 __SREG__ = 0x3f
|
|
5 __tmp_reg__ = 0
|
|
6 __zero_reg__ = 1
|
|
9 .text
|
|
10 .Ltext0:
|
|
104 .global partyHard
|
|
106 partyHard:
|
|
107 .stabd 46,0,0
|
|
1:party.c **** #include "WS2812B_Atmega.h"
|
|
2:party.c **** #include "party.h"
|
|
3:party.c ****
|
|
4:party.c **** #define PARTY_DELAY 536
|
|
5:party.c ****
|
|
6:party.c **** void partyHard(int LEDS){
|
|
109 .LM0:
|
|
110 .LFBB1:
|
|
111 /* prologue: function */
|
|
112 /* frame size = 0 */
|
|
113 /* stack size = 0 */
|
|
114 .L__stack_usage = 0
|
|
115 0000 8C01 movw r16,r24
|
|
7:party.c **** DDRC = 0x01; // Declare PORTC0 as output
|
|
117 .LM1:
|
|
118 0002 81E0 ldi r24,lo8(1)
|
|
119 0004 87B9 out 0x7,r24
|
|
120 .L6:
|
|
121 .LBB8:
|
|
8:party.c ****
|
|
9:party.c **** while(1){
|
|
10:party.c **** for(int i = 0; i < LEDS; i += 1)
|
|
123 .LM2:
|
|
124 0006 C0E0 ldi r28,0
|
|
125 0008 D0E0 ldi r29,0
|
|
126 .L2:
|
|
128 .LM3:
|
|
129 000a C017 cp r28,r16
|
|
130 000c D107 cpc r29,r17
|
|
131 000e 04F4 brge .L8
|
|
11:party.c **** writeRGB(85,0,0);
|
|
133 .LM4:
|
|
134 0010 40E0 ldi r20,0
|
|
135 0012 60E0 ldi r22,0
|
|
136 0014 85E5 ldi r24,lo8(85)
|
|
137 0016 0E94 0000 call writeRGB
|
|
10:party.c **** writeRGB(85,0,0);
|
|
139 .LM5:
|
|
140 001a 2196 adiw r28,1
|
|
141 001c 00C0 rjmp .L2
|
|
142 .L8:
|
|
143 .LBE8:
|
|
144 .LBB9:
|
|
145 .LBB10:
|
|
147 .Ltext1:
|
|
1:/usr/lib/avr/include/util/delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
|
|
2:/usr/lib/avr/include/util/delay.h **** Copyright (c) 2004,2005,2007 Joerg Wunsch
|
|
3:/usr/lib/avr/include/util/delay.h **** Copyright (c) 2007 Florin-Viorel Petrov
|
|
4:/usr/lib/avr/include/util/delay.h **** All rights reserved.
|
|
5:/usr/lib/avr/include/util/delay.h ****
|
|
6:/usr/lib/avr/include/util/delay.h **** Redistribution and use in source and binary forms, with or without
|
|
7:/usr/lib/avr/include/util/delay.h **** modification, are permitted provided that the following conditions are met:
|
|
8:/usr/lib/avr/include/util/delay.h ****
|
|
9:/usr/lib/avr/include/util/delay.h **** * Redistributions of source code must retain the above copyright
|
|
10:/usr/lib/avr/include/util/delay.h **** notice, this list of conditions and the following disclaimer.
|
|
11:/usr/lib/avr/include/util/delay.h ****
|
|
12:/usr/lib/avr/include/util/delay.h **** * Redistributions in binary form must reproduce the above copyright
|
|
13:/usr/lib/avr/include/util/delay.h **** notice, this list of conditions and the following disclaimer in
|
|
14:/usr/lib/avr/include/util/delay.h **** the documentation and/or other materials provided with the
|
|
15:/usr/lib/avr/include/util/delay.h **** distribution.
|
|
16:/usr/lib/avr/include/util/delay.h ****
|
|
17:/usr/lib/avr/include/util/delay.h **** * Neither the name of the copyright holders nor the names of
|
|
18:/usr/lib/avr/include/util/delay.h **** contributors may be used to endorse or promote products derived
|
|
19:/usr/lib/avr/include/util/delay.h **** from this software without specific prior written permission.
|
|
20:/usr/lib/avr/include/util/delay.h ****
|
|
21:/usr/lib/avr/include/util/delay.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
22:/usr/lib/avr/include/util/delay.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
23:/usr/lib/avr/include/util/delay.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
24:/usr/lib/avr/include/util/delay.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
25:/usr/lib/avr/include/util/delay.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
26:/usr/lib/avr/include/util/delay.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
27:/usr/lib/avr/include/util/delay.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
28:/usr/lib/avr/include/util/delay.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
29:/usr/lib/avr/include/util/delay.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
30:/usr/lib/avr/include/util/delay.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
31:/usr/lib/avr/include/util/delay.h **** POSSIBILITY OF SUCH DAMAGE. */
|
|
32:/usr/lib/avr/include/util/delay.h ****
|
|
33:/usr/lib/avr/include/util/delay.h **** /* $Id$ */
|
|
34:/usr/lib/avr/include/util/delay.h ****
|
|
35:/usr/lib/avr/include/util/delay.h **** #ifndef _UTIL_DELAY_H_
|
|
36:/usr/lib/avr/include/util/delay.h **** #define _UTIL_DELAY_H_ 1
|
|
37:/usr/lib/avr/include/util/delay.h ****
|
|
38:/usr/lib/avr/include/util/delay.h **** #ifndef __HAS_DELAY_CYCLES
|
|
39:/usr/lib/avr/include/util/delay.h **** #define __HAS_DELAY_CYCLES 1
|
|
40:/usr/lib/avr/include/util/delay.h **** #endif
|
|
41:/usr/lib/avr/include/util/delay.h ****
|
|
42:/usr/lib/avr/include/util/delay.h **** #include <inttypes.h>
|
|
43:/usr/lib/avr/include/util/delay.h **** #include <util/delay_basic.h>
|
|
44:/usr/lib/avr/include/util/delay.h **** #include <math.h>
|
|
45:/usr/lib/avr/include/util/delay.h ****
|
|
46:/usr/lib/avr/include/util/delay.h **** /** \file */
|
|
47:/usr/lib/avr/include/util/delay.h **** /** \defgroup util_delay <util/delay.h>: Convenience functions for busy-wait delay loops
|
|
48:/usr/lib/avr/include/util/delay.h **** \code
|
|
49:/usr/lib/avr/include/util/delay.h **** #define F_CPU 1000000UL // 1 MHz
|
|
50:/usr/lib/avr/include/util/delay.h **** //#define F_CPU 14.7456E6
|
|
51:/usr/lib/avr/include/util/delay.h **** #include <util/delay.h>
|
|
52:/usr/lib/avr/include/util/delay.h **** \endcode
|
|
53:/usr/lib/avr/include/util/delay.h ****
|
|
54:/usr/lib/avr/include/util/delay.h **** \note As an alternative method, it is possible to pass the
|
|
55:/usr/lib/avr/include/util/delay.h **** F_CPU macro down to the compiler from the Makefile.
|
|
56:/usr/lib/avr/include/util/delay.h **** Obviously, in that case, no \c \#define statement should be
|
|
57:/usr/lib/avr/include/util/delay.h **** used.
|
|
58:/usr/lib/avr/include/util/delay.h ****
|
|
59:/usr/lib/avr/include/util/delay.h **** The functions in this header file are wrappers around the basic
|
|
60:/usr/lib/avr/include/util/delay.h **** busy-wait functions from <util/delay_basic.h>. They are meant as
|
|
61:/usr/lib/avr/include/util/delay.h **** convenience functions where actual time values can be specified
|
|
62:/usr/lib/avr/include/util/delay.h **** rather than a number of cycles to wait for. The idea behind is
|
|
63:/usr/lib/avr/include/util/delay.h **** that compile-time constant expressions will be eliminated by
|
|
64:/usr/lib/avr/include/util/delay.h **** compiler optimization so floating-point expressions can be used
|
|
65:/usr/lib/avr/include/util/delay.h **** to calculate the number of delay cycles needed based on the CPU
|
|
66:/usr/lib/avr/include/util/delay.h **** frequency passed by the macro F_CPU.
|
|
67:/usr/lib/avr/include/util/delay.h ****
|
|
68:/usr/lib/avr/include/util/delay.h **** \note In order for these functions to work as intended, compiler
|
|
69:/usr/lib/avr/include/util/delay.h **** optimizations <em>must</em> be enabled, and the delay time
|
|
70:/usr/lib/avr/include/util/delay.h **** <em>must</em> be an expression that is a known constant at
|
|
71:/usr/lib/avr/include/util/delay.h **** compile-time. If these requirements are not met, the resulting
|
|
72:/usr/lib/avr/include/util/delay.h **** delay will be much longer (and basically unpredictable), and
|
|
73:/usr/lib/avr/include/util/delay.h **** applications that otherwise do not use floating-point calculations
|
|
74:/usr/lib/avr/include/util/delay.h **** will experience severe code bloat by the floating-point library
|
|
75:/usr/lib/avr/include/util/delay.h **** routines linked into the application.
|
|
76:/usr/lib/avr/include/util/delay.h ****
|
|
77:/usr/lib/avr/include/util/delay.h **** The functions available allow the specification of microsecond, and
|
|
78:/usr/lib/avr/include/util/delay.h **** millisecond delays directly, using the application-supplied macro
|
|
79:/usr/lib/avr/include/util/delay.h **** F_CPU as the CPU clock frequency (in Hertz).
|
|
80:/usr/lib/avr/include/util/delay.h ****
|
|
81:/usr/lib/avr/include/util/delay.h **** */
|
|
82:/usr/lib/avr/include/util/delay.h ****
|
|
83:/usr/lib/avr/include/util/delay.h **** #if !defined(__DOXYGEN__)
|
|
84:/usr/lib/avr/include/util/delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
|
|
85:/usr/lib/avr/include/util/delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
|
|
86:/usr/lib/avr/include/util/delay.h **** #endif
|
|
87:/usr/lib/avr/include/util/delay.h ****
|
|
88:/usr/lib/avr/include/util/delay.h **** #ifndef F_CPU
|
|
89:/usr/lib/avr/include/util/delay.h **** /* prevent compiler error by supplying a default */
|
|
90:/usr/lib/avr/include/util/delay.h **** # warning "F_CPU not defined for <util/delay.h>"
|
|
91:/usr/lib/avr/include/util/delay.h **** # define F_CPU 1000000UL
|
|
92:/usr/lib/avr/include/util/delay.h **** #endif
|
|
93:/usr/lib/avr/include/util/delay.h ****
|
|
94:/usr/lib/avr/include/util/delay.h **** #ifndef __OPTIMIZE__
|
|
95:/usr/lib/avr/include/util/delay.h **** # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
|
|
96:/usr/lib/avr/include/util/delay.h **** #endif
|
|
97:/usr/lib/avr/include/util/delay.h ****
|
|
98:/usr/lib/avr/include/util/delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
|
99:/usr/lib/avr/include/util/delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
|
100:/usr/lib/avr/include/util/delay.h **** __STDC_HOSTED__
|
|
101:/usr/lib/avr/include/util/delay.h **** # include <math.h>
|
|
102:/usr/lib/avr/include/util/delay.h **** #endif
|
|
103:/usr/lib/avr/include/util/delay.h ****
|
|
104:/usr/lib/avr/include/util/delay.h **** /**
|
|
105:/usr/lib/avr/include/util/delay.h **** \ingroup util_delay
|
|
106:/usr/lib/avr/include/util/delay.h ****
|
|
107:/usr/lib/avr/include/util/delay.h **** Perform a delay of \c __ms milliseconds, using _delay_loop_2().
|
|
108:/usr/lib/avr/include/util/delay.h ****
|
|
109:/usr/lib/avr/include/util/delay.h **** The macro F_CPU is supposed to be defined to a
|
|
110:/usr/lib/avr/include/util/delay.h **** constant defining the CPU clock frequency (in Hertz).
|
|
111:/usr/lib/avr/include/util/delay.h ****
|
|
112:/usr/lib/avr/include/util/delay.h **** The maximal possible delay is 262.14 ms / F_CPU in MHz.
|
|
113:/usr/lib/avr/include/util/delay.h ****
|
|
114:/usr/lib/avr/include/util/delay.h **** When the user request delay which exceed the maximum possible one,
|
|
115:/usr/lib/avr/include/util/delay.h **** _delay_ms() provides a decreased resolution functionality. In this
|
|
116:/usr/lib/avr/include/util/delay.h **** mode _delay_ms() will work with a resolution of 1/10 ms, providing
|
|
117:/usr/lib/avr/include/util/delay.h **** delays up to 6.5535 seconds (independent from CPU frequency). The
|
|
118:/usr/lib/avr/include/util/delay.h **** user will not be informed about decreased resolution.
|
|
119:/usr/lib/avr/include/util/delay.h ****
|
|
120:/usr/lib/avr/include/util/delay.h **** If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long)
|
|
121:/usr/lib/avr/include/util/delay.h **** support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For
|
|
122:/usr/lib/avr/include/util/delay.h **** values greater than the maximal possible delay, overflows results in
|
|
123:/usr/lib/avr/include/util/delay.h **** no delay i.e., 0ms.
|
|
124:/usr/lib/avr/include/util/delay.h ****
|
|
125:/usr/lib/avr/include/util/delay.h **** Conversion of __us into clock cycles may not always result in integer.
|
|
126:/usr/lib/avr/include/util/delay.h **** By default, the clock cycles rounded up to next integer. This ensures that
|
|
127:/usr/lib/avr/include/util/delay.h **** the user gets atleast __us microseconds of delay.
|
|
128:/usr/lib/avr/include/util/delay.h ****
|
|
129:/usr/lib/avr/include/util/delay.h **** Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__
|
|
130:/usr/lib/avr/include/util/delay.h **** to round down and round to closest integer.
|
|
131:/usr/lib/avr/include/util/delay.h ****
|
|
132:/usr/lib/avr/include/util/delay.h **** Note: The new implementation of _delay_ms(double __ms) with
|
|
133:/usr/lib/avr/include/util/delay.h **** __builtin_avr_delay_cycles(unsigned long) support is not backward compatible.
|
|
134:/usr/lib/avr/include/util/delay.h **** User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
|
|
135:/usr/lib/avr/include/util/delay.h **** Also, the backward compatible
|
|
136:/usr/lib/avr/include/util/delay.h **** algorithm will be chosen if the code is compiled in a <em>freestanding
|
|
137:/usr/lib/avr/include/util/delay.h **** environment</em> (GCC option \c -ffreestanding), as the math functions
|
|
138:/usr/lib/avr/include/util/delay.h **** required for rounding are not available to the compiler then.
|
|
139:/usr/lib/avr/include/util/delay.h ****
|
|
140:/usr/lib/avr/include/util/delay.h **** */
|
|
141:/usr/lib/avr/include/util/delay.h **** void
|
|
142:/usr/lib/avr/include/util/delay.h **** _delay_ms(double __ms)
|
|
143:/usr/lib/avr/include/util/delay.h **** {
|
|
144:/usr/lib/avr/include/util/delay.h **** double __tmp ;
|
|
145:/usr/lib/avr/include/util/delay.h **** #if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
|
|
146:/usr/lib/avr/include/util/delay.h **** !defined(__DELAY_BACKWARD_COMPATIBLE__) && \
|
|
147:/usr/lib/avr/include/util/delay.h **** __STDC_HOSTED__
|
|
148:/usr/lib/avr/include/util/delay.h **** uint32_t __ticks_dc;
|
|
149:/usr/lib/avr/include/util/delay.h **** extern void __builtin_avr_delay_cycles(unsigned long);
|
|
150:/usr/lib/avr/include/util/delay.h **** __tmp = ((F_CPU) / 1e3) * __ms;
|
|
151:/usr/lib/avr/include/util/delay.h ****
|
|
152:/usr/lib/avr/include/util/delay.h **** #if defined(__DELAY_ROUND_DOWN__)
|
|
153:/usr/lib/avr/include/util/delay.h **** __ticks_dc = (uint32_t)fabs(__tmp);
|
|
154:/usr/lib/avr/include/util/delay.h ****
|
|
155:/usr/lib/avr/include/util/delay.h **** #elif defined(__DELAY_ROUND_CLOSEST__)
|
|
156:/usr/lib/avr/include/util/delay.h **** __ticks_dc = (uint32_t)(fabs(__tmp)+0.5);
|
|
157:/usr/lib/avr/include/util/delay.h ****
|
|
158:/usr/lib/avr/include/util/delay.h **** #else
|
|
159:/usr/lib/avr/include/util/delay.h **** //round up by default
|
|
160:/usr/lib/avr/include/util/delay.h **** __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
161:/usr/lib/avr/include/util/delay.h **** #endif
|
|
162:/usr/lib/avr/include/util/delay.h ****
|
|
163:/usr/lib/avr/include/util/delay.h **** __builtin_avr_delay_cycles(__ticks_dc);
|
|
149 .LM6:
|
|
150 001e 2FEF ldi r18,lo8(2143999)
|
|
151 0020 86EB ldi r24,hi8(2143999)
|
|
152 0022 90E2 ldi r25,hlo8(2143999)
|
|
153 0024 2150 1: subi r18,1
|
|
154 0026 8040 sbci r24,0
|
|
155 0028 9040 sbci r25,0
|
|
156 002a 01F4 brne 1b
|
|
157 002c 00C0 rjmp .
|
|
158 002e 0000 nop
|
|
159 .LBE10:
|
|
160 .LBE9:
|
|
161 .LBB11:
|
|
163 .Ltext2:
|
|
12:party.c **** _delay_ms(PARTY_DELAY);
|
|
13:party.c ****
|
|
14:party.c **** for(int i = 0; i < LEDS; i += 1)
|
|
165 .LM7:
|
|
166 0030 C0E0 ldi r28,0
|
|
167 0032 D0E0 ldi r29,0
|
|
168 .L4:
|
|
170 .LM8:
|
|
171 0034 C017 cp r28,r16
|
|
172 0036 D107 cpc r29,r17
|
|
173 0038 04F4 brge .L9
|
|
15:party.c **** writeRGB(0,0,85);
|
|
175 .LM9:
|
|
176 003a 45E5 ldi r20,lo8(85)
|
|
177 003c 60E0 ldi r22,0
|
|
178 003e 80E0 ldi r24,0
|
|
179 0040 0E94 0000 call writeRGB
|
|
14:party.c **** writeRGB(0,0,85);
|
|
181 .LM10:
|
|
182 0044 2196 adiw r28,1
|
|
183 0046 00C0 rjmp .L4
|
|
184 .L9:
|
|
185 .LBE11:
|
|
186 .LBB12:
|
|
187 .LBB13:
|
|
189 .Ltext3:
|
|
191 .LM11:
|
|
192 0048 2FEF ldi r18,lo8(2143999)
|
|
193 004a 86EB ldi r24,hi8(2143999)
|
|
194 004c 90E2 ldi r25,hlo8(2143999)
|
|
195 004e 2150 1: subi r18,1
|
|
196 0050 8040 sbci r24,0
|
|
197 0052 9040 sbci r25,0
|
|
198 0054 01F4 brne 1b
|
|
199 0056 00C0 rjmp .
|
|
200 0058 0000 nop
|
|
201 005a 00C0 rjmp .L6
|
|
202 .LBE13:
|
|
203 .LBE12:
|
|
211 .Lscope1:
|
|
213 .stabd 78,0,0
|
|
215 .Letext0:
|
|
216 .ident "GCC: (GNU) 4.9.2"
|
|
DEFINED SYMBOLS
|
|
*ABS*:0000000000000000 party.c
|
|
/tmp/ccQ6h11V.s:2 *ABS*:000000000000003e __SP_H__
|
|
/tmp/ccQ6h11V.s:3 *ABS*:000000000000003d __SP_L__
|
|
/tmp/ccQ6h11V.s:4 *ABS*:000000000000003f __SREG__
|
|
/tmp/ccQ6h11V.s:5 *ABS*:0000000000000000 __tmp_reg__
|
|
/tmp/ccQ6h11V.s:6 *ABS*:0000000000000001 __zero_reg__
|
|
/tmp/ccQ6h11V.s:106 .text:0000000000000000 partyHard
|
|
|
|
UNDEFINED SYMBOLS
|
|
writeRGB
|