1079 lines
40 KiB
Plaintext
1079 lines
40 KiB
Plaintext
1 .file "pendulum.c"
|
|
2 __SP_H__ = 0x3e
|
|
3 __SP_L__ = 0x3d
|
|
4 __SREG__ = 0x3f
|
|
5 __tmp_reg__ = 0
|
|
6 __zero_reg__ = 1
|
|
9 .text
|
|
10 .Ltext0:
|
|
113 .global __vector_2
|
|
115 __vector_2:
|
|
116 .stabd 46,0,0
|
|
1:pendulum.c **** #define F_CPU 20000000UL
|
|
2:pendulum.c **** #include <util/delay.h>
|
|
3:pendulum.c **** #include <avr/interrupt.h>
|
|
4:pendulum.c **** #include <avr/io.h>
|
|
5:pendulum.c ****
|
|
6:pendulum.c **** #include <stdint.h>
|
|
7:pendulum.c **** #include <stddef.h>
|
|
8:pendulum.c **** #include <stdbool.h>
|
|
9:pendulum.c ****
|
|
10:pendulum.c **** #include "color_hsv.h"
|
|
11:pendulum.c **** #define HUE_MAX 610
|
|
12:pendulum.c **** #define HUE_MIN 350
|
|
13:pendulum.c **** #define HUE_MID ((HUE_MAX + HUE_MIN) / 2)
|
|
14:pendulum.c **** #define HUE_DIF (HUE_MAX - HUE_MIN)
|
|
15:pendulum.c **** #define HUE_SAT 100 // 0 = white, 100 = color
|
|
16:pendulum.c **** #define HUE_VAL 20 // 0 = black, 100 = color
|
|
17:pendulum.c **** #define HUE_STEP 8 // 8
|
|
18:pendulum.c **** const uint32_t colorSteps = HUE_DIF / HUE_STEP;
|
|
19:pendulum.c **** //~ const uint32_t colorSteps = 5;
|
|
20:pendulum.c ****
|
|
21:pendulum.c **** #define LEDS 30
|
|
22:pendulum.c ****
|
|
23:pendulum.c **** // Prototypes:
|
|
24:pendulum.c **** void writeZero(void);
|
|
25:pendulum.c **** void writeOne(void);
|
|
26:pendulum.c **** void writeRGB(uint8_t red, uint8_t green, uint8_t blue);
|
|
27:pendulum.c ****
|
|
28:pendulum.c **** // Interrupt variables:
|
|
29:pendulum.c **** int8_t volatile status = 1;
|
|
30:pendulum.c **** uint16_t volatile min = HUE_MID;
|
|
31:pendulum.c **** uint16_t volatile max = HUE_MID;
|
|
32:pendulum.c **** uint32_t volatile time = 0;
|
|
33:pendulum.c **** uint32_t volatile T_half = 0;
|
|
34:pendulum.c **** uint32_t volatile oldTime = 0;
|
|
35:pendulum.c **** uint32_t volatile cooldown = 0;
|
|
36:pendulum.c **** //~ uint32_t volatile delay = 0;
|
|
37:pendulum.c ****
|
|
38:pendulum.c **** // On External Interrupt:
|
|
39:pendulum.c **** ISR(INT1_vect) {
|
|
118 .LM0:
|
|
119 .LFBB1:
|
|
120 0000 1F92 push r1
|
|
121 0002 0F92 push r0
|
|
122 0004 0FB6 in r0,__SREG__
|
|
123 0006 0F92 push r0
|
|
124 0008 1124 clr __zero_reg__
|
|
125 000a 2F93 push r18
|
|
126 000c 3F93 push r19
|
|
127 000e 8F93 push r24
|
|
128 0010 9F93 push r25
|
|
129 0012 AF93 push r26
|
|
130 0014 BF93 push r27
|
|
131 0016 EF93 push r30
|
|
132 0018 FF93 push r31
|
|
133 /* prologue: Signal */
|
|
134 /* frame size = 0 */
|
|
135 /* stack size = 11 */
|
|
136 .L__stack_usage = 11
|
|
40:pendulum.c **** EIMSK &= 0xfd; // Disable INT1
|
|
138 .LM1:
|
|
139 001a E998 cbi 0x1d,1
|
|
41:pendulum.c **** T_half = time + TCNT1;
|
|
141 .LM2:
|
|
142 001c 8091 0000 lds r24,time
|
|
143 0020 9091 0000 lds r25,time+1
|
|
144 0024 A091 0000 lds r26,time+2
|
|
145 0028 B091 0000 lds r27,time+3
|
|
146 002c E4E8 ldi r30,lo8(-124)
|
|
147 002e F0E0 ldi r31,0
|
|
148 0030 2081 ld r18,Z
|
|
149 0032 3181 ldd r19,Z+1
|
|
150 0034 820F add r24,r18
|
|
151 0036 931F adc r25,r19
|
|
152 0038 A11D adc r26,__zero_reg__
|
|
153 003a B11D adc r27,__zero_reg__
|
|
154 003c 8093 0000 sts T_half,r24
|
|
155 0040 9093 0000 sts T_half+1,r25
|
|
156 0044 A093 0000 sts T_half+2,r26
|
|
157 0048 B093 0000 sts T_half+3,r27
|
|
42:pendulum.c **** //~ delay = T_half / 16;
|
|
43:pendulum.c **** cooldown = T_half / 2;
|
|
159 .LM3:
|
|
160 004c 8091 0000 lds r24,T_half
|
|
161 0050 9091 0000 lds r25,T_half+1
|
|
162 0054 A091 0000 lds r26,T_half+2
|
|
163 0058 B091 0000 lds r27,T_half+3
|
|
164 005c B695 lsr r27
|
|
165 005e A795 ror r26
|
|
166 0060 9795 ror r25
|
|
167 0062 8795 ror r24
|
|
168 0064 8093 0000 sts cooldown,r24
|
|
169 0068 9093 0000 sts cooldown+1,r25
|
|
170 006c A093 0000 sts cooldown+2,r26
|
|
171 0070 B093 0000 sts cooldown+3,r27
|
|
44:pendulum.c **** TCNT1 = 0; // Reset Timer/Counter1
|
|
173 .LM4:
|
|
174 0074 1182 std Z+1,__zero_reg__
|
|
175 0076 1082 st Z,__zero_reg__
|
|
45:pendulum.c **** time = 0;
|
|
177 .LM5:
|
|
178 0078 1092 0000 sts time,__zero_reg__
|
|
179 007c 1092 0000 sts time+1,__zero_reg__
|
|
180 0080 1092 0000 sts time+2,__zero_reg__
|
|
181 0084 1092 0000 sts time+3,__zero_reg__
|
|
46:pendulum.c **** oldTime = 0;
|
|
183 .LM6:
|
|
184 0088 1092 0000 sts oldTime,__zero_reg__
|
|
185 008c 1092 0000 sts oldTime+1,__zero_reg__
|
|
186 0090 1092 0000 sts oldTime+2,__zero_reg__
|
|
187 0094 1092 0000 sts oldTime+3,__zero_reg__
|
|
47:pendulum.c **** PORTC ^= 0x02;
|
|
189 .LM7:
|
|
190 0098 98B1 in r25,0x8
|
|
191 009a 82E0 ldi r24,lo8(2)
|
|
192 009c 8927 eor r24,r25
|
|
193 009e 88B9 out 0x8,r24
|
|
194 /* epilogue start */
|
|
48:pendulum.c **** //~ min = HUE_MID;
|
|
49:pendulum.c **** //~ max = HUE_MID;
|
|
50:pendulum.c **** //~ status = (status == 1 ? -1 : 1);
|
|
51:pendulum.c **** }
|
|
196 .LM8:
|
|
197 00a0 FF91 pop r31
|
|
198 00a2 EF91 pop r30
|
|
199 00a4 BF91 pop r27
|
|
200 00a6 AF91 pop r26
|
|
201 00a8 9F91 pop r25
|
|
202 00aa 8F91 pop r24
|
|
203 00ac 3F91 pop r19
|
|
204 00ae 2F91 pop r18
|
|
205 00b0 0F90 pop r0
|
|
206 00b2 0FBE out __SREG__,r0
|
|
207 00b4 0F90 pop r0
|
|
208 00b6 1F90 pop r1
|
|
209 00b8 1895 reti
|
|
211 .Lscope1:
|
|
213 .stabd 78,0,0
|
|
215 .global __vector_13
|
|
217 __vector_13:
|
|
218 .stabd 46,0,0
|
|
52:pendulum.c ****
|
|
53:pendulum.c **** // On Timer Overflow Interrupt:
|
|
54:pendulum.c **** ISR(TIMER1_OVF_vect) {
|
|
220 .LM9:
|
|
221 .LFBB2:
|
|
222 00ba 1F92 push r1
|
|
223 00bc 0F92 push r0
|
|
224 00be 0FB6 in r0,__SREG__
|
|
225 00c0 0F92 push r0
|
|
226 00c2 1124 clr __zero_reg__
|
|
227 00c4 8F93 push r24
|
|
228 00c6 9F93 push r25
|
|
229 00c8 AF93 push r26
|
|
230 00ca BF93 push r27
|
|
231 /* prologue: Signal */
|
|
232 /* frame size = 0 */
|
|
233 /* stack size = 7 */
|
|
234 .L__stack_usage = 7
|
|
55:pendulum.c **** time += 0x00010000;
|
|
236 .LM10:
|
|
237 00cc 8091 0000 lds r24,time
|
|
238 00d0 9091 0000 lds r25,time+1
|
|
239 00d4 A091 0000 lds r26,time+2
|
|
240 00d8 B091 0000 lds r27,time+3
|
|
241 00dc 1196 adiw r26,1
|
|
242 00de 8093 0000 sts time,r24
|
|
243 00e2 9093 0000 sts time+1,r25
|
|
244 00e6 A093 0000 sts time+2,r26
|
|
245 00ea B093 0000 sts time+3,r27
|
|
246 /* epilogue start */
|
|
56:pendulum.c **** }
|
|
248 .LM11:
|
|
249 00ee BF91 pop r27
|
|
250 00f0 AF91 pop r26
|
|
251 00f2 9F91 pop r25
|
|
252 00f4 8F91 pop r24
|
|
253 00f6 0F90 pop r0
|
|
254 00f8 0FBE out __SREG__,r0
|
|
255 00fa 0F90 pop r0
|
|
256 00fc 1F90 pop r1
|
|
257 00fe 1895 reti
|
|
259 .Lscope2:
|
|
261 .stabd 78,0,0
|
|
263 .global writeZero
|
|
265 writeZero:
|
|
266 .stabd 46,0,0
|
|
57:pendulum.c ****
|
|
58:pendulum.c **** int main(void) {
|
|
59:pendulum.c ****
|
|
60:pendulum.c **** EIMSK |= 0x02; // External Interrupt Mask Register
|
|
61:pendulum.c **** // Enable INT1 (PIN5) for interrupt
|
|
62:pendulum.c **** EICRA |= 0x0c; // External Interrupt Control Register
|
|
63:pendulum.c **** // INT1 on rising edge
|
|
64:pendulum.c ****
|
|
65:pendulum.c **** TIMSK1 |= 0x01; // Timer/Counter1 Interrupt Mask Register
|
|
66:pendulum.c **** // Enable overflow interrupt
|
|
67:pendulum.c **** TCCR1B |= 0x01; // Timer/Counter1 Control Register B
|
|
68:pendulum.c **** // Prescale Factor 1
|
|
69:pendulum.c ****
|
|
70:pendulum.c **** SREG |= 0x80; // Status Register
|
|
71:pendulum.c **** // Enable global interrupts
|
|
72:pendulum.c ****
|
|
73:pendulum.c **** DDRC = 0x3f; // Digital Direction PORTC[5:0] = output
|
|
74:pendulum.c **** PORTC = 0x00;
|
|
75:pendulum.c ****
|
|
76:pendulum.c **** // Init color
|
|
77:pendulum.c **** hsv_t colorsHSV[LEDS];
|
|
78:pendulum.c **** rgb_t colorsRGB[LEDS];
|
|
79:pendulum.c **** interpolate(
|
|
80:pendulum.c **** init_hsv_t(min, HUE_SAT, HUE_VAL), // from color
|
|
81:pendulum.c **** init_hsv_t(max, HUE_SAT, HUE_VAL), // to color
|
|
82:pendulum.c **** LEDS,
|
|
83:pendulum.c **** colorsHSV
|
|
84:pendulum.c **** );
|
|
85:pendulum.c **** hsv2rgbList(colorsHSV, colorsRGB, LEDS);
|
|
86:pendulum.c **** // Assign color
|
|
87:pendulum.c **** for(int i = 0; i < LEDS; i++) {
|
|
88:pendulum.c **** writeRGB( colorsRGB[i].r, colorsRGB[i].g, colorsRGB[i].b);
|
|
89:pendulum.c **** }
|
|
90:pendulum.c ****
|
|
91:pendulum.c **** // Next color
|
|
92:pendulum.c **** int8_t sign = 1;
|
|
93:pendulum.c **** min += sign * HUE_STEP;
|
|
94:pendulum.c **** max -= sign * HUE_STEP;
|
|
95:pendulum.c **** interpolate(
|
|
96:pendulum.c **** init_hsv_t(min, HUE_SAT, HUE_VAL),// from color
|
|
97:pendulum.c **** init_hsv_t(max, HUE_SAT, HUE_VAL), // to color
|
|
98:pendulum.c **** LEDS,
|
|
99:pendulum.c **** colorsHSV
|
|
100:pendulum.c **** );
|
|
101:pendulum.c **** hsv2rgbList(colorsHSV, colorsRGB, LEDS);
|
|
102:pendulum.c ****
|
|
103:pendulum.c **** while(1) {
|
|
104:pendulum.c **** uint32_t now = time + TCNT1;
|
|
105:pendulum.c **** //~ if(now > delay) {
|
|
106:pendulum.c **** //~ PORTC |= 0x08; // PORTC3 = HIGH
|
|
107:pendulum.c **** //~ }
|
|
108:pendulum.c **** //~ if(now > delay * 2) {
|
|
109:pendulum.c **** //~ PORTC &= 0xf7; // PORTC3 = LOW
|
|
110:pendulum.c **** //~ }
|
|
111:pendulum.c ****
|
|
112:pendulum.c **** if(now > cooldown) {
|
|
113:pendulum.c **** EIMSK |= 0x02; // Enable INT1
|
|
114:pendulum.c **** }
|
|
115:pendulum.c ****
|
|
116:pendulum.c **** uint32_t T_step = T_half / colorSteps;
|
|
117:pendulum.c ****
|
|
118:pendulum.c **** // Check if it is time for next color
|
|
119:pendulum.c **** if(now > oldTime + T_step) {
|
|
120:pendulum.c **** oldTime += T_step;
|
|
121:pendulum.c **** PORTC ^= 0x04;
|
|
122:pendulum.c **** // Assign color
|
|
123:pendulum.c **** cli();
|
|
124:pendulum.c **** for(int i = 0; i < LEDS; i++) {
|
|
125:pendulum.c **** writeRGB( colorsRGB[i].r, colorsRGB[i].g, colorsRGB[i].b);
|
|
126:pendulum.c **** }
|
|
127:pendulum.c **** sei();
|
|
128:pendulum.c **** //~ _delay_us(51);
|
|
129:pendulum.c ****
|
|
130:pendulum.c **** // Next color
|
|
131:pendulum.c **** min += sign * HUE_STEP;
|
|
132:pendulum.c **** max -= sign * HUE_STEP;
|
|
133:pendulum.c **** interpolate(
|
|
134:pendulum.c **** init_hsv_t(min, HUE_SAT, HUE_VAL), // from color
|
|
135:pendulum.c **** init_hsv_t(max, HUE_SAT, HUE_VAL), // to color
|
|
136:pendulum.c **** LEDS,
|
|
137:pendulum.c **** colorsHSV
|
|
138:pendulum.c **** );
|
|
139:pendulum.c **** hsv2rgbList(colorsHSV, colorsRGB, LEDS);
|
|
140:pendulum.c **** // Check if reached amplitude
|
|
141:pendulum.c **** if(sign == 1 && (min >= HUE_MAX || max <= HUE_MIN)) {
|
|
142:pendulum.c **** sign = -1;
|
|
143:pendulum.c **** } else if(sign == -1 && (min <= HUE_MIN || max >= HUE_MAX)) {
|
|
144:pendulum.c **** sign = 1;
|
|
145:pendulum.c **** }
|
|
146:pendulum.c **** //~ if(status == 1 && sign == 1 && (min >= HUE_MAX || max <= HUE_MIN)) {
|
|
147:pendulum.c **** //~ sign = -1;
|
|
148:pendulum.c **** //~ } else if(status == 1 && sign == -1 && (min <= HUE_MIN || max >= HUE_MAX)) {
|
|
149:pendulum.c **** //~ sign = 1;
|
|
150:pendulum.c **** //~ } else if(status == -1 && sign == 1 && (min <= HUE_MIN || max >= HUE_MAX)) {
|
|
151:pendulum.c **** //~ sign = -1;
|
|
152:pendulum.c **** //~ } else if(status == -1 && sign == -1 && (min >= HUE_MAX || max <= HUE_MIN)) {
|
|
153:pendulum.c **** //~ sign = 1;
|
|
154:pendulum.c **** //~ }
|
|
155:pendulum.c **** }
|
|
156:pendulum.c **** }
|
|
157:pendulum.c **** }
|
|
158:pendulum.c ****
|
|
159:pendulum.c **** /***********************************************************************
|
|
160:pendulum.c **** *
|
|
161:pendulum.c **** * TIMING
|
|
162:pendulum.c **** *
|
|
163:pendulum.c **** ************************************************************************
|
|
164:pendulum.c **** * f=20MHz -> T=0,05 µs = 50 ns
|
|
165:pendulum.c **** *
|
|
166:pendulum.c **** * 0,05 µs * 6 == 0.3 µs ~ 0.4 µs (+- 150ns) == [0.25, 0.55] µs
|
|
167:pendulum.c **** * 0,05 µs * 14 == 0.7 µs ~ 0.8 µs (+- 150ns) == [0.65, 0.95] µs
|
|
168:pendulum.c **** * 0,05 µs * 15 == 0.75 µs ~ 0.85 µs (+- 150ns) == [0.70, 1.00] µs
|
|
169:pendulum.c **** * 0,05 µs * 8 == 0.35 µs ~ 0.45 µs (+- 150ns) == [0.30, 0.60] µs
|
|
170:pendulum.c **** * 51 µs > 50 µs
|
|
171:pendulum.c **** ************************************************************************/
|
|
172:pendulum.c **** // AVR-GCC optimizes multiple "nop"s on every optimization level
|
|
173:pendulum.c **** // So we use timing from:
|
|
174:pendulum.c **** // https://github.com/cpldcpu/light_ws2812/blob/master/light_ws2812_AVR/Light_WS2812/light_ws2812.c
|
|
175:pendulum.c **** #define w_nop1 __asm__("nop \n\t")
|
|
176:pendulum.c **** #define w_nop2 __asm__("rjmp .+0 \n\t")
|
|
177:pendulum.c **** #define w_nop4 w_nop2; w_nop2
|
|
178:pendulum.c **** #define w_nop8 w_nop4; w_nop4
|
|
179:pendulum.c **** #define w_nop16 w_nop8; w_nop8 // Not used
|
|
180:pendulum.c ****
|
|
181:pendulum.c **** #define wait6 w_nop2; w_nop4
|
|
182:pendulum.c **** #define wait8 w_nop8
|
|
183:pendulum.c **** #define wait14 wait8; wait6
|
|
184:pendulum.c **** #define wait15 wait14; w_nop1
|
|
185:pendulum.c ****
|
|
186:pendulum.c **** // WS2812B protocol
|
|
187:pendulum.c **** inline void writeZero() {
|
|
268 .LM12:
|
|
269 .LFBB3:
|
|
270 /* prologue: function */
|
|
271 /* frame size = 0 */
|
|
272 /* stack size = 0 */
|
|
273 .L__stack_usage = 0
|
|
188:pendulum.c **** PORTC |= 0x01; // PORTC0 = 1, PORTC[5:1] = invariant
|
|
275 .LM13:
|
|
276 0100 409A sbi 0x8,0
|
|
189:pendulum.c **** wait6;
|
|
278 .LM14:
|
|
279 /* #APP */
|
|
280 ; 189 "pendulum.c" 1
|
|
281 0102 00C0 rjmp .+0
|
|
282
|
|
283 ; 0 "" 2
|
|
284 ; 189 "pendulum.c" 1
|
|
285 0104 00C0 rjmp .+0
|
|
286
|
|
287 ; 0 "" 2
|
|
288 ; 189 "pendulum.c" 1
|
|
289 0106 00C0 rjmp .+0
|
|
290
|
|
291 ; 0 "" 2
|
|
190:pendulum.c **** PORTC &= 0xfe; // PORTC0 = 0, PORTC[5:1] = invariant
|
|
293 .LM15:
|
|
294 /* #NOAPP */
|
|
295 0108 4098 cbi 0x8,0
|
|
191:pendulum.c **** wait15;
|
|
297 .LM16:
|
|
298 /* #APP */
|
|
299 ; 191 "pendulum.c" 1
|
|
300 010a 00C0 rjmp .+0
|
|
301
|
|
302 ; 0 "" 2
|
|
303 ; 191 "pendulum.c" 1
|
|
304 010c 00C0 rjmp .+0
|
|
305
|
|
306 ; 0 "" 2
|
|
307 ; 191 "pendulum.c" 1
|
|
308 010e 00C0 rjmp .+0
|
|
309
|
|
310 ; 0 "" 2
|
|
311 ; 191 "pendulum.c" 1
|
|
312 0110 00C0 rjmp .+0
|
|
313
|
|
314 ; 0 "" 2
|
|
315 ; 191 "pendulum.c" 1
|
|
316 0112 00C0 rjmp .+0
|
|
317
|
|
318 ; 0 "" 2
|
|
319 ; 191 "pendulum.c" 1
|
|
320 0114 00C0 rjmp .+0
|
|
321
|
|
322 ; 0 "" 2
|
|
323 ; 191 "pendulum.c" 1
|
|
324 0116 00C0 rjmp .+0
|
|
325
|
|
326 ; 0 "" 2
|
|
327 ; 191 "pendulum.c" 1
|
|
328 0118 0000 nop
|
|
329
|
|
330 ; 0 "" 2
|
|
331 /* #NOAPP */
|
|
332 011a 0895 ret
|
|
334 .Lscope3:
|
|
336 .stabd 78,0,0
|
|
338 .global writeOne
|
|
340 writeOne:
|
|
341 .stabd 46,0,0
|
|
192:pendulum.c **** }
|
|
193:pendulum.c ****
|
|
194:pendulum.c **** // WS2812B protocol
|
|
195:pendulum.c **** inline void writeOne() {
|
|
343 .LM17:
|
|
344 .LFBB4:
|
|
345 /* prologue: function */
|
|
346 /* frame size = 0 */
|
|
347 /* stack size = 0 */
|
|
348 .L__stack_usage = 0
|
|
196:pendulum.c **** PORTC |= 0x01; // PORTC0 = 1, PORTC[5:1] = invariant
|
|
350 .LM18:
|
|
351 011c 409A sbi 0x8,0
|
|
197:pendulum.c **** wait14;
|
|
353 .LM19:
|
|
354 /* #APP */
|
|
355 ; 197 "pendulum.c" 1
|
|
356 011e 00C0 rjmp .+0
|
|
357
|
|
358 ; 0 "" 2
|
|
359 ; 197 "pendulum.c" 1
|
|
360 0120 00C0 rjmp .+0
|
|
361
|
|
362 ; 0 "" 2
|
|
363 ; 197 "pendulum.c" 1
|
|
364 0122 00C0 rjmp .+0
|
|
365
|
|
366 ; 0 "" 2
|
|
367 ; 197 "pendulum.c" 1
|
|
368 0124 00C0 rjmp .+0
|
|
369
|
|
370 ; 0 "" 2
|
|
371 ; 197 "pendulum.c" 1
|
|
372 0126 00C0 rjmp .+0
|
|
373
|
|
374 ; 0 "" 2
|
|
375 ; 197 "pendulum.c" 1
|
|
376 0128 00C0 rjmp .+0
|
|
377
|
|
378 ; 0 "" 2
|
|
379 ; 197 "pendulum.c" 1
|
|
380 012a 00C0 rjmp .+0
|
|
381
|
|
382 ; 0 "" 2
|
|
198:pendulum.c **** PORTC &= 0xfe; // PORTC0 = 0, PORTC[5:1] = invariant
|
|
384 .LM20:
|
|
385 /* #NOAPP */
|
|
386 012c 4098 cbi 0x8,0
|
|
199:pendulum.c **** wait8;
|
|
388 .LM21:
|
|
389 /* #APP */
|
|
390 ; 199 "pendulum.c" 1
|
|
391 012e 00C0 rjmp .+0
|
|
392
|
|
393 ; 0 "" 2
|
|
394 ; 199 "pendulum.c" 1
|
|
395 0130 00C0 rjmp .+0
|
|
396
|
|
397 ; 0 "" 2
|
|
398 ; 199 "pendulum.c" 1
|
|
399 0132 00C0 rjmp .+0
|
|
400
|
|
401 ; 0 "" 2
|
|
402 ; 199 "pendulum.c" 1
|
|
403 0134 00C0 rjmp .+0
|
|
404
|
|
405 ; 0 "" 2
|
|
406 /* #NOAPP */
|
|
407 0136 0895 ret
|
|
409 .Lscope4:
|
|
411 .stabd 78,0,0
|
|
416 .global writeRGB
|
|
418 writeRGB:
|
|
419 .stabd 46,0,0
|
|
200:pendulum.c **** }
|
|
201:pendulum.c ****
|
|
202:pendulum.c **** inline void writeRGB(uint8_t red, uint8_t green, uint8_t blue) {
|
|
421 .LM22:
|
|
422 .LFBB5:
|
|
423 0138 AF92 push r10
|
|
424 013a BF92 push r11
|
|
425 013c CF92 push r12
|
|
426 013e DF92 push r13
|
|
427 0140 EF92 push r14
|
|
428 0142 FF92 push r15
|
|
429 0144 0F93 push r16
|
|
430 0146 1F93 push r17
|
|
431 0148 CF93 push r28
|
|
432 014a DF93 push r29
|
|
433 /* prologue: function */
|
|
434 /* frame size = 0 */
|
|
435 /* stack size = 10 */
|
|
436 .L__stack_usage = 10
|
|
437 014c C82E mov r12,r24
|
|
438 014e E42E mov r14,r20
|
|
440 .LM23:
|
|
441 0150 C8E0 ldi r28,lo8(8)
|
|
442 0152 D0E0 ldi r29,0
|
|
203:pendulum.c **** int i;
|
|
204:pendulum.c ****
|
|
205:pendulum.c **** for( i = 128; i > 0; i >>= 1 ) {
|
|
444 .LM24:
|
|
445 0154 00E8 ldi r16,lo8(-128)
|
|
446 0156 10E0 ldi r17,0
|
|
206:pendulum.c **** if( green & i ){
|
|
448 .LM25:
|
|
449 0158 A62E mov r10,r22
|
|
450 015a B12C mov r11,__zero_reg__
|
|
451 .L8:
|
|
452 015c C801 movw r24,r16
|
|
453 015e 8A21 and r24,r10
|
|
454 0160 9B21 and r25,r11
|
|
455 0162 892B or r24,r25
|
|
456 0164 01F0 breq .L6
|
|
207:pendulum.c **** writeOne();
|
|
458 .LM26:
|
|
459 0166 0E94 0000 call writeOne
|
|
460 016a 00C0 rjmp .L7
|
|
461 .L6:
|
|
208:pendulum.c **** } else {
|
|
209:pendulum.c **** writeZero();
|
|
463 .LM27:
|
|
464 016c 0E94 0000 call writeZero
|
|
465 .L7:
|
|
205:pendulum.c **** if( green & i ){
|
|
467 .LM28:
|
|
468 0170 1595 asr r17
|
|
469 0172 0795 ror r16
|
|
470 0174 2197 sbiw r28,1
|
|
471 0176 01F4 brne .L8
|
|
472 0178 C8E0 ldi r28,lo8(8)
|
|
473 017a D0E0 ldi r29,0
|
|
474 017c 00E8 ldi r16,lo8(-128)
|
|
475 017e 10E0 ldi r17,0
|
|
210:pendulum.c **** }
|
|
211:pendulum.c **** }
|
|
212:pendulum.c ****
|
|
213:pendulum.c **** for( i = 128; i > 0; i >>= 1 ) {
|
|
214:pendulum.c **** if( red & i ){
|
|
477 .LM29:
|
|
478 0180 D12C mov r13,__zero_reg__
|
|
479 .L11:
|
|
480 0182 C801 movw r24,r16
|
|
481 0184 8C21 and r24,r12
|
|
482 0186 9D21 and r25,r13
|
|
483 0188 892B or r24,r25
|
|
484 018a 01F0 breq .L9
|
|
215:pendulum.c **** writeOne();
|
|
486 .LM30:
|
|
487 018c 0E94 0000 call writeOne
|
|
488 0190 00C0 rjmp .L10
|
|
489 .L9:
|
|
216:pendulum.c **** } else {
|
|
217:pendulum.c **** writeZero();
|
|
491 .LM31:
|
|
492 0192 0E94 0000 call writeZero
|
|
493 .L10:
|
|
213:pendulum.c **** if( red & i ){
|
|
495 .LM32:
|
|
496 0196 1595 asr r17
|
|
497 0198 0795 ror r16
|
|
498 019a 2197 sbiw r28,1
|
|
499 019c 01F4 brne .L11
|
|
500 019e C8E0 ldi r28,lo8(8)
|
|
501 01a0 D0E0 ldi r29,0
|
|
502 01a2 00E8 ldi r16,lo8(-128)
|
|
503 01a4 10E0 ldi r17,0
|
|
218:pendulum.c **** }
|
|
219:pendulum.c **** }
|
|
220:pendulum.c ****
|
|
221:pendulum.c **** for( i = 128; i > 0; i >>= 1 ) {
|
|
222:pendulum.c **** if( blue & i ){
|
|
505 .LM33:
|
|
506 01a6 F12C mov r15,__zero_reg__
|
|
507 .L14:
|
|
508 01a8 C801 movw r24,r16
|
|
509 01aa 8E21 and r24,r14
|
|
510 01ac 9F21 and r25,r15
|
|
511 01ae 892B or r24,r25
|
|
512 01b0 01F0 breq .L12
|
|
223:pendulum.c **** writeOne();
|
|
514 .LM34:
|
|
515 01b2 0E94 0000 call writeOne
|
|
516 01b6 00C0 rjmp .L13
|
|
517 .L12:
|
|
224:pendulum.c **** } else {
|
|
225:pendulum.c **** writeZero();
|
|
519 .LM35:
|
|
520 01b8 0E94 0000 call writeZero
|
|
521 .L13:
|
|
221:pendulum.c **** if( blue & i ){
|
|
523 .LM36:
|
|
524 01bc 1595 asr r17
|
|
525 01be 0795 ror r16
|
|
526 01c0 2197 sbiw r28,1
|
|
527 01c2 01F4 brne .L14
|
|
528 /* epilogue start */
|
|
226:pendulum.c **** }
|
|
227:pendulum.c **** }
|
|
228:pendulum.c **** }
|
|
530 .LM37:
|
|
531 01c4 DF91 pop r29
|
|
532 01c6 CF91 pop r28
|
|
533 01c8 1F91 pop r17
|
|
534 01ca 0F91 pop r16
|
|
535 01cc FF90 pop r15
|
|
536 01ce EF90 pop r14
|
|
537 01d0 DF90 pop r13
|
|
538 01d2 CF90 pop r12
|
|
539 01d4 BF90 pop r11
|
|
540 01d6 AF90 pop r10
|
|
541 01d8 0895 ret
|
|
543 .Lscope5:
|
|
545 .stabd 78,0,0
|
|
546 .section .text.startup,"ax",@progbits
|
|
548 .global main
|
|
550 main:
|
|
551 .stabd 46,0,0
|
|
58:pendulum.c ****
|
|
553 .LM38:
|
|
554 .LFBB6:
|
|
555 0000 CF93 push r28
|
|
556 0002 DF93 push r29
|
|
557 0004 CDB7 in r28,__SP_L__
|
|
558 0006 DEB7 in r29,__SP_H__
|
|
559 0008 C25D subi r28,-46
|
|
560 000a D109 sbc r29,__zero_reg__
|
|
561 000c 0FB6 in __tmp_reg__,__SREG__
|
|
562 000e F894 cli
|
|
563 0010 DEBF out __SP_H__,r29
|
|
564 0012 0FBE out __SREG__,__tmp_reg__
|
|
565 0014 CDBF out __SP_L__,r28
|
|
566 /* prologue: function */
|
|
567 /* frame size = 210 */
|
|
568 /* stack size = 212 */
|
|
569 .L__stack_usage = 212
|
|
60:pendulum.c **** // Enable INT1 (PIN5) for interrupt
|
|
571 .LM39:
|
|
572 0016 E99A sbi 0x1d,1
|
|
62:pendulum.c **** // INT1 on rising edge
|
|
574 .LM40:
|
|
575 0018 8091 6900 lds r24,105
|
|
576 001c 8C60 ori r24,lo8(12)
|
|
577 001e 8093 6900 sts 105,r24
|
|
65:pendulum.c **** // Enable overflow interrupt
|
|
579 .LM41:
|
|
580 0022 8091 6F00 lds r24,111
|
|
581 0026 8160 ori r24,lo8(1)
|
|
582 0028 8093 6F00 sts 111,r24
|
|
67:pendulum.c **** // Prescale Factor 1
|
|
584 .LM42:
|
|
585 002c 8091 8100 lds r24,129
|
|
586 0030 8160 ori r24,lo8(1)
|
|
587 0032 8093 8100 sts 129,r24
|
|
70:pendulum.c **** // Enable global interrupts
|
|
589 .LM43:
|
|
590 0036 8FB7 in r24,__SREG__
|
|
591 0038 8068 ori r24,lo8(-128)
|
|
592 003a 8FBF out __SREG__,r24
|
|
73:pendulum.c **** PORTC = 0x00;
|
|
594 .LM44:
|
|
595 003c 8FE3 ldi r24,lo8(63)
|
|
596 003e 87B9 out 0x7,r24
|
|
74:pendulum.c ****
|
|
598 .LM45:
|
|
599 0040 18B8 out 0x8,__zero_reg__
|
|
79:pendulum.c **** init_hsv_t(min, HUE_SAT, HUE_VAL), // from color
|
|
601 .LM46:
|
|
602 0042 8091 0000 lds r24,max
|
|
603 0046 9091 0000 lds r25,max+1
|
|
604 004a 44E1 ldi r20,lo8(20)
|
|
605 004c 64E6 ldi r22,lo8(100)
|
|
606 004e 0E94 0000 call init_hsv_t
|
|
607 0052 4B01 movw r8,r22
|
|
608 0054 5C01 movw r10,r24
|
|
609 0056 8091 0000 lds r24,min
|
|
610 005a 9091 0000 lds r25,min+1
|
|
611 005e 44E1 ldi r20,lo8(20)
|
|
612 0060 64E6 ldi r22,lo8(100)
|
|
613 0062 0E94 0000 call init_hsv_t
|
|
614 0066 9E01 movw r18,r28
|
|
615 0068 2F5F subi r18,-1
|
|
616 006a 3F4F sbci r19,-1
|
|
617 006c 7901 movw r14,r18
|
|
618 006e 0EE1 ldi r16,lo8(30)
|
|
619 0070 10E0 ldi r17,0
|
|
620 0072 A501 movw r20,r10
|
|
621 0074 9401 movw r18,r8
|
|
622 0076 0E94 0000 call interpolate
|
|
85:pendulum.c **** // Assign color
|
|
624 .LM47:
|
|
625 007a 4EE1 ldi r20,lo8(30)
|
|
626 007c 50E0 ldi r21,0
|
|
627 007e BE01 movw r22,r28
|
|
628 0080 6758 subi r22,-121
|
|
629 0082 7F4F sbci r23,-1
|
|
630 0084 C701 movw r24,r14
|
|
631 0086 0E94 0000 call hsv2rgbList
|
|
632 008a 49E7 ldi r20,lo8(121)
|
|
633 008c A42E mov r10,r20
|
|
634 008e B12C mov r11,__zero_reg__
|
|
635 0090 AC0E add r10,r28
|
|
636 0092 BD1E adc r11,r29
|
|
637 0094 32E0 ldi r19,2
|
|
638 0096 A30E add r10,r19
|
|
639 0098 B11C adc r11,__zero_reg__
|
|
640 009a 4E01 movw r8,r28
|
|
641 009c 85ED ldi r24,-43
|
|
642 009e 880E add r8,r24
|
|
643 00a0 911C adc r9,__zero_reg__
|
|
644 00a2 8501 movw r16,r10
|
|
645 .L20:
|
|
646 00a4 D801 movw r26,r16
|
|
647 00a6 1197 sbiw r26,1
|
|
648 00a8 C801 movw r24,r16
|
|
649 00aa 0297 sbiw r24,2
|
|
650 .LBB2:
|
|
88:pendulum.c **** }
|
|
652 .LM48:
|
|
653 00ac F801 movw r30,r16
|
|
654 00ae 4081 ld r20,Z
|
|
655 00b0 6C91 ld r22,X
|
|
656 00b2 FC01 movw r30,r24
|
|
657 00b4 8081 ld r24,Z
|
|
658 00b6 0E94 0000 call writeRGB
|
|
659 00ba 0D5F subi r16,-3
|
|
660 00bc 1F4F sbci r17,-1
|
|
87:pendulum.c **** writeRGB( colorsRGB[i].r, colorsRGB[i].g, colorsRGB[i].b);
|
|
662 .LM49:
|
|
663 00be 0815 cp r16,r8
|
|
664 00c0 1905 cpc r17,r9
|
|
665 00c2 01F4 brne .L20
|
|
666 .LBE2:
|
|
93:pendulum.c **** max -= sign * HUE_STEP;
|
|
668 .LM50:
|
|
669 00c4 8091 0000 lds r24,min
|
|
670 00c8 9091 0000 lds r25,min+1
|
|
671 00cc 0896 adiw r24,8
|
|
672 00ce 9093 0000 sts min+1,r25
|
|
673 00d2 8093 0000 sts min,r24
|
|
94:pendulum.c **** interpolate(
|
|
675 .LM51:
|
|
676 00d6 8091 0000 lds r24,max
|
|
677 00da 9091 0000 lds r25,max+1
|
|
678 00de 0897 sbiw r24,8
|
|
679 00e0 9093 0000 sts max+1,r25
|
|
680 00e4 8093 0000 sts max,r24
|
|
95:pendulum.c **** init_hsv_t(min, HUE_SAT, HUE_VAL),// from color
|
|
682 .LM52:
|
|
683 00e8 8091 0000 lds r24,max
|
|
684 00ec 9091 0000 lds r25,max+1
|
|
685 00f0 44E1 ldi r20,lo8(20)
|
|
686 00f2 64E6 ldi r22,lo8(100)
|
|
687 00f4 0E94 0000 call init_hsv_t
|
|
688 00f8 2B01 movw r4,r22
|
|
689 00fa 3C01 movw r6,r24
|
|
690 00fc 8091 0000 lds r24,min
|
|
691 0100 9091 0000 lds r25,min+1
|
|
692 0104 44E1 ldi r20,lo8(20)
|
|
693 0106 64E6 ldi r22,lo8(100)
|
|
694 0108 0E94 0000 call init_hsv_t
|
|
695 010c 9E01 movw r18,r28
|
|
696 010e 2F5F subi r18,-1
|
|
697 0110 3F4F sbci r19,-1
|
|
698 0112 7901 movw r14,r18
|
|
699 0114 0EE1 ldi r16,lo8(30)
|
|
700 0116 10E0 ldi r17,0
|
|
701 0118 A301 movw r20,r6
|
|
702 011a 9201 movw r18,r4
|
|
703 011c 0E94 0000 call interpolate
|
|
101:pendulum.c ****
|
|
705 .LM53:
|
|
706 0120 4EE1 ldi r20,lo8(30)
|
|
707 0122 50E0 ldi r21,0
|
|
708 0124 BE01 movw r22,r28
|
|
709 0126 6758 subi r22,-121
|
|
710 0128 7F4F sbci r23,-1
|
|
711 012a C701 movw r24,r14
|
|
712 012c 0E94 0000 call hsv2rgbList
|
|
92:pendulum.c **** min += sign * HUE_STEP;
|
|
714 .LM54:
|
|
715 0130 DD24 clr r13
|
|
716 0132 D394 inc r13
|
|
717 .LBB3:
|
|
121:pendulum.c **** // Assign color
|
|
719 .LM55:
|
|
720 0134 34E0 ldi r19,lo8(4)
|
|
721 0136 C32E mov r12,r19
|
|
722 .L23:
|
|
104:pendulum.c **** //~ if(now > delay) {
|
|
724 .LM56:
|
|
725 0138 4091 0000 lds r20,time
|
|
726 013c 5091 0000 lds r21,time+1
|
|
727 0140 6091 0000 lds r22,time+2
|
|
728 0144 7091 0000 lds r23,time+3
|
|
729 0148 8091 8400 lds r24,132
|
|
730 014c 9091 8500 lds r25,132+1
|
|
731 0150 480F add r20,r24
|
|
732 0152 591F adc r21,r25
|
|
733 0154 611D adc r22,__zero_reg__
|
|
734 0156 711D adc r23,__zero_reg__
|
|
112:pendulum.c **** EIMSK |= 0x02; // Enable INT1
|
|
736 .LM57:
|
|
737 0158 8091 0000 lds r24,cooldown
|
|
738 015c 9091 0000 lds r25,cooldown+1
|
|
739 0160 A091 0000 lds r26,cooldown+2
|
|
740 0164 B091 0000 lds r27,cooldown+3
|
|
741 0168 8417 cp r24,r20
|
|
742 016a 9507 cpc r25,r21
|
|
743 016c A607 cpc r26,r22
|
|
744 016e B707 cpc r27,r23
|
|
745 0170 00F4 brsh .L22
|
|
113:pendulum.c **** }
|
|
747 .LM58:
|
|
748 0172 E99A sbi 0x1d,1
|
|
749 .L22:
|
|
116:pendulum.c ****
|
|
751 .LM59:
|
|
752 0174 8091 0000 lds r24,T_half
|
|
753 0178 9091 0000 lds r25,T_half+1
|
|
754 017c A091 0000 lds r26,T_half+2
|
|
755 0180 B091 0000 lds r27,T_half+3
|
|
756 0184 25E0 ldi r18,5
|
|
757 1:
|
|
758 0186 B695 lsr r27
|
|
759 0188 A795 ror r26
|
|
760 018a 9795 ror r25
|
|
761 018c 8795 ror r24
|
|
762 018e 2A95 dec r18
|
|
763 0190 01F4 brne 1b
|
|
119:pendulum.c **** oldTime += T_step;
|
|
765 .LM60:
|
|
766 0192 0091 0000 lds r16,oldTime
|
|
767 0196 1091 0000 lds r17,oldTime+1
|
|
768 019a 2091 0000 lds r18,oldTime+2
|
|
769 019e 3091 0000 lds r19,oldTime+3
|
|
770 01a2 080F add r16,r24
|
|
771 01a4 191F adc r17,r25
|
|
772 01a6 2A1F adc r18,r26
|
|
773 01a8 3B1F adc r19,r27
|
|
774 01aa 0417 cp r16,r20
|
|
775 01ac 1507 cpc r17,r21
|
|
776 01ae 2607 cpc r18,r22
|
|
777 01b0 3707 cpc r19,r23
|
|
778 01b2 00F4 brsh .L23
|
|
120:pendulum.c **** PORTC ^= 0x04;
|
|
780 .LM61:
|
|
781 01b4 4091 0000 lds r20,oldTime
|
|
782 01b8 5091 0000 lds r21,oldTime+1
|
|
783 01bc 6091 0000 lds r22,oldTime+2
|
|
784 01c0 7091 0000 lds r23,oldTime+3
|
|
785 01c4 840F add r24,r20
|
|
786 01c6 951F adc r25,r21
|
|
787 01c8 A61F adc r26,r22
|
|
788 01ca B71F adc r27,r23
|
|
789 01cc 8093 0000 sts oldTime,r24
|
|
790 01d0 9093 0000 sts oldTime+1,r25
|
|
791 01d4 A093 0000 sts oldTime+2,r26
|
|
792 01d8 B093 0000 sts oldTime+3,r27
|
|
121:pendulum.c **** // Assign color
|
|
794 .LM62:
|
|
795 01dc 88B1 in r24,0x8
|
|
796 01de 8C25 eor r24,r12
|
|
797 01e0 88B9 out 0x8,r24
|
|
123:pendulum.c **** for(int i = 0; i < LEDS; i++) {
|
|
799 .LM63:
|
|
800 /* #APP */
|
|
801 ; 123 "pendulum.c" 1
|
|
802 01e2 F894 cli
|
|
803 ; 0 "" 2
|
|
804 /* #NOAPP */
|
|
805 01e4 8501 movw r16,r10
|
|
806 .L24:
|
|
807 01e6 D801 movw r26,r16
|
|
808 01e8 1197 sbiw r26,1
|
|
809 01ea C801 movw r24,r16
|
|
810 01ec 0297 sbiw r24,2
|
|
811 .LBB4:
|
|
125:pendulum.c **** }
|
|
813 .LM64:
|
|
814 01ee F801 movw r30,r16
|
|
815 01f0 4081 ld r20,Z
|
|
816 01f2 6C91 ld r22,X
|
|
817 01f4 FC01 movw r30,r24
|
|
818 01f6 8081 ld r24,Z
|
|
819 01f8 0E94 0000 call writeRGB
|
|
820 01fc 0D5F subi r16,-3
|
|
821 01fe 1F4F sbci r17,-1
|
|
124:pendulum.c **** writeRGB( colorsRGB[i].r, colorsRGB[i].g, colorsRGB[i].b);
|
|
823 .LM65:
|
|
824 0200 0815 cp r16,r8
|
|
825 0202 1905 cpc r17,r9
|
|
826 0204 01F4 brne .L24
|
|
827 .LBE4:
|
|
127:pendulum.c **** //~ _delay_us(51);
|
|
829 .LM66:
|
|
830 /* #APP */
|
|
831 ; 127 "pendulum.c" 1
|
|
832 0206 7894 sei
|
|
833 ; 0 "" 2
|
|
131:pendulum.c **** max -= sign * HUE_STEP;
|
|
835 .LM67:
|
|
836 /* #NOAPP */
|
|
837 0208 8091 0000 lds r24,min
|
|
838 020c 9091 0000 lds r25,min+1
|
|
839 0210 FD2D mov r31,r13
|
|
840 0212 28E0 ldi r18,lo8(8)
|
|
841 0214 F202 muls r31,r18
|
|
842 0216 800D add r24,r0
|
|
843 0218 911D adc r25,r1
|
|
844 021a 1124 clr __zero_reg__
|
|
845 021c 9093 0000 sts min+1,r25
|
|
846 0220 8093 0000 sts min,r24
|
|
132:pendulum.c **** interpolate(
|
|
848 .LM68:
|
|
849 0224 8091 0000 lds r24,max
|
|
850 0228 9091 0000 lds r25,max+1
|
|
851 022c 38E0 ldi r19,lo8(8)
|
|
852 022e F302 muls r31,r19
|
|
853 0230 8019 sub r24,r0
|
|
854 0232 9109 sbc r25,r1
|
|
855 0234 1124 clr __zero_reg__
|
|
856 0236 9093 0000 sts max+1,r25
|
|
857 023a 8093 0000 sts max,r24
|
|
133:pendulum.c **** init_hsv_t(min, HUE_SAT, HUE_VAL), // from color
|
|
859 .LM69:
|
|
860 023e 8091 0000 lds r24,max
|
|
861 0242 9091 0000 lds r25,max+1
|
|
862 0246 44E1 ldi r20,lo8(20)
|
|
863 0248 64E6 ldi r22,lo8(100)
|
|
864 024a 0E94 0000 call init_hsv_t
|
|
865 024e 2B01 movw r4,r22
|
|
866 0250 3C01 movw r6,r24
|
|
867 0252 8091 0000 lds r24,min
|
|
868 0256 9091 0000 lds r25,min+1
|
|
869 025a 44E1 ldi r20,lo8(20)
|
|
870 025c 64E6 ldi r22,lo8(100)
|
|
871 025e 0E94 0000 call init_hsv_t
|
|
872 0262 FE01 movw r30,r28
|
|
873 0264 3196 adiw r30,1
|
|
874 0266 7F01 movw r14,r30
|
|
875 0268 0EE1 ldi r16,lo8(30)
|
|
876 026a 10E0 ldi r17,0
|
|
877 026c A301 movw r20,r6
|
|
878 026e 9201 movw r18,r4
|
|
879 0270 0E94 0000 call interpolate
|
|
139:pendulum.c **** // Check if reached amplitude
|
|
881 .LM70:
|
|
882 0274 4EE1 ldi r20,lo8(30)
|
|
883 0276 50E0 ldi r21,0
|
|
884 0278 BE01 movw r22,r28
|
|
885 027a 6758 subi r22,-121
|
|
886 027c 7F4F sbci r23,-1
|
|
887 027e C701 movw r24,r14
|
|
888 0280 0E94 0000 call hsv2rgbList
|
|
141:pendulum.c **** sign = -1;
|
|
890 .LM71:
|
|
891 0284 F1E0 ldi r31,lo8(1)
|
|
892 0286 DF12 cpse r13,r31
|
|
893 0288 00C0 rjmp .L25
|
|
141:pendulum.c **** sign = -1;
|
|
895 .LM72:
|
|
896 028a 8091 0000 lds r24,min
|
|
897 028e 9091 0000 lds r25,min+1
|
|
898 0292 8236 cpi r24,98
|
|
899 0294 9240 sbci r25,2
|
|
900 0296 00F0 brlo .L34
|
|
901 .L28:
|
|
142:pendulum.c **** } else if(sign == -1 && (min <= HUE_MIN || max >= HUE_MAX)) {
|
|
903 .LM73:
|
|
904 0298 DD24 clr r13
|
|
905 029a DA94 dec r13
|
|
906 029c 00C0 rjmp .L23
|
|
907 .L34:
|
|
141:pendulum.c **** sign = -1;
|
|
909 .LM74:
|
|
910 029e 8091 0000 lds r24,max
|
|
911 02a2 9091 0000 lds r25,max+1
|
|
912 02a6 8F35 cpi r24,95
|
|
913 02a8 9140 sbci r25,1
|
|
914 02aa 00F0 brlo .L28
|
|
915 02ac 00C0 rjmp .L23
|
|
916 .L25:
|
|
143:pendulum.c **** sign = 1;
|
|
918 .LM75:
|
|
919 02ae 8FEF ldi r24,lo8(-1)
|
|
920 02b0 D816 cp r13,r24
|
|
921 02b2 01F0 breq .L35
|
|
922 02b4 D12C mov r13,__zero_reg__
|
|
923 02b6 00C0 rjmp .L23
|
|
924 .L35:
|
|
143:pendulum.c **** sign = 1;
|
|
926 .LM76:
|
|
927 02b8 8091 0000 lds r24,min
|
|
928 02bc 9091 0000 lds r25,min+1
|
|
929 02c0 8F35 cpi r24,95
|
|
930 02c2 9140 sbci r25,1
|
|
931 02c4 00F4 brsh .L36
|
|
932 .L30:
|
|
144:pendulum.c **** }
|
|
934 .LM77:
|
|
935 02c6 DD24 clr r13
|
|
936 02c8 D394 inc r13
|
|
937 02ca 00C0 rjmp .L23
|
|
938 .L36:
|
|
143:pendulum.c **** sign = 1;
|
|
940 .LM78:
|
|
941 02cc 8091 0000 lds r24,max
|
|
942 02d0 9091 0000 lds r25,max+1
|
|
943 02d4 8236 cpi r24,98
|
|
944 02d6 9240 sbci r25,2
|
|
945 02d8 00F4 brsh .+2
|
|
946 02da 00C0 rjmp .L23
|
|
947 02dc 00C0 rjmp .L30
|
|
948 .LBE3:
|
|
959 .Lscope6:
|
|
961 .stabd 78,0,0
|
|
962 .global cooldown
|
|
963 .section .bss
|
|
966 cooldown:
|
|
967 0000 0000 0000 .zero 4
|
|
968 .global oldTime
|
|
971 oldTime:
|
|
972 0004 0000 0000 .zero 4
|
|
973 .global T_half
|
|
976 T_half:
|
|
977 0008 0000 0000 .zero 4
|
|
978 .global time
|
|
981 time:
|
|
982 000c 0000 0000 .zero 4
|
|
983 .global max
|
|
984 .data
|
|
987 max:
|
|
988 0000 E001 .word 480
|
|
989 .global min
|
|
992 min:
|
|
993 0002 E001 .word 480
|
|
994 .global status
|
|
997 status:
|
|
998 0004 01 .byte 1
|
|
999 .global colorSteps
|
|
1000 .section .rodata
|
|
1003 colorSteps:
|
|
1004 0000 20 .byte 32
|
|
1005 0001 00 .byte 0
|
|
1006 0002 00 .byte 0
|
|
1007 0003 00 .byte 0
|
|
1016 .text
|
|
1018 .Letext0:
|
|
1019 .ident "GCC: (GNU) 4.9.2"
|
|
1020 .global __do_copy_data
|
|
1021 .global __do_clear_bss
|
|
DEFINED SYMBOLS
|
|
*ABS*:0000000000000000 pendulum.c
|
|
/tmp/ccgxWf0J.s:2 *ABS*:000000000000003e __SP_H__
|
|
/tmp/ccgxWf0J.s:3 *ABS*:000000000000003d __SP_L__
|
|
/tmp/ccgxWf0J.s:4 *ABS*:000000000000003f __SREG__
|
|
/tmp/ccgxWf0J.s:5 *ABS*:0000000000000000 __tmp_reg__
|
|
/tmp/ccgxWf0J.s:6 *ABS*:0000000000000001 __zero_reg__
|
|
/tmp/ccgxWf0J.s:115 .text:0000000000000000 __vector_2
|
|
/tmp/ccgxWf0J.s:981 .bss:000000000000000c time
|
|
/tmp/ccgxWf0J.s:976 .bss:0000000000000008 T_half
|
|
/tmp/ccgxWf0J.s:966 .bss:0000000000000000 cooldown
|
|
/tmp/ccgxWf0J.s:971 .bss:0000000000000004 oldTime
|
|
/tmp/ccgxWf0J.s:217 .text:00000000000000ba __vector_13
|
|
/tmp/ccgxWf0J.s:265 .text:0000000000000100 writeZero
|
|
/tmp/ccgxWf0J.s:340 .text:000000000000011c writeOne
|
|
/tmp/ccgxWf0J.s:418 .text:0000000000000138 writeRGB
|
|
/tmp/ccgxWf0J.s:550 .text.startup:0000000000000000 main
|
|
/tmp/ccgxWf0J.s:987 .data:0000000000000000 max
|
|
/tmp/ccgxWf0J.s:992 .data:0000000000000002 min
|
|
/tmp/ccgxWf0J.s:997 .data:0000000000000004 status
|
|
/tmp/ccgxWf0J.s:1003 .rodata:0000000000000000 colorSteps
|
|
|
|
UNDEFINED SYMBOLS
|
|
init_hsv_t
|
|
interpolate
|
|
hsv2rgbList
|
|
__do_copy_data
|
|
__do_clear_bss
|