|
|
@@ -0,0 +1,179 @@
|
|
|
+
|
|
|
+HexLightTest.elf: file format elf32-avr
|
|
|
+
|
|
|
+Sections:
|
|
|
+Idx Name Size VMA LMA File off Algn
|
|
|
+ 0 .text 0000009a 00000000 00000000 00000054 2**1
|
|
|
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
|
+ 1 .data 00000000 00800060 00800060 000000ee 2**0
|
|
|
+ CONTENTS, ALLOC, LOAD, DATA
|
|
|
+ 2 .comment 00000030 00000000 00000000 000000ee 2**0
|
|
|
+ CONTENTS, READONLY
|
|
|
+ 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000120 2**2
|
|
|
+ CONTENTS, READONLY
|
|
|
+ 4 .debug_aranges 00000020 00000000 00000000 0000015c 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 5 .debug_info 0000056a 00000000 00000000 0000017c 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 6 .debug_abbrev 000004bc 00000000 00000000 000006e6 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 7 .debug_line 00000294 00000000 00000000 00000ba2 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 8 .debug_frame 00000024 00000000 00000000 00000e38 2**2
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 9 .debug_str 000002ea 00000000 00000000 00000e5c 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 10 .debug_loc 00000081 00000000 00000000 00001146 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+ 11 .debug_ranges 00000010 00000000 00000000 000011c7 2**0
|
|
|
+ CONTENTS, READONLY, DEBUGGING
|
|
|
+
|
|
|
+Disassembly of section .text:
|
|
|
+
|
|
|
+00000000 <__vectors>:
|
|
|
+ 0: 0e c0 rjmp .+28 ; 0x1e <__ctors_end>
|
|
|
+ 2: 15 c0 rjmp .+42 ; 0x2e <__bad_interrupt>
|
|
|
+ 4: 14 c0 rjmp .+40 ; 0x2e <__bad_interrupt>
|
|
|
+ 6: 13 c0 rjmp .+38 ; 0x2e <__bad_interrupt>
|
|
|
+ 8: 12 c0 rjmp .+36 ; 0x2e <__bad_interrupt>
|
|
|
+ a: 11 c0 rjmp .+34 ; 0x2e <__bad_interrupt>
|
|
|
+ c: 10 c0 rjmp .+32 ; 0x2e <__bad_interrupt>
|
|
|
+ e: 0f c0 rjmp .+30 ; 0x2e <__bad_interrupt>
|
|
|
+ 10: 0e c0 rjmp .+28 ; 0x2e <__bad_interrupt>
|
|
|
+ 12: 0d c0 rjmp .+26 ; 0x2e <__bad_interrupt>
|
|
|
+ 14: 0c c0 rjmp .+24 ; 0x2e <__bad_interrupt>
|
|
|
+ 16: 0b c0 rjmp .+22 ; 0x2e <__bad_interrupt>
|
|
|
+ 18: 0a c0 rjmp .+20 ; 0x2e <__bad_interrupt>
|
|
|
+ 1a: 09 c0 rjmp .+18 ; 0x2e <__bad_interrupt>
|
|
|
+ 1c: 08 c0 rjmp .+16 ; 0x2e <__bad_interrupt>
|
|
|
+
|
|
|
+0000001e <__ctors_end>:
|
|
|
+ 1e: 11 24 eor r1, r1
|
|
|
+ 20: 1f be out 0x3f, r1 ; 63
|
|
|
+ 22: cf e5 ldi r28, 0x5F ; 95
|
|
|
+ 24: d1 e0 ldi r29, 0x01 ; 1
|
|
|
+ 26: de bf out 0x3e, r29 ; 62
|
|
|
+ 28: cd bf out 0x3d, r28 ; 61
|
|
|
+ 2a: 02 d0 rcall .+4 ; 0x30 <main>
|
|
|
+ 2c: 34 c0 rjmp .+104 ; 0x96 <_exit>
|
|
|
+
|
|
|
+0000002e <__bad_interrupt>:
|
|
|
+ 2e: e8 cf rjmp .-48 ; 0x0 <__vectors>
|
|
|
+
|
|
|
+00000030 <main>:
|
|
|
+#include <util/delay.h>
|
|
|
+
|
|
|
+
|
|
|
+int main(void)
|
|
|
+{
|
|
|
+ DDRB |= 1 << PB4 | 1 << PB0 | 1 << PB3;
|
|
|
+ 30: 87 b3 in r24, 0x17 ; 23
|
|
|
+ 32: 89 61 ori r24, 0x19 ; 25
|
|
|
+ 34: 87 bb out 0x17, r24 ; 23
|
|
|
+ PORTB = 0x00;
|
|
|
+ 36: 18 ba out 0x18, r1 ; 24
|
|
|
+ #define GREEN_LED (1<<PB4)
|
|
|
+ #define BLUE_LED (1<<PB0)
|
|
|
+
|
|
|
+ #define TID 10
|
|
|
+
|
|
|
+ ADMUX = 1<<ADLAR | 1<<MUX0; // Left adjust result, ADC1 (PB2) as analog input
|
|
|
+ 38: 81 e2 ldi r24, 0x21 ; 33
|
|
|
+ 3a: 87 b9 out 0x07, r24 ; 7
|
|
|
+ ADCSRB = 0;
|
|
|
+ 3c: 13 b8 out 0x03, r1 ; 3
|
|
|
+ ADCSRA = 1<<ADEN | 1<<ADSC | 1<<ADATE | 1<<ADPS2 | 1<<ADPS1;
|
|
|
+ 3e: 86 ee ldi r24, 0xE6 ; 230
|
|
|
+ 40: 86 b9 out 0x06, r24 ; 6
|
|
|
+
|
|
|
+ TCCR0B |= 1 << CS02 ;
|
|
|
+ 42: 83 b7 in r24, 0x33 ; 51
|
|
|
+ 44: 84 60 ori r24, 0x04 ; 4
|
|
|
+ 46: 83 bf out 0x33, r24 ; 51
|
|
|
+ #else
|
|
|
+ //round up by default
|
|
|
+ __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
+ #endif
|
|
|
+
|
|
|
+ __builtin_avr_delay_cycles(__ticks_dc);
|
|
|
+ 48: 2f ef ldi r18, 0xFF ; 255
|
|
|
+ 4a: 89 e6 ldi r24, 0x69 ; 105
|
|
|
+ 4c: 98 e1 ldi r25, 0x18 ; 24
|
|
|
+ 4e: 21 50 subi r18, 0x01 ; 1
|
|
|
+ 50: 80 40 sbci r24, 0x00 ; 0
|
|
|
+ 52: 90 40 sbci r25, 0x00 ; 0
|
|
|
+ 54: e1 f7 brne .-8 ; 0x4e <__SREG__+0xf>
|
|
|
+ 56: 00 c0 rjmp .+0 ; 0x58 <__SREG__+0x19>
|
|
|
+ 58: 00 00 nop
|
|
|
+ _delay_ms(1000);
|
|
|
+
|
|
|
+ /* Replace with your application code */
|
|
|
+ while (1)
|
|
|
+ {
|
|
|
+ k = ADCH;
|
|
|
+ 5a: 95 b1 in r25, 0x05 ; 5
|
|
|
+
|
|
|
+ // TODO: Transform k to nice colors
|
|
|
+ r = k;
|
|
|
+ g = k*2;
|
|
|
+ 5c: 29 2f mov r18, r25
|
|
|
+ 5e: 22 0f add r18, r18
|
|
|
+ b = k*4;
|
|
|
+ 60: 39 2f mov r19, r25
|
|
|
+ 62: 33 0f add r19, r19
|
|
|
+ 64: 33 0f add r19, r19
|
|
|
+
|
|
|
+
|
|
|
+ if(r) PORTB |= RED_LED;
|
|
|
+ 66: 91 11 cpse r25, r1
|
|
|
+ 68: c3 9a sbi 0x18, 3 ; 24
|
|
|
+ if(g) PORTB |= GREEN_LED;
|
|
|
+ 6a: 21 11 cpse r18, r1
|
|
|
+ 6c: c4 9a sbi 0x18, 4 ; 24
|
|
|
+ if(b) PORTB |= BLUE_LED;
|
|
|
+ 6e: 33 23 and r19, r19
|
|
|
+ 70: 71 f0 breq .+28 ; 0x8e <__SREG__+0x4f>
|
|
|
+ 72: c0 9a sbi 0x18, 0 ; 24
|
|
|
+ 74: 0c c0 rjmp .+24 ; 0x8e <__SREG__+0x4f>
|
|
|
+
|
|
|
+ while(TCNT0)
|
|
|
+ {
|
|
|
+ if(TCNT0 == r)
|
|
|
+ 76: 82 b7 in r24, 0x32 ; 50
|
|
|
+ 78: 98 13 cpse r25, r24
|
|
|
+ 7a: 01 c0 rjmp .+2 ; 0x7e <__SREG__+0x3f>
|
|
|
+ {
|
|
|
+ PORTB &= ~RED_LED;
|
|
|
+ 7c: c3 98 cbi 0x18, 3 ; 24
|
|
|
+ }
|
|
|
+ if(TCNT0 == g)
|
|
|
+ 7e: 82 b7 in r24, 0x32 ; 50
|
|
|
+ 80: 28 13 cpse r18, r24
|
|
|
+ 82: 01 c0 rjmp .+2 ; 0x86 <__SREG__+0x47>
|
|
|
+ {
|
|
|
+ PORTB &= ~GREEN_LED;
|
|
|
+ 84: c4 98 cbi 0x18, 4 ; 24
|
|
|
+ }
|
|
|
+ if(TCNT0 == b)
|
|
|
+ 86: 82 b7 in r24, 0x32 ; 50
|
|
|
+ 88: 38 13 cpse r19, r24
|
|
|
+ 8a: 01 c0 rjmp .+2 ; 0x8e <__SREG__+0x4f>
|
|
|
+ {
|
|
|
+ PORTB &= ~BLUE_LED;
|
|
|
+ 8c: c0 98 cbi 0x18, 0 ; 24
|
|
|
+
|
|
|
+ if(r) PORTB |= RED_LED;
|
|
|
+ if(g) PORTB |= GREEN_LED;
|
|
|
+ if(b) PORTB |= BLUE_LED;
|
|
|
+
|
|
|
+ while(TCNT0)
|
|
|
+ 8e: 82 b7 in r24, 0x32 ; 50
|
|
|
+ 90: 81 11 cpse r24, r1
|
|
|
+ 92: f1 cf rjmp .-30 ; 0x76 <__SREG__+0x37>
|
|
|
+ 94: e2 cf rjmp .-60 ; 0x5a <__SREG__+0x1b>
|
|
|
+
|
|
|
+00000096 <_exit>:
|
|
|
+ 96: f8 94 cli
|
|
|
+
|
|
|
+00000098 <__stop_program>:
|
|
|
+ 98: ff cf rjmp .-2 ; 0x98 <__stop_program>
|