2014-09-05 01:39:40 +02:00
|
|
|
|
|
|
|
|
|
Door.elf: file format elf32-avr
|
|
|
|
|
|
|
|
|
|
Sections:
|
|
|
|
|
Idx Name Size VMA LMA File off Algn
|
2015-02-08 00:22:32 +01:00
|
|
|
|
0 .data 0000006c 00800100 00000876 0000090a 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, ALLOC, LOAD, DATA
|
2015-02-08 00:22:32 +01:00
|
|
|
|
1 .text 00000876 00000000 00000000 00000094 2**1
|
2014-11-16 18:10:00 +01:00
|
|
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
2015-02-08 00:22:32 +01:00
|
|
|
|
2 .bss 00000006 0080016c 0080016c 00000976 2**0
|
2014-11-19 23:57:35 +01:00
|
|
|
|
ALLOC
|
2015-02-08 00:22:32 +01:00
|
|
|
|
3 .stab 000006cc 00000000 00000000 00000978 2**2
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4 .stabstr 00000082 00000000 00000000 00001044 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5 .comment 0000002f 00000000 00000000 000010c6 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY
|
2015-02-08 00:22:32 +01:00
|
|
|
|
6 .debug_aranges 00000058 00000000 00000000 000010f5 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
7 .debug_info 00002bd2 00000000 00000000 0000114d 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
8 .debug_abbrev 00000464 00000000 00000000 00003d1f 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
9 .debug_line 00000511 00000000 00000000 00004183 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
10 .debug_frame 000000f8 00000000 00000000 00004694 2**2
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
11 .debug_str 00001247 00000000 00000000 0000478c 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
12 .debug_loc 00000ccb 00000000 00000000 000059d3 2**0
|
2014-11-19 23:57:35 +01:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2015-02-08 00:22:32 +01:00
|
|
|
|
13 .debug_ranges 00000330 00000000 00000000 0000669e 2**0
|
2014-09-05 01:39:40 +02:00
|
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
|
|
|
|
|
|
|
Disassembly of section .text:
|
|
|
|
|
|
|
|
|
|
00000000 <__vectors>:
|
2014-11-19 23:57:35 +01:00
|
|
|
|
0: 0c 94 35 00 jmp 0x6a ; 0x6a <__ctors_end>
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4: 0c 94 49 03 jmp 0x692 ; 0x692 <__vector_1>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
8: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
c: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
10: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
14: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
18: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
1c: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
20: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
24: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
28: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
2c: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
30: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
34: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
38: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
3c: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
40: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
44: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
48: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
4c: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
50: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
54: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
58: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
5c: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
60: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
64: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt>
|
|
|
|
|
|
|
|
|
|
00000068 <__ctors_start>:
|
2015-02-08 00:22:32 +01:00
|
|
|
|
68: 01 04 cpc r0, r1
|
2014-11-19 23:57:35 +01:00
|
|
|
|
|
|
|
|
|
0000006a <__ctors_end>:
|
|
|
|
|
6a: 11 24 eor r1, r1
|
|
|
|
|
6c: 1f be out 0x3f, r1 ; 63
|
|
|
|
|
6e: cf ef ldi r28, 0xFF ; 255
|
|
|
|
|
70: d4 e0 ldi r29, 0x04 ; 4
|
|
|
|
|
72: de bf out 0x3e, r29 ; 62
|
|
|
|
|
74: cd bf out 0x3d, r28 ; 61
|
|
|
|
|
|
|
|
|
|
00000076 <__do_copy_data>:
|
|
|
|
|
76: 11 e0 ldi r17, 0x01 ; 1
|
|
|
|
|
78: a0 e0 ldi r26, 0x00 ; 0
|
|
|
|
|
7a: b1 e0 ldi r27, 0x01 ; 1
|
2015-02-08 00:22:32 +01:00
|
|
|
|
7c: e6 e7 ldi r30, 0x76 ; 118
|
|
|
|
|
7e: f8 e0 ldi r31, 0x08 ; 8
|
2014-11-19 23:57:35 +01:00
|
|
|
|
80: 02 c0 rjmp .+4 ; 0x86 <__do_copy_data+0x10>
|
|
|
|
|
82: 05 90 lpm r0, Z+
|
|
|
|
|
84: 0d 92 st X+, r0
|
2015-02-08 00:22:32 +01:00
|
|
|
|
86: ac 36 cpi r26, 0x6C ; 108
|
2014-11-19 23:57:35 +01:00
|
|
|
|
88: b1 07 cpc r27, r17
|
|
|
|
|
8a: d9 f7 brne .-10 ; 0x82 <__do_copy_data+0xc>
|
|
|
|
|
|
|
|
|
|
0000008c <__do_clear_bss>:
|
2015-02-08 00:22:32 +01:00
|
|
|
|
8c: 21 e0 ldi r18, 0x01 ; 1
|
|
|
|
|
8e: ac e6 ldi r26, 0x6C ; 108
|
2014-11-19 23:57:35 +01:00
|
|
|
|
90: b1 e0 ldi r27, 0x01 ; 1
|
|
|
|
|
92: 01 c0 rjmp .+2 ; 0x96 <.do_clear_bss_start>
|
|
|
|
|
|
|
|
|
|
00000094 <.do_clear_bss_loop>:
|
|
|
|
|
94: 1d 92 st X+, r1
|
|
|
|
|
|
|
|
|
|
00000096 <.do_clear_bss_start>:
|
2015-02-08 00:22:32 +01:00
|
|
|
|
96: a2 37 cpi r26, 0x72 ; 114
|
2014-11-19 23:57:35 +01:00
|
|
|
|
98: b2 07 cpc r27, r18
|
|
|
|
|
9a: e1 f7 brne .-8 ; 0x94 <.do_clear_bss_loop>
|
|
|
|
|
|
|
|
|
|
0000009c <__do_global_ctors>:
|
|
|
|
|
9c: 10 e0 ldi r17, 0x00 ; 0
|
|
|
|
|
9e: ca e6 ldi r28, 0x6A ; 106
|
|
|
|
|
a0: d0 e0 ldi r29, 0x00 ; 0
|
|
|
|
|
a2: 04 c0 rjmp .+8 ; 0xac <__do_global_ctors+0x10>
|
|
|
|
|
a4: 22 97 sbiw r28, 0x02 ; 2
|
|
|
|
|
a6: fe 01 movw r30, r28
|
2015-02-08 00:22:32 +01:00
|
|
|
|
a8: 0e 94 35 04 call 0x86a ; 0x86a <__tablejump__>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
ac: c8 36 cpi r28, 0x68 ; 104
|
|
|
|
|
ae: d1 07 cpc r29, r17
|
|
|
|
|
b0: c9 f7 brne .-14 ; 0xa4 <__do_global_ctors+0x8>
|
2015-02-08 00:22:32 +01:00
|
|
|
|
b2: 0e 94 cb 00 call 0x196 ; 0x196 <main>
|
|
|
|
|
b6: 0c 94 39 04 jmp 0x872 ; 0x872 <_exit>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
|
|
|
|
|
000000ba <__bad_interrupt>:
|
|
|
|
|
ba: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
|
|
|
|
|
2015-02-08 00:22:32 +01:00
|
|
|
|
000000be <_ZN4UartILm9600EEC1Ev>:
|
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
|
|
|
|
|
template <uint32_t baudrate>
|
|
|
|
|
class Uart {
|
|
|
|
|
public:
|
|
|
|
|
Uart() {
|
|
|
|
|
be: cf 93 push r28
|
|
|
|
|
c0: df 93 push r29
|
|
|
|
|
sei();
|
|
|
|
|
c2: 78 94 sei
|
|
|
|
|
void print(uint8_t wert) {
|
|
|
|
|
uart_putchar(wert);
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
private:
|
|
|
|
|
void init() {
|
|
|
|
|
UBRR0L = (F_CPU / (baudrate * 16L) - 1); //Teiler wird gesetzt
|
|
|
|
|
c4: 81 e8 ldi r24, 0x81 ; 129
|
|
|
|
|
c6: 80 93 c4 00 sts 0x00C4, r24
|
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
ca: 10 92 c0 00 sts 0x00C0, r1
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
ce: 88 e0 ldi r24, 0x08 ; 8
|
|
|
|
|
d0: 80 93 c1 00 sts 0x00C1, r24
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
d4: 86 e0 ldi r24, 0x06 ; 6
|
|
|
|
|
d6: 80 93 c2 00 sts 0x00C2, r24
|
|
|
|
|
da: a1 e0 ldi r26, 0x01 ; 1
|
|
|
|
|
dc: b1 e0 ldi r27, 0x01 ; 1
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
|
|
|
|
}
|
|
|
|
|
void print(const char *text) {
|
|
|
|
|
while (*text)
|
|
|
|
|
de: 95 e5 ldi r25, 0x55 ; 85
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
e0: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
e2: f0 e0 ldi r31, 0x00 ; 0
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
e4: c6 ec ldi r28, 0xC6 ; 198
|
|
|
|
|
e6: d0 e0 ldi r29, 0x00 ; 0
|
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
|
|
|
|
e8: 80 81 ld r24, Z
|
|
|
|
|
ea: 85 ff sbrs r24, 5
|
|
|
|
|
ec: fd cf rjmp .-6 ; 0xe8 <_ZN4UartILm9600EEC1Ev+0x2a>
|
|
|
|
|
UDR0 = c;
|
|
|
|
|
ee: 98 83 st Y, r25
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
|
|
|
|
}
|
|
|
|
|
void print(const char *text) {
|
|
|
|
|
while (*text)
|
|
|
|
|
f0: 9d 91 ld r25, X+
|
|
|
|
|
f2: 91 11 cpse r25, r1
|
|
|
|
|
f4: f9 cf rjmp .-14 ; 0xe8 <_ZN4UartILm9600EEC1Ev+0x2a>
|
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
|
|
|
|
f6: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
f8: f0 e0 ldi r31, 0x00 ; 0
|
|
|
|
|
fa: 80 81 ld r24, Z
|
|
|
|
|
fc: 85 ff sbrs r24, 5
|
|
|
|
|
fe: fd cf rjmp .-6 ; 0xfa <_ZN4UartILm9600EEC1Ev+0x3c>
|
|
|
|
|
UDR0 = c;
|
|
|
|
|
100: 8d e0 ldi r24, 0x0D ; 13
|
|
|
|
|
102: 80 93 c6 00 sts 0x00C6, r24
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
106: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
108: f0 e0 ldi r31, 0x00 ; 0
|
|
|
|
|
10a: 80 81 ld r24, Z
|
|
|
|
|
10c: 85 ff sbrs r24, 5
|
|
|
|
|
10e: fd cf rjmp .-6 ; 0x10a <_ZN4UartILm9600EEC1Ev+0x4c>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
110: 8a e0 ldi r24, 0x0A ; 10
|
|
|
|
|
112: 80 93 c6 00 sts 0x00C6, r24
|
|
|
|
|
public:
|
|
|
|
|
Uart() {
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
|
|
|
|
}
|
|
|
|
|
116: df 91 pop r29
|
|
|
|
|
118: cf 91 pop r28
|
|
|
|
|
11a: 08 95 ret
|
|
|
|
|
|
|
|
|
|
0000011c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh>:
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
}
|
|
|
|
|
void setcolor(uint8_t mask) {
|
|
|
|
|
(mask & (1<<0)) ? OCR2A=0xFF : OCR2A=0x00;
|
|
|
|
|
11c: 60 ff sbrs r22, 0
|
|
|
|
|
11e: 04 c0 rjmp .+8 ; 0x128 <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh+0xc>
|
|
|
|
|
120: 8f ef ldi r24, 0xFF ; 255
|
|
|
|
|
122: 80 93 b3 00 sts 0x00B3, r24
|
|
|
|
|
126: 02 c0 rjmp .+4 ; 0x12c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh+0x10>
|
|
|
|
|
128: 10 92 b3 00 sts 0x00B3, r1
|
|
|
|
|
(mask & (1<<1)) ? OCR2B=0xFF : OCR2B=0x00;
|
|
|
|
|
12c: 61 ff sbrs r22, 1
|
|
|
|
|
12e: 04 c0 rjmp .+8 ; 0x138 <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh+0x1c>
|
|
|
|
|
130: 8f ef ldi r24, 0xFF ; 255
|
|
|
|
|
132: 80 93 b4 00 sts 0x00B4, r24
|
|
|
|
|
136: 02 c0 rjmp .+4 ; 0x13c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh+0x20>
|
|
|
|
|
138: 10 92 b4 00 sts 0x00B4, r1
|
|
|
|
|
(mask & (1<<2)) ? OCR0B=0xFF : OCR0B=0x00;
|
|
|
|
|
13c: 62 ff sbrs r22, 2
|
|
|
|
|
13e: 03 c0 rjmp .+6 ; 0x146 <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh+0x2a>
|
|
|
|
|
140: 8f ef ldi r24, 0xFF ; 255
|
|
|
|
|
142: 88 bd out 0x28, r24 ; 40
|
|
|
|
|
144: 08 95 ret
|
|
|
|
|
146: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
148: 08 95 ret
|
|
|
|
|
|
|
|
|
|
0000014a <_ZN4UartILm9600EE7printlnEPKc>:
|
|
|
|
|
} else {
|
|
|
|
|
print("0");
|
|
|
|
|
}
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
void println(const char *text) {
|
|
|
|
|
14a: cf 93 push r28
|
|
|
|
|
14c: df 93 push r29
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
|
|
|
|
}
|
|
|
|
|
void print(const char *text) {
|
|
|
|
|
while (*text)
|
|
|
|
|
14e: fb 01 movw r30, r22
|
|
|
|
|
150: 90 81 ld r25, Z
|
|
|
|
|
152: 99 23 and r25, r25
|
|
|
|
|
154: 69 f0 breq .+26 ; 0x170 <_ZN4UartILm9600EE7printlnEPKc+0x26>
|
|
|
|
|
} else {
|
|
|
|
|
print("0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void println(const char *text) {
|
|
|
|
|
156: db 01 movw r26, r22
|
|
|
|
|
158: 11 96 adiw r26, 0x01 ; 1
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
15a: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
15c: f0 e0 ldi r31, 0x00 ; 0
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
15e: c6 ec ldi r28, 0xC6 ; 198
|
|
|
|
|
160: d0 e0 ldi r29, 0x00 ; 0
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
162: 80 81 ld r24, Z
|
|
|
|
|
164: 85 ff sbrs r24, 5
|
|
|
|
|
166: fd cf rjmp .-6 ; 0x162 <_ZN4UartILm9600EE7printlnEPKc+0x18>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
168: 98 83 st Y, r25
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
|
|
|
|
}
|
|
|
|
|
void print(const char *text) {
|
|
|
|
|
while (*text)
|
|
|
|
|
16a: 9d 91 ld r25, X+
|
|
|
|
|
16c: 91 11 cpse r25, r1
|
|
|
|
|
16e: f9 cf rjmp .-14 ; 0x162 <_ZN4UartILm9600EE7printlnEPKc+0x18>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
170: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
172: f0 e0 ldi r31, 0x00 ; 0
|
|
|
|
|
174: 80 81 ld r24, Z
|
|
|
|
|
176: 85 ff sbrs r24, 5
|
|
|
|
|
178: fd cf rjmp .-6 ; 0x174 <_ZN4UartILm9600EE7printlnEPKc+0x2a>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
17a: 8d e0 ldi r24, 0x0D ; 13
|
|
|
|
|
17c: 80 93 c6 00 sts 0x00C6, r24
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
180: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
182: f0 e0 ldi r31, 0x00 ; 0
|
|
|
|
|
184: 80 81 ld r24, Z
|
|
|
|
|
186: 85 ff sbrs r24, 5
|
|
|
|
|
188: fd cf rjmp .-6 ; 0x184 <_ZN4UartILm9600EE7printlnEPKc+0x3a>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
18a: 8a e0 ldi r24, 0x0A ; 10
|
|
|
|
|
18c: 80 93 c6 00 sts 0x00C6, r24
|
|
|
|
|
}
|
|
|
|
|
void println(const char *text) {
|
|
|
|
|
print(text);
|
|
|
|
|
print("\r");
|
|
|
|
|
print("\n");
|
|
|
|
|
}
|
|
|
|
|
190: df 91 pop r29
|
|
|
|
|
192: cf 91 pop r28
|
|
|
|
|
194: 08 95 ret
|
|
|
|
|
|
|
|
|
|
00000196 <main>:
|
|
|
|
|
compclass comp;
|
|
|
|
|
irclass ir;
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
sei();
|
|
|
|
|
196: 78 94 sei
|
|
|
|
|
stripe.setcolor(stripe.RED);
|
|
|
|
|
198: 64 e0 ldi r22, 0x04 ; 4
|
|
|
|
|
19a: 80 e7 ldi r24, 0x70 ; 112
|
|
|
|
|
19c: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
19e: 0e 94 8e 00 call 0x11c ; 0x11c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh>
|
|
|
|
|
Serial.println("Rot!");
|
|
|
|
|
1a2: 6b e0 ldi r22, 0x0B ; 11
|
|
|
|
|
1a4: 71 e0 ldi r23, 0x01 ; 1
|
|
|
|
|
1a6: 81 e7 ldi r24, 0x71 ; 113
|
|
|
|
|
1a8: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
1aa: 0e 94 a5 00 call 0x14a ; 0x14a <_ZN4UartILm9600EE7printlnEPKc>
|
|
|
|
|
#else
|
|
|
|
|
//round up by default
|
|
|
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
|
|
|
1ae: 2f e7 ldi r18, 0x7F ; 127
|
|
|
|
|
1b0: 3a e1 ldi r19, 0x1A ; 26
|
|
|
|
|
1b2: 86 e0 ldi r24, 0x06 ; 6
|
|
|
|
|
1b4: 21 50 subi r18, 0x01 ; 1
|
|
|
|
|
1b6: 30 40 sbci r19, 0x00 ; 0
|
|
|
|
|
1b8: 80 40 sbci r24, 0x00 ; 0
|
|
|
|
|
1ba: e1 f7 brne .-8 ; 0x1b4 <main+0x1e>
|
|
|
|
|
1bc: 00 c0 rjmp .+0 ; 0x1be <main+0x28>
|
|
|
|
|
1be: 00 00 nop
|
|
|
|
|
_delay_ms(100);
|
|
|
|
|
stripe.setcolor(stripe.GREEN);
|
|
|
|
|
1c0: 62 e0 ldi r22, 0x02 ; 2
|
|
|
|
|
1c2: 80 e7 ldi r24, 0x70 ; 112
|
|
|
|
|
1c4: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
1c6: 0e 94 8e 00 call 0x11c ; 0x11c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh>
|
|
|
|
|
Serial.println("Gr<47>n!");
|
|
|
|
|
1ca: 60 e1 ldi r22, 0x10 ; 16
|
|
|
|
|
1cc: 71 e0 ldi r23, 0x01 ; 1
|
|
|
|
|
1ce: 81 e7 ldi r24, 0x71 ; 113
|
|
|
|
|
1d0: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
1d2: 0e 94 a5 00 call 0x14a ; 0x14a <_ZN4UartILm9600EE7printlnEPKc>
|
|
|
|
|
1d6: 9f e7 ldi r25, 0x7F ; 127
|
|
|
|
|
1d8: aa e1 ldi r26, 0x1A ; 26
|
|
|
|
|
1da: b6 e0 ldi r27, 0x06 ; 6
|
|
|
|
|
1dc: 91 50 subi r25, 0x01 ; 1
|
|
|
|
|
1de: a0 40 sbci r26, 0x00 ; 0
|
|
|
|
|
1e0: b0 40 sbci r27, 0x00 ; 0
|
|
|
|
|
1e2: e1 f7 brne .-8 ; 0x1dc <main+0x46>
|
|
|
|
|
1e4: 00 c0 rjmp .+0 ; 0x1e6 <main+0x50>
|
|
|
|
|
1e6: 00 00 nop
|
|
|
|
|
_delay_ms(100);
|
|
|
|
|
stripe.setcolor(stripe.BLUE);
|
|
|
|
|
1e8: 61 e0 ldi r22, 0x01 ; 1
|
|
|
|
|
1ea: 80 e7 ldi r24, 0x70 ; 112
|
|
|
|
|
1ec: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
1ee: 0e 94 8e 00 call 0x11c ; 0x11c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh>
|
|
|
|
|
Serial.println("Blau!");
|
|
|
|
|
1f2: 66 e1 ldi r22, 0x16 ; 22
|
|
|
|
|
1f4: 71 e0 ldi r23, 0x01 ; 1
|
|
|
|
|
1f6: 81 e7 ldi r24, 0x71 ; 113
|
|
|
|
|
1f8: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
1fa: 0e 94 a5 00 call 0x14a ; 0x14a <_ZN4UartILm9600EE7printlnEPKc>
|
|
|
|
|
1fe: 2f e7 ldi r18, 0x7F ; 127
|
|
|
|
|
200: 3a e1 ldi r19, 0x1A ; 26
|
|
|
|
|
202: 86 e0 ldi r24, 0x06 ; 6
|
|
|
|
|
204: 21 50 subi r18, 0x01 ; 1
|
|
|
|
|
206: 30 40 sbci r19, 0x00 ; 0
|
|
|
|
|
208: 80 40 sbci r24, 0x00 ; 0
|
|
|
|
|
20a: e1 f7 brne .-8 ; 0x204 <main+0x6e>
|
|
|
|
|
20c: 00 c0 rjmp .+0 ; 0x20e <main+0x78>
|
|
|
|
|
20e: 00 00 nop
|
|
|
|
|
_delay_ms(100);
|
|
|
|
|
stripe.setcolor(stripe.WHITE);
|
|
|
|
|
210: 67 e0 ldi r22, 0x07 ; 7
|
|
|
|
|
212: 80 e7 ldi r24, 0x70 ; 112
|
|
|
|
|
214: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
216: 0e 94 8e 00 call 0x11c ; 0x11c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh>
|
|
|
|
|
Serial.println("Wei<65>, alles Initialisert! Habe Fertig und damit ab zum Normalbetrieb!");
|
|
|
|
|
21a: 6c e1 ldi r22, 0x1C ; 28
|
|
|
|
|
21c: 71 e0 ldi r23, 0x01 ; 1
|
|
|
|
|
21e: 81 e7 ldi r24, 0x71 ; 113
|
|
|
|
|
220: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
222: 0e 94 a5 00 call 0x14a ; 0x14a <_ZN4UartILm9600EE7printlnEPKc>
|
|
|
|
|
226: 9f e7 ldi r25, 0x7F ; 127
|
|
|
|
|
228: aa e1 ldi r26, 0x1A ; 26
|
|
|
|
|
22a: b6 e0 ldi r27, 0x06 ; 6
|
|
|
|
|
22c: 91 50 subi r25, 0x01 ; 1
|
|
|
|
|
22e: a0 40 sbci r26, 0x00 ; 0
|
|
|
|
|
230: b0 40 sbci r27, 0x00 ; 0
|
|
|
|
|
232: e1 f7 brne .-8 ; 0x22c <main+0x96>
|
|
|
|
|
234: 00 c0 rjmp .+0 ; 0x236 <main+0xa0>
|
|
|
|
|
236: 00 00 nop
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portb
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTB; }
|
|
|
|
|
static void port(uint8_t v) { PORTB = v; }
|
|
|
|
|
238: 29 9a sbi 0x05, 1 ; 5
|
|
|
|
|
_delay_ms(100);
|
|
|
|
|
led.green(1);
|
|
|
|
|
stripe.setcolor(stripe.BLACK);
|
|
|
|
|
23a: 60 e0 ldi r22, 0x00 ; 0
|
|
|
|
|
23c: 80 e7 ldi r24, 0x70 ; 112
|
|
|
|
|
23e: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
240: 0e 94 8e 00 call 0x11c ; 0x11c <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE8setcolorEh>
|
|
|
|
|
}
|
|
|
|
|
led.red(0);
|
|
|
|
|
EIFR |= (1<<INTF0);
|
|
|
|
|
}
|
|
|
|
|
uint8_t getCode() {
|
|
|
|
|
uint8_t ret = this->_code;
|
|
|
|
|
244: cd e6 ldi r28, 0x6D ; 109
|
|
|
|
|
246: d1 e0 ldi r29, 0x01 ; 1
|
|
|
|
|
this->_code = 255;
|
|
|
|
|
248: 66 24 eor r6, r6
|
|
|
|
|
24a: 6a 94 dec r6
|
|
|
|
|
24c: 76 2c mov r7, r6
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
24e: 0f 2e mov r0, r31
|
|
|
|
|
250: f4 eb ldi r31, 0xB4 ; 180
|
|
|
|
|
252: ef 2e mov r14, r31
|
|
|
|
|
254: f1 2c mov r15, r1
|
|
|
|
|
256: f0 2d mov r31, r0
|
|
|
|
|
258: 68 94 set
|
|
|
|
|
25a: 22 24 eor r2, r2
|
|
|
|
|
25c: 27 f8 bld r2, 7
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
25e: 03 eb ldi r16, 0xB3 ; 179
|
|
|
|
|
260: 10 e0 ldi r17, 0x00 ; 0
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
262: e0 ec ldi r30, 0xC0 ; 192
|
|
|
|
|
264: f0 e0 ldi r31, 0x00 ; 0
|
|
|
|
|
UDR0 = c;
|
|
|
|
|
266: 46 ec ldi r20, 0xC6 ; 198
|
|
|
|
|
268: 50 e0 ldi r21, 0x00 ; 0
|
|
|
|
|
26a: 0f 2e mov r0, r31
|
|
|
|
|
26c: fd e0 ldi r31, 0x0D ; 13
|
|
|
|
|
26e: 4f 2e mov r4, r31
|
|
|
|
|
270: f0 2d mov r31, r0
|
|
|
|
|
272: 0f 2e mov r0, r31
|
|
|
|
|
274: fa e0 ldi r31, 0x0A ; 10
|
|
|
|
|
276: 5f 2e mov r5, r31
|
|
|
|
|
278: f0 2d mov r31, r0
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
27a: 0f 2e mov r0, r31
|
|
|
|
|
27c: f0 ec ldi r31, 0xC0 ; 192
|
|
|
|
|
27e: 3f 2e mov r3, r31
|
|
|
|
|
280: f0 2d mov r31, r0
|
|
|
|
|
void timerOff() {
|
|
|
|
|
// OC0B output: Disconnected
|
|
|
|
|
// OC2A output: Disconnected
|
|
|
|
|
// OC2B output: Disconnected
|
|
|
|
|
TCCR0A &= ~(1<<COM0B1);
|
|
|
|
|
TCCR2A &= ~((1<<COM2A1) | (1<<COM2B1));
|
|
|
|
|
282: 0f 2e mov r0, r31
|
|
|
|
|
284: f0 eb ldi r31, 0xB0 ; 176
|
|
|
|
|
286: 8f 2e mov r8, r31
|
|
|
|
|
288: 91 2c mov r9, r1
|
|
|
|
|
28a: f0 2d mov r31, r0
|
|
|
|
|
}
|
|
|
|
|
led.red(0);
|
|
|
|
|
EIFR |= (1<<INTF0);
|
|
|
|
|
}
|
|
|
|
|
uint8_t getCode() {
|
|
|
|
|
uint8_t ret = this->_code;
|
|
|
|
|
28c: 88 81 ld r24, Y
|
|
|
|
|
this->_code = 255;
|
|
|
|
|
28e: 78 82 st Y, r7
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
uint8_t c = ir.getCode();
|
|
|
|
|
switch(c) {
|
|
|
|
|
290: 8c 30 cpi r24, 0x0C ; 12
|
|
|
|
|
292: 09 f4 brne .+2 ; 0x296 <main+0x100>
|
|
|
|
|
294: cf c0 rjmp .+414 ; 0x434 <main+0x29e>
|
|
|
|
|
296: 38 f5 brcc .+78 ; 0x2e6 <main+0x150>
|
|
|
|
|
298: 85 30 cpi r24, 0x05 ; 5
|
|
|
|
|
29a: 09 f4 brne .+2 ; 0x29e <main+0x108>
|
|
|
|
|
29c: a4 c0 rjmp .+328 ; 0x3e6 <main+0x250>
|
|
|
|
|
29e: 90 f4 brcc .+36 ; 0x2c4 <main+0x12e>
|
|
|
|
|
2a0: 82 30 cpi r24, 0x02 ; 2
|
|
|
|
|
2a2: 09 f4 brne .+2 ; 0x2a6 <main+0x110>
|
|
|
|
|
2a4: 84 c0 rjmp .+264 ; 0x3ae <main+0x218>
|
|
|
|
|
2a6: 38 f4 brcc .+14 ; 0x2b6 <main+0x120>
|
|
|
|
|
2a8: 88 23 and r24, r24
|
|
|
|
|
2aa: 09 f4 brne .+2 ; 0x2ae <main+0x118>
|
|
|
|
|
2ac: 46 c0 rjmp .+140 ; 0x33a <main+0x1a4>
|
|
|
|
|
2ae: 81 30 cpi r24, 0x01 ; 1
|
|
|
|
|
2b0: 09 f0 breq .+2 ; 0x2b4 <main+0x11e>
|
|
|
|
|
2b2: f6 c0 rjmp .+492 ; 0x4a0 <main+0x30a>
|
|
|
|
|
2b4: 5f c0 rjmp .+190 ; 0x374 <main+0x1de>
|
|
|
|
|
2b6: 83 30 cpi r24, 0x03 ; 3
|
|
|
|
|
2b8: 09 f4 brne .+2 ; 0x2bc <main+0x126>
|
|
|
|
|
2ba: 87 c0 rjmp .+270 ; 0x3ca <main+0x234>
|
|
|
|
|
2bc: 84 30 cpi r24, 0x04 ; 4
|
|
|
|
|
2be: 09 f0 breq .+2 ; 0x2c2 <main+0x12c>
|
|
|
|
|
2c0: ef c0 rjmp .+478 ; 0x4a0 <main+0x30a>
|
|
|
|
|
2c2: 8b c0 rjmp .+278 ; 0x3da <main+0x244>
|
|
|
|
|
2c4: 88 30 cpi r24, 0x08 ; 8
|
|
|
|
|
2c6: 09 f4 brne .+2 ; 0x2ca <main+0x134>
|
|
|
|
|
2c8: a0 c0 rjmp .+320 ; 0x40a <main+0x274>
|
|
|
|
|
2ca: 38 f4 brcc .+14 ; 0x2da <main+0x144>
|
|
|
|
|
2cc: 86 30 cpi r24, 0x06 ; 6
|
|
|
|
|
2ce: 09 f4 brne .+2 ; 0x2d2 <main+0x13c>
|
|
|
|
|
2d0: 90 c0 rjmp .+288 ; 0x3f2 <main+0x25c>
|
|
|
|
|
2d2: 87 30 cpi r24, 0x07 ; 7
|
|
|
|
|
2d4: 09 f0 breq .+2 ; 0x2d8 <main+0x142>
|
|
|
|
|
2d6: e4 c0 rjmp .+456 ; 0x4a0 <main+0x30a>
|
|
|
|
|
2d8: 92 c0 rjmp .+292 ; 0x3fe <main+0x268>
|
|
|
|
|
2da: 8a 30 cpi r24, 0x0A ; 10
|
|
|
|
|
2dc: 09 f4 brne .+2 ; 0x2e0 <main+0x14a>
|
|
|
|
|
2de: a3 c0 rjmp .+326 ; 0x426 <main+0x290>
|
|
|
|
|
2e0: 08 f0 brcs .+2 ; 0x2e4 <main+0x14e>
|
|
|
|
|
2e2: 75 c1 rjmp .+746 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
2e4: 99 c0 rjmp .+306 ; 0x418 <main+0x282>
|
|
|
|
|
2e6: 82 31 cpi r24, 0x12 ; 18
|
|
|
|
|
2e8: 09 f4 brne .+2 ; 0x2ec <main+0x156>
|
|
|
|
|
2ea: c2 c0 rjmp .+388 ; 0x470 <main+0x2da>
|
|
|
|
|
2ec: 90 f4 brcc .+36 ; 0x312 <main+0x17c>
|
|
|
|
|
2ee: 8f 30 cpi r24, 0x0F ; 15
|
|
|
|
|
2f0: 09 f4 brne .+2 ; 0x2f4 <main+0x15e>
|
|
|
|
|
2f2: 6d c1 rjmp .+730 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
2f4: 38 f4 brcc .+14 ; 0x304 <main+0x16e>
|
|
|
|
|
2f6: 8d 30 cpi r24, 0x0D ; 13
|
|
|
|
|
2f8: 09 f4 brne .+2 ; 0x2fc <main+0x166>
|
|
|
|
|
2fa: a2 c0 rjmp .+324 ; 0x440 <main+0x2aa>
|
|
|
|
|
2fc: 8e 30 cpi r24, 0x0E ; 14
|
|
|
|
|
2fe: 09 f0 breq .+2 ; 0x302 <main+0x16c>
|
|
|
|
|
300: cf c0 rjmp .+414 ; 0x4a0 <main+0x30a>
|
|
|
|
|
302: a4 c0 rjmp .+328 ; 0x44c <main+0x2b6>
|
|
|
|
|
304: 80 31 cpi r24, 0x10 ; 16
|
|
|
|
|
306: 09 f4 brne .+2 ; 0x30a <main+0x174>
|
|
|
|
|
308: a7 c0 rjmp .+334 ; 0x458 <main+0x2c2>
|
|
|
|
|
30a: 81 31 cpi r24, 0x11 ; 17
|
|
|
|
|
30c: 09 f0 breq .+2 ; 0x310 <main+0x17a>
|
|
|
|
|
30e: c8 c0 rjmp .+400 ; 0x4a0 <main+0x30a>
|
|
|
|
|
310: a9 c0 rjmp .+338 ; 0x464 <main+0x2ce>
|
|
|
|
|
312: 85 31 cpi r24, 0x15 ; 21
|
|
|
|
|
314: 09 f4 brne .+2 ; 0x318 <main+0x182>
|
|
|
|
|
316: b8 c0 rjmp .+368 ; 0x488 <main+0x2f2>
|
|
|
|
|
318: 38 f4 brcc .+14 ; 0x328 <main+0x192>
|
|
|
|
|
31a: 83 31 cpi r24, 0x13 ; 19
|
|
|
|
|
31c: 09 f4 brne .+2 ; 0x320 <main+0x18a>
|
|
|
|
|
31e: 57 c1 rjmp .+686 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
320: 84 31 cpi r24, 0x14 ; 20
|
|
|
|
|
322: 09 f0 breq .+2 ; 0x326 <main+0x190>
|
|
|
|
|
324: bd c0 rjmp .+378 ; 0x4a0 <main+0x30a>
|
|
|
|
|
326: aa c0 rjmp .+340 ; 0x47c <main+0x2e6>
|
|
|
|
|
328: 87 31 cpi r24, 0x17 ; 23
|
|
|
|
|
32a: 09 f4 brne .+2 ; 0x32e <main+0x198>
|
|
|
|
|
32c: 50 c1 rjmp .+672 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
32e: 08 f4 brcc .+2 ; 0x332 <main+0x19c>
|
|
|
|
|
330: b1 c0 rjmp .+354 ; 0x494 <main+0x2fe>
|
|
|
|
|
332: 8f 3f cpi r24, 0xFF ; 255
|
|
|
|
|
334: 09 f0 breq .+2 ; 0x338 <main+0x1a2>
|
|
|
|
|
336: b4 c0 rjmp .+360 ; 0x4a0 <main+0x30a>
|
|
|
|
|
338: 4a c1 rjmp .+660 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
} else {
|
|
|
|
|
OCR2A = 0;
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
void higher() {
|
|
|
|
|
if(OCR0B <= 250) {
|
|
|
|
|
33a: 88 b5 in r24, 0x28 ; 40
|
|
|
|
|
33c: 8b 3f cpi r24, 0xFB ; 251
|
|
|
|
|
33e: 20 f4 brcc .+8 ; 0x348 <main+0x1b2>
|
|
|
|
|
OCR0B = OCR0B + 5;
|
|
|
|
|
340: 88 b5 in r24, 0x28 ; 40
|
|
|
|
|
342: 8b 5f subi r24, 0xFB ; 251
|
|
|
|
|
344: 88 bd out 0x28, r24 ; 40
|
|
|
|
|
346: 01 c0 rjmp .+2 ; 0x34a <main+0x1b4>
|
|
|
|
|
} else {
|
|
|
|
|
OCR0B = 0;
|
|
|
|
|
348: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
}
|
|
|
|
|
if(OCR2B <= 250) {
|
|
|
|
|
34a: d7 01 movw r26, r14
|
|
|
|
|
34c: 8c 91 ld r24, X
|
|
|
|
|
34e: 8b 3f cpi r24, 0xFB ; 251
|
|
|
|
|
350: 20 f4 brcc .+8 ; 0x35a <main+0x1c4>
|
|
|
|
|
OCR2B = OCR2B + 5;
|
|
|
|
|
352: 8c 91 ld r24, X
|
|
|
|
|
354: 8b 5f subi r24, 0xFB ; 251
|
|
|
|
|
356: 8c 93 st X, r24
|
|
|
|
|
358: 02 c0 rjmp .+4 ; 0x35e <main+0x1c8>
|
|
|
|
|
} else {
|
|
|
|
|
OCR2B = 0;
|
|
|
|
|
35a: d7 01 movw r26, r14
|
|
|
|
|
35c: 1c 92 st X, r1
|
|
|
|
|
}
|
|
|
|
|
if(OCR2A <= 250) {
|
|
|
|
|
35e: d8 01 movw r26, r16
|
|
|
|
|
360: 8c 91 ld r24, X
|
|
|
|
|
362: 8b 3f cpi r24, 0xFB ; 251
|
|
|
|
|
364: 20 f4 brcc .+8 ; 0x36e <main+0x1d8>
|
|
|
|
|
OCR2A = OCR2A + 5;
|
|
|
|
|
366: 8c 91 ld r24, X
|
|
|
|
|
368: 8b 5f subi r24, 0xFB ; 251
|
|
|
|
|
36a: 8c 93 st X, r24
|
|
|
|
|
36c: 30 c1 rjmp .+608 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
} else {
|
|
|
|
|
OCR2A = 0;
|
|
|
|
|
36e: d8 01 movw r26, r16
|
|
|
|
|
370: 1c 92 st X, r1
|
|
|
|
|
372: 2d c1 rjmp .+602 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
}
|
|
|
|
|
void on() {
|
|
|
|
|
this->timerOn();
|
|
|
|
|
}
|
|
|
|
|
void lower() {
|
|
|
|
|
if(OCR0B >= 5) {
|
|
|
|
|
374: 88 b5 in r24, 0x28 ; 40
|
|
|
|
|
376: 85 30 cpi r24, 0x05 ; 5
|
|
|
|
|
378: 20 f0 brcs .+8 ; 0x382 <main+0x1ec>
|
|
|
|
|
OCR0B = OCR0B - 5;
|
|
|
|
|
37a: 88 b5 in r24, 0x28 ; 40
|
|
|
|
|
37c: 85 50 subi r24, 0x05 ; 5
|
|
|
|
|
37e: 88 bd out 0x28, r24 ; 40
|
|
|
|
|
380: 01 c0 rjmp .+2 ; 0x384 <main+0x1ee>
|
|
|
|
|
} else {
|
|
|
|
|
OCR0B = 0;
|
|
|
|
|
382: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
}
|
|
|
|
|
if(OCR2B >= 5) {
|
|
|
|
|
384: d7 01 movw r26, r14
|
|
|
|
|
386: 8c 91 ld r24, X
|
|
|
|
|
388: 85 30 cpi r24, 0x05 ; 5
|
|
|
|
|
38a: 20 f0 brcs .+8 ; 0x394 <main+0x1fe>
|
|
|
|
|
OCR2B = OCR2B - 5;
|
|
|
|
|
38c: 8c 91 ld r24, X
|
|
|
|
|
38e: 85 50 subi r24, 0x05 ; 5
|
|
|
|
|
390: 8c 93 st X, r24
|
|
|
|
|
392: 02 c0 rjmp .+4 ; 0x398 <main+0x202>
|
|
|
|
|
} else {
|
|
|
|
|
OCR2B = 0;
|
|
|
|
|
394: d7 01 movw r26, r14
|
|
|
|
|
396: 1c 92 st X, r1
|
|
|
|
|
}
|
|
|
|
|
if(OCR2A >= 5) {
|
|
|
|
|
398: d8 01 movw r26, r16
|
|
|
|
|
39a: 8c 91 ld r24, X
|
|
|
|
|
39c: 85 30 cpi r24, 0x05 ; 5
|
|
|
|
|
39e: 20 f0 brcs .+8 ; 0x3a8 <main+0x212>
|
|
|
|
|
OCR2A = OCR2A - 5;
|
|
|
|
|
3a0: 8c 91 ld r24, X
|
|
|
|
|
3a2: 85 50 subi r24, 0x05 ; 5
|
|
|
|
|
3a4: 8c 93 st X, r24
|
|
|
|
|
3a6: 13 c1 rjmp .+550 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
} else {
|
|
|
|
|
OCR2A = 0;
|
|
|
|
|
3a8: d8 01 movw r26, r16
|
|
|
|
|
3aa: 1c 92 st X, r1
|
|
|
|
|
3ac: 10 c1 rjmp .+544 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
}
|
|
|
|
|
void timerOff() {
|
|
|
|
|
// OC0B output: Disconnected
|
|
|
|
|
// OC2A output: Disconnected
|
|
|
|
|
// OC2B output: Disconnected
|
|
|
|
|
TCCR0A &= ~(1<<COM0B1);
|
|
|
|
|
3ae: 84 b5 in r24, 0x24 ; 36
|
|
|
|
|
3b0: 8f 7d andi r24, 0xDF ; 223
|
|
|
|
|
3b2: 84 bd out 0x24, r24 ; 36
|
|
|
|
|
TCCR2A &= ~((1<<COM2A1) | (1<<COM2B1));
|
|
|
|
|
3b4: d4 01 movw r26, r8
|
|
|
|
|
3b6: 8c 91 ld r24, X
|
|
|
|
|
3b8: 8f 75 andi r24, 0x5F ; 95
|
|
|
|
|
3ba: 8c 93 st X, r24
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portd
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTD; }
|
|
|
|
|
static void port(uint8_t v) { PORTD = v; }
|
|
|
|
|
3bc: 5d 98 cbi 0x0b, 5 ; 11
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PIND; }
|
|
|
|
|
static void pin(uint8_t v) { PIND = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRD; }
|
|
|
|
|
static void dir(uint8_t v) { DDRD = v; }
|
|
|
|
|
3be: 55 9a sbi 0x0a, 5 ; 10
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portd
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTD; }
|
|
|
|
|
static void port(uint8_t v) { PORTD = v; }
|
|
|
|
|
3c0: 5b 98 cbi 0x0b, 3 ; 11
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PIND; }
|
|
|
|
|
static void pin(uint8_t v) { PIND = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRD; }
|
|
|
|
|
static void dir(uint8_t v) { DDRD = v; }
|
|
|
|
|
3c2: 53 9a sbi 0x0a, 3 ; 10
|
|
|
|
|
3c4: 2b 98 cbi 0x05, 3 ; 5
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PINB; }
|
|
|
|
|
static void pin(uint8_t v) { PINB = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRB; }
|
|
|
|
|
static void dir(uint8_t v) { DDRB = v; }
|
|
|
|
|
3c6: 23 9a sbi 0x04, 3 ; 4
|
|
|
|
|
3c8: 02 c1 rjmp .+516 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
}
|
|
|
|
|
void timerOn() {
|
|
|
|
|
// OC0B output: Non-Inverted PWM
|
|
|
|
|
// OC2A output: Non-Inverted PWM
|
|
|
|
|
// OC2B output: Non-Inverted PWM
|
|
|
|
|
TCCR0A |= (1<<COM0B1);
|
|
|
|
|
3ca: 84 b5 in r24, 0x24 ; 36
|
|
|
|
|
3cc: 80 62 ori r24, 0x20 ; 32
|
|
|
|
|
3ce: 84 bd out 0x24, r24 ; 36
|
|
|
|
|
TCCR2A |= (1<<COM2A1) | (1<<COM2B1);
|
|
|
|
|
3d0: d4 01 movw r26, r8
|
|
|
|
|
3d2: 8c 91 ld r24, X
|
|
|
|
|
3d4: 80 6a ori r24, 0xA0 ; 160
|
|
|
|
|
3d6: 8c 93 st X, r24
|
|
|
|
|
3d8: fa c0 rjmp .+500 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
}
|
|
|
|
|
void setcolor(uint8_t mask) {
|
|
|
|
|
(mask & (1<<0)) ? OCR2A=0xFF : OCR2A=0x00;
|
|
|
|
|
3da: d8 01 movw r26, r16
|
|
|
|
|
3dc: 1c 92 st X, r1
|
|
|
|
|
(mask & (1<<1)) ? OCR2B=0xFF : OCR2B=0x00;
|
|
|
|
|
3de: d7 01 movw r26, r14
|
|
|
|
|
3e0: 1c 92 st X, r1
|
|
|
|
|
(mask & (1<<2)) ? OCR0B=0xFF : OCR0B=0x00;
|
|
|
|
|
3e2: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
3e4: f4 c0 rjmp .+488 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
}
|
|
|
|
|
void setcolor(uint8_t mask) {
|
|
|
|
|
(mask & (1<<0)) ? OCR2A=0xFF : OCR2A=0x00;
|
|
|
|
|
3e6: d8 01 movw r26, r16
|
|
|
|
|
3e8: 1c 92 st X, r1
|
|
|
|
|
(mask & (1<<1)) ? OCR2B=0xFF : OCR2B=0x00;
|
|
|
|
|
3ea: d7 01 movw r26, r14
|
|
|
|
|
3ec: 6c 92 st X, r6
|
|
|
|
|
(mask & (1<<2)) ? OCR0B=0xFF : OCR0B=0x00;
|
|
|
|
|
3ee: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
3f0: ee c0 rjmp .+476 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
}
|
|
|
|
|
void setcolor(uint8_t mask) {
|
|
|
|
|
(mask & (1<<0)) ? OCR2A=0xFF : OCR2A=0x00;
|
|
|
|
|
3f2: d8 01 movw r26, r16
|
|
|
|
|
3f4: 6c 92 st X, r6
|
|
|
|
|
(mask & (1<<1)) ? OCR2B=0xFF : OCR2B=0x00;
|
|
|
|
|
3f6: d7 01 movw r26, r14
|
|
|
|
|
3f8: 1c 92 st X, r1
|
|
|
|
|
(mask & (1<<2)) ? OCR0B=0xFF : OCR0B=0x00;
|
|
|
|
|
3fa: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
3fc: e8 c0 rjmp .+464 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
}
|
|
|
|
|
void setcolor(uint8_t mask) {
|
|
|
|
|
(mask & (1<<0)) ? OCR2A=0xFF : OCR2A=0x00;
|
|
|
|
|
3fe: d8 01 movw r26, r16
|
|
|
|
|
400: 6c 92 st X, r6
|
|
|
|
|
(mask & (1<<1)) ? OCR2B=0xFF : OCR2B=0x00;
|
|
|
|
|
402: d7 01 movw r26, r14
|
|
|
|
|
404: 6c 92 st X, r6
|
|
|
|
|
(mask & (1<<2)) ? OCR0B=0xFF : OCR0B=0x00;
|
|
|
|
|
406: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
408: e2 c0 rjmp .+452 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
40a: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
40c: 20 e4 ldi r18, 0x40 ; 64
|
|
|
|
|
40e: d7 01 movw r26, r14
|
|
|
|
|
410: 2c 93 st X, r18
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
412: d8 01 movw r26, r16
|
|
|
|
|
414: 1c 92 st X, r1
|
|
|
|
|
416: db c0 rjmp .+438 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
418: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
41a: d7 01 movw r26, r14
|
|
|
|
|
41c: 6c 92 st X, r6
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
41e: 20 e4 ldi r18, 0x40 ; 64
|
|
|
|
|
420: d8 01 movw r26, r16
|
|
|
|
|
422: 2c 93 st X, r18
|
|
|
|
|
424: d4 c0 rjmp .+424 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
426: 30 e4 ldi r19, 0x40 ; 64
|
|
|
|
|
428: 38 bd out 0x28, r19 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
42a: d7 01 movw r26, r14
|
|
|
|
|
42c: 1c 92 st X, r1
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
42e: d8 01 movw r26, r16
|
|
|
|
|
430: 6c 92 st X, r6
|
|
|
|
|
432: cd c0 rjmp .+410 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
434: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
436: d7 01 movw r26, r14
|
|
|
|
|
438: 2c 92 st X, r2
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
43a: d8 01 movw r26, r16
|
|
|
|
|
43c: 1c 92 st X, r1
|
|
|
|
|
43e: c7 c0 rjmp .+398 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
440: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
442: d7 01 movw r26, r14
|
|
|
|
|
444: 6c 92 st X, r6
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
446: d8 01 movw r26, r16
|
|
|
|
|
448: 2c 92 st X, r2
|
|
|
|
|
44a: c1 c0 rjmp .+386 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
44c: 28 bc out 0x28, r2 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
44e: d7 01 movw r26, r14
|
|
|
|
|
450: 1c 92 st X, r1
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
452: d8 01 movw r26, r16
|
|
|
|
|
454: 6c 92 st X, r6
|
|
|
|
|
456: bb c0 rjmp .+374 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
458: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
45a: d7 01 movw r26, r14
|
|
|
|
|
45c: 3c 92 st X, r3
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
45e: d8 01 movw r26, r16
|
|
|
|
|
460: 1c 92 st X, r1
|
|
|
|
|
462: b5 c0 rjmp .+362 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
464: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
466: d7 01 movw r26, r14
|
|
|
|
|
468: 6c 92 st X, r6
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
46a: d8 01 movw r26, r16
|
|
|
|
|
46c: 3c 92 st X, r3
|
|
|
|
|
46e: af c0 rjmp .+350 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
470: 38 bc out 0x28, r3 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
472: d7 01 movw r26, r14
|
|
|
|
|
474: 1c 92 st X, r1
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
476: d8 01 movw r26, r16
|
|
|
|
|
478: 6c 92 st X, r6
|
|
|
|
|
47a: a9 c0 rjmp .+338 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
47c: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
47e: d7 01 movw r26, r14
|
|
|
|
|
480: 6c 92 st X, r6
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
482: d8 01 movw r26, r16
|
|
|
|
|
484: 1c 92 st X, r1
|
|
|
|
|
486: a3 c0 rjmp .+326 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
488: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
48a: d7 01 movw r26, r14
|
|
|
|
|
48c: 6c 92 st X, r6
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
48e: d8 01 movw r26, r16
|
|
|
|
|
490: 6c 92 st X, r6
|
|
|
|
|
492: 9d c0 rjmp .+314 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
494: 68 bc out 0x28, r6 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
496: d7 01 movw r26, r14
|
|
|
|
|
498: 1c 92 st X, r1
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
49a: d8 01 movw r26, r16
|
|
|
|
|
49c: 6c 92 st X, r6
|
|
|
|
|
49e: 97 c0 rjmp .+302 ; 0x5ce <__stack+0xcf>
|
|
|
|
|
case 19: break; //Button FADE
|
|
|
|
|
case 20: stripe.color(0xFF,0xFF,0x00); break; //Color Red 100 % + Green 100 %
|
|
|
|
|
case 21: stripe.color(0x00,0xFF,0xFF); break; //Color Green 100 % + Blue 100 %
|
|
|
|
|
case 22: stripe.color(0xFF,0x00,0xFF); break; //Color Blue 100 % + Red 100 %
|
|
|
|
|
case 23: break; //Button SMOOTH
|
|
|
|
|
default: Serial.printDec(c); Serial.println(" Pressed!"); break; //Code den ich nicht kenne
|
|
|
|
|
4a0: c8 2e mov r12, r24
|
|
|
|
|
4a2: d1 2c mov r13, r1
|
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
2015-02-07 18:10:00 +01:00
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4a4: 80 81 ld r24, Z
|
|
|
|
|
4a6: 85 ff sbrs r24, 5
|
|
|
|
|
4a8: fd cf rjmp .-6 ; 0x4a4 <main+0x30e>
|
2015-02-07 18:10:00 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4aa: 80 e3 ldi r24, 0x30 ; 48
|
|
|
|
|
4ac: da 01 movw r26, r20
|
|
|
|
|
4ae: 8c 93 st X, r24
|
2015-02-07 18:10:00 +01:00
|
|
|
|
text++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void printDec(uint16_t wert) {
|
|
|
|
|
print((wert/10000)+'0');
|
2014-11-19 23:57:35 +01:00
|
|
|
|
print(((wert/1000)%10)+'0');
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4b0: 60 e0 ldi r22, 0x00 ; 0
|
|
|
|
|
4b2: 70 e0 ldi r23, 0x00 ; 0
|
|
|
|
|
4b4: cb 01 movw r24, r22
|
|
|
|
|
4b6: 96 95 lsr r25
|
|
|
|
|
4b8: 87 95 ror r24
|
|
|
|
|
4ba: 96 95 lsr r25
|
|
|
|
|
4bc: 87 95 ror r24
|
|
|
|
|
4be: 96 95 lsr r25
|
|
|
|
|
4c0: 87 95 ror r24
|
|
|
|
|
4c2: 9c 01 movw r18, r24
|
|
|
|
|
4c4: 22 0f add r18, r18
|
|
|
|
|
4c6: 33 1f adc r19, r19
|
|
|
|
|
4c8: 88 0f add r24, r24
|
|
|
|
|
4ca: 99 1f adc r25, r25
|
|
|
|
|
4cc: 88 0f add r24, r24
|
|
|
|
|
4ce: 99 1f adc r25, r25
|
|
|
|
|
4d0: 88 0f add r24, r24
|
|
|
|
|
4d2: 99 1f adc r25, r25
|
|
|
|
|
4d4: 82 0f add r24, r18
|
|
|
|
|
4d6: 93 1f adc r25, r19
|
|
|
|
|
4d8: 68 1b sub r22, r24
|
|
|
|
|
4da: 79 0b sbc r23, r25
|
|
|
|
|
4dc: 60 5d subi r22, 0xD0 ; 208
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4de: 80 81 ld r24, Z
|
|
|
|
|
4e0: 85 ff sbrs r24, 5
|
|
|
|
|
4e2: fd cf rjmp .-6 ; 0x4de <main+0x348>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4e4: da 01 movw r26, r20
|
|
|
|
|
4e6: 6c 93 st X, r22
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void printDec(uint16_t wert) {
|
|
|
|
|
print((wert/10000)+'0');
|
|
|
|
|
print(((wert/1000)%10)+'0');
|
|
|
|
|
print(((wert/100)%10)+'0');
|
2015-02-08 00:22:32 +01:00
|
|
|
|
4e8: 96 01 movw r18, r12
|
|
|
|
|
4ea: 36 95 lsr r19
|
|
|
|
|
4ec: 27 95 ror r18
|
|
|
|
|
4ee: 36 95 lsr r19
|
|
|
|
|
4f0: 27 95 ror r18
|
|
|
|
|
4f2: ab e7 ldi r26, 0x7B ; 123
|
|
|
|
|
4f4: b4 e1 ldi r27, 0x14 ; 20
|
|
|
|
|
4f6: 0e 94 27 04 call 0x84e ; 0x84e <__umulhisi3>
|
|
|
|
|
4fa: 96 95 lsr r25
|
|
|
|
|
4fc: 87 95 ror r24
|
|
|
|
|
4fe: 80 5d subi r24, 0xD0 ; 208
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
500: 90 81 ld r25, Z
|
|
|
|
|
502: 95 ff sbrs r25, 5
|
|
|
|
|
504: fd cf rjmp .-6 ; 0x500 <__stack+0x1>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
506: da 01 movw r26, r20
|
|
|
|
|
508: 8c 93 st X, r24
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
|
|
|
|
void printDec(uint16_t wert) {
|
|
|
|
|
print((wert/10000)+'0');
|
|
|
|
|
print(((wert/1000)%10)+'0');
|
|
|
|
|
print(((wert/100)%10)+'0');
|
|
|
|
|
print(((wert/10)%10)+'0');
|
2015-02-08 00:22:32 +01:00
|
|
|
|
50a: 96 01 movw r18, r12
|
|
|
|
|
50c: ad ec ldi r26, 0xCD ; 205
|
|
|
|
|
50e: bc ec ldi r27, 0xCC ; 204
|
|
|
|
|
510: 0e 94 27 04 call 0x84e ; 0x84e <__umulhisi3>
|
|
|
|
|
514: 5c 01 movw r10, r24
|
|
|
|
|
516: b6 94 lsr r11
|
|
|
|
|
518: a7 94 ror r10
|
|
|
|
|
51a: b6 94 lsr r11
|
|
|
|
|
51c: a7 94 ror r10
|
|
|
|
|
51e: b6 94 lsr r11
|
|
|
|
|
520: a7 94 ror r10
|
|
|
|
|
522: 95 01 movw r18, r10
|
|
|
|
|
524: 0e 94 27 04 call 0x84e ; 0x84e <__umulhisi3>
|
|
|
|
|
528: 96 95 lsr r25
|
|
|
|
|
52a: 87 95 ror r24
|
|
|
|
|
52c: 96 95 lsr r25
|
|
|
|
|
52e: 87 95 ror r24
|
|
|
|
|
530: 96 95 lsr r25
|
|
|
|
|
532: 87 95 ror r24
|
|
|
|
|
534: 9c 01 movw r18, r24
|
|
|
|
|
536: 22 0f add r18, r18
|
|
|
|
|
538: 33 1f adc r19, r19
|
|
|
|
|
53a: 88 0f add r24, r24
|
|
|
|
|
53c: 99 1f adc r25, r25
|
|
|
|
|
53e: 88 0f add r24, r24
|
|
|
|
|
540: 99 1f adc r25, r25
|
|
|
|
|
542: 88 0f add r24, r24
|
|
|
|
|
544: 99 1f adc r25, r25
|
|
|
|
|
546: 82 0f add r24, r18
|
|
|
|
|
548: 93 1f adc r25, r19
|
|
|
|
|
54a: 95 01 movw r18, r10
|
|
|
|
|
54c: 28 1b sub r18, r24
|
|
|
|
|
54e: 39 0b sbc r19, r25
|
|
|
|
|
550: 92 2f mov r25, r18
|
|
|
|
|
552: 90 5d subi r25, 0xD0 ; 208
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
554: 80 81 ld r24, Z
|
|
|
|
|
556: 85 ff sbrs r24, 5
|
|
|
|
|
558: fd cf rjmp .-6 ; 0x554 <__stack+0x55>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
55a: da 01 movw r26, r20
|
|
|
|
|
55c: 9c 93 st X, r25
|
2014-11-19 23:57:35 +01:00
|
|
|
|
void printDec(uint16_t wert) {
|
|
|
|
|
print((wert/10000)+'0');
|
|
|
|
|
print(((wert/1000)%10)+'0');
|
|
|
|
|
print(((wert/100)%10)+'0');
|
|
|
|
|
print(((wert/10)%10)+'0');
|
|
|
|
|
print((wert%10)+'0');
|
2015-02-08 00:22:32 +01:00
|
|
|
|
55e: 96 01 movw r18, r12
|
|
|
|
|
560: ad ec ldi r26, 0xCD ; 205
|
|
|
|
|
562: bc ec ldi r27, 0xCC ; 204
|
|
|
|
|
564: 0e 94 27 04 call 0x84e ; 0x84e <__umulhisi3>
|
|
|
|
|
568: 96 95 lsr r25
|
|
|
|
|
56a: 87 95 ror r24
|
|
|
|
|
56c: 96 95 lsr r25
|
|
|
|
|
56e: 87 95 ror r24
|
|
|
|
|
570: 96 95 lsr r25
|
|
|
|
|
572: 87 95 ror r24
|
|
|
|
|
574: 9c 01 movw r18, r24
|
|
|
|
|
576: 22 0f add r18, r18
|
|
|
|
|
578: 33 1f adc r19, r19
|
|
|
|
|
57a: 88 0f add r24, r24
|
|
|
|
|
57c: 99 1f adc r25, r25
|
|
|
|
|
57e: 88 0f add r24, r24
|
|
|
|
|
580: 99 1f adc r25, r25
|
|
|
|
|
582: 88 0f add r24, r24
|
|
|
|
|
584: 99 1f adc r25, r25
|
|
|
|
|
586: 82 0f add r24, r18
|
|
|
|
|
588: 93 1f adc r25, r19
|
|
|
|
|
58a: 96 01 movw r18, r12
|
|
|
|
|
58c: 28 1b sub r18, r24
|
|
|
|
|
58e: 39 0b sbc r19, r25
|
|
|
|
|
590: 92 2f mov r25, r18
|
|
|
|
|
592: 90 5d subi r25, 0xD0 ; 208
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
594: 80 81 ld r24, Z
|
|
|
|
|
596: 85 ff sbrs r24, 5
|
|
|
|
|
598: fd cf rjmp .-6 ; 0x594 <__stack+0x95>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
59a: da 01 movw r26, r20
|
|
|
|
|
59c: 9c 93 st X, r25
|
|
|
|
|
59e: a3 e6 ldi r26, 0x63 ; 99
|
|
|
|
|
5a0: b1 e0 ldi r27, 0x01 ; 1
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
void print(const char *text) {
|
|
|
|
|
while (*text)
|
|
|
|
|
5a2: 90 e2 ldi r25, 0x20 ; 32
|
|
|
|
|
5a4: 9d 01 movw r18, r26
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5a6: 80 81 ld r24, Z
|
|
|
|
|
5a8: 85 ff sbrs r24, 5
|
|
|
|
|
5aa: fd cf rjmp .-6 ; 0x5a6 <__stack+0xa7>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5ac: da 01 movw r26, r20
|
|
|
|
|
5ae: 9c 93 st X, r25
|
|
|
|
|
sei();
|
|
|
|
|
init();
|
|
|
|
|
println("Uart done!");
|
|
|
|
|
}
|
|
|
|
|
void print(const char *text) {
|
|
|
|
|
while (*text)
|
|
|
|
|
5b0: d9 01 movw r26, r18
|
|
|
|
|
5b2: 9d 91 ld r25, X+
|
|
|
|
|
5b4: 9d 01 movw r18, r26
|
|
|
|
|
5b6: 91 11 cpse r25, r1
|
|
|
|
|
5b8: f6 cf rjmp .-20 ; 0x5a6 <__stack+0xa7>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5ba: 80 81 ld r24, Z
|
|
|
|
|
5bc: 85 ff sbrs r24, 5
|
|
|
|
|
5be: fd cf rjmp .-6 ; 0x5ba <__stack+0xbb>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5c0: da 01 movw r26, r20
|
|
|
|
|
5c2: 4c 92 st X, r4
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UCSR0A= (0<<RXC0) | (0<<TXC0) | (0<<UDRE0) | (0<<FE0) | (0<<DOR0) | (0<<UPE0) | (0<<U2X0) | (0<<MPCM0);
|
|
|
|
|
UCSR0B= (0<<RXCIE0) | (0<<TXCIE0) | (0<<UDRIE0) | (0<<RXEN0) | (1<<TXEN0) | (0<<UCSZ02) | (0<<RXB80) | (0<<TXB80); //Enable TXEN im Register UCR TX-Data Enable
|
|
|
|
|
UCSR0C= (0<<UMSEL01) | (0<<UMSEL00) | (0<<UPM01) | (0<<UPM00) | (0<<USBS0) | (1<<UCSZ01) | (1<<UCSZ00) | (0<<UCPOL0); //8N1
|
|
|
|
|
}
|
|
|
|
|
uint8_t uart_putchar(uint8_t c) {
|
|
|
|
|
loop_until_bit_is_set(UCSR0A, UDRE0); //Ausgabe des Zeichens
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5c4: 80 81 ld r24, Z
|
|
|
|
|
5c6: 85 ff sbrs r24, 5
|
|
|
|
|
5c8: fd cf rjmp .-6 ; 0x5c4 <__stack+0xc5>
|
2014-11-19 23:57:35 +01:00
|
|
|
|
UDR0 = c;
|
2015-02-08 00:22:32 +01:00
|
|
|
|
5ca: da 01 movw r26, r20
|
|
|
|
|
5cc: 5c 92 st X, r5
|
|
|
|
|
5ce: 87 e8 ldi r24, 0x87 ; 135
|
|
|
|
|
5d0: 93 e1 ldi r25, 0x13 ; 19
|
|
|
|
|
5d2: 01 97 sbiw r24, 0x01 ; 1
|
|
|
|
|
5d4: f1 f7 brne .-4 ; 0x5d2 <__stack+0xd3>
|
|
|
|
|
5d6: 00 c0 rjmp .+0 ; 0x5d8 <__stack+0xd9>
|
|
|
|
|
5d8: 00 00 nop
|
|
|
|
|
namespace avrlib {
|
2014-11-19 23:57:35 +01:00
|
|
|
|
|
2015-02-08 00:22:32 +01:00
|
|
|
|
struct portb
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTB; }
|
|
|
|
|
static void port(uint8_t v) { PORTB = v; }
|
|
|
|
|
5da: 29 98 cbi 0x05, 1 ; 5
|
|
|
|
|
5dc: 9f ed ldi r25, 0xDF ; 223
|
|
|
|
|
5de: aa e0 ldi r26, 0x0A ; 10
|
|
|
|
|
5e0: b6 e0 ldi r27, 0x06 ; 6
|
|
|
|
|
5e2: 91 50 subi r25, 0x01 ; 1
|
|
|
|
|
5e4: a0 40 sbci r26, 0x00 ; 0
|
|
|
|
|
5e6: b0 40 sbci r27, 0x00 ; 0
|
|
|
|
|
5e8: e1 f7 brne .-8 ; 0x5e2 <__stack+0xe3>
|
|
|
|
|
5ea: 00 c0 rjmp .+0 ; 0x5ec <__stack+0xed>
|
|
|
|
|
5ec: 00 00 nop
|
|
|
|
|
5ee: 29 9a sbi 0x05, 1 ; 5
|
|
|
|
|
5f0: 4d ce rjmp .-870 ; 0x28c <main+0xf6>
|
|
|
|
|
|
|
|
|
|
000005f2 <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE4initEv>:
|
|
|
|
|
5f2: 55 9a sbi 0x0a, 5 ; 10
|
|
|
|
|
5f4: 53 9a sbi 0x0a, 3 ; 10
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PINB; }
|
|
|
|
|
static void pin(uint8_t v) { PINB = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRB; }
|
|
|
|
|
static void dir(uint8_t v) { DDRB = v; }
|
|
|
|
|
5f6: 23 9a sbi 0x04, 3 ; 4
|
|
|
|
|
// Mode: Phase correct PWM top=0xFF
|
|
|
|
|
// OC0A output: Disconnected
|
|
|
|
|
// Timer Period: 0,06375 ms
|
|
|
|
|
// Output Pulse(s):
|
|
|
|
|
// OC0B Period: 0,06375 ms Width: 0 us
|
|
|
|
|
TCCR0A=(0<<COM0A1) | (0<<COM0A0) | (0<<COM0B0) | (0<<WGM01) | (1<<WGM00);
|
|
|
|
|
5f8: 81 e0 ldi r24, 0x01 ; 1
|
|
|
|
|
5fa: 84 bd out 0x24, r24 ; 36
|
|
|
|
|
TCCR0B=(0<<WGM02) | (1<<CS02) | (0<<CS01) | (0<<CS00);
|
|
|
|
|
5fc: 94 e0 ldi r25, 0x04 ; 4
|
|
|
|
|
5fe: 95 bd out 0x25, r25 ; 37
|
|
|
|
|
TCNT0=0x00;
|
|
|
|
|
600: 16 bc out 0x26, r1 ; 38
|
|
|
|
|
// Mode: Phase correct PWM top=0xFF
|
|
|
|
|
// Timer Period: 0,06375 ms
|
|
|
|
|
// Output Pulse(s):
|
|
|
|
|
// OC2A Period: 0,06375 ms Width: 0 us
|
|
|
|
|
// OC2B Period: 0,06375 ms Width: 0 us
|
|
|
|
|
ASSR=(0<<EXCLK) | (0<<AS2);
|
|
|
|
|
602: 10 92 b6 00 sts 0x00B6, r1
|
|
|
|
|
TCCR2A=(0<<COM2A0) | (0<<COM2B0) | (0<<WGM21) | (1<<WGM20);
|
|
|
|
|
606: e0 eb ldi r30, 0xB0 ; 176
|
|
|
|
|
608: f0 e0 ldi r31, 0x00 ; 0
|
|
|
|
|
60a: 80 83 st Z, r24
|
|
|
|
|
TCCR2B=(0<<WGM22) | (1<<CS22) | (0<<CS21) | (1<<CS20);
|
|
|
|
|
60c: 85 e0 ldi r24, 0x05 ; 5
|
|
|
|
|
60e: 80 93 b1 00 sts 0x00B1, r24
|
|
|
|
|
TCNT2=0x00;
|
|
|
|
|
612: 10 92 b2 00 sts 0x00B2, r1
|
|
|
|
|
// Timer/Counter 0 Interrupt(s) initialization
|
|
|
|
|
TIMSK0=(0<<OCIE0B) | (0<<OCIE0A) | (0<<TOIE0);
|
|
|
|
|
616: 10 92 6e 00 sts 0x006E, r1
|
|
|
|
|
// Timer/Counter 2 Interrupt(s) initialization
|
|
|
|
|
TIMSK2=(0<<OCIE2B) | (0<<OCIE2A) | (0<<TOIE2);
|
|
|
|
|
61a: 10 92 70 00 sts 0x0070, r1
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
void timerOn() {
|
|
|
|
|
// OC0B output: Non-Inverted PWM
|
|
|
|
|
// OC2A output: Non-Inverted PWM
|
|
|
|
|
// OC2B output: Non-Inverted PWM
|
|
|
|
|
TCCR0A |= (1<<COM0B1);
|
|
|
|
|
61e: 84 b5 in r24, 0x24 ; 36
|
|
|
|
|
620: 80 62 ori r24, 0x20 ; 32
|
|
|
|
|
622: 84 bd out 0x24, r24 ; 36
|
|
|
|
|
TCCR2A |= (1<<COM2A1) | (1<<COM2B1);
|
|
|
|
|
624: 80 81 ld r24, Z
|
|
|
|
|
626: 80 6a ori r24, 0xA0 ; 160
|
|
|
|
|
628: 80 83 st Z, r24
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
void color(uint8_t r, uint8_t g, uint8_t b) {
|
|
|
|
|
OCR0B=r; //ROT
|
|
|
|
|
62a: 18 bc out 0x28, r1 ; 40
|
|
|
|
|
OCR2B=g; //GR<47>N
|
|
|
|
|
62c: 10 92 b4 00 sts 0x00B4, r1
|
|
|
|
|
OCR2A=b; //BLAU
|
|
|
|
|
630: 10 92 b3 00 sts 0x00B3, r1
|
|
|
|
|
634: 08 95 ret
|
2014-11-19 23:57:35 +01:00
|
|
|
|
|
2015-02-08 00:22:32 +01:00
|
|
|
|
00000636 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv>:
|
|
|
|
|
// Interrupt on any change on pins PCINT16-23: Off
|
|
|
|
|
EICRA=(0<<ISC11) | (0<<ISC10) | (1<<ISC01) | (0<<ISC00);
|
|
|
|
|
EIMSK=(0<<INT1) | (1<<INT0);
|
|
|
|
|
EIFR=(0<<INTF1) | (0<<INTF0);
|
|
|
|
|
}
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
636: 20 e0 ldi r18, 0x00 ; 0
|
|
|
|
|
638: 30 e0 ldi r19, 0x00 ; 0
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
63a: 80 e0 ldi r24, 0x00 ; 0
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
63c: 61 e0 ldi r22, 0x01 ; 1
|
|
|
|
|
63e: 70 e0 ldi r23, 0x00 ; 0
|
|
|
|
|
static void set_high() { set(true); }
|
|
|
|
|
static void set_low() { set(false); }
|
|
|
|
|
static bool read() { return value(); }
|
|
|
|
|
static void pullup() { set_high(); }
|
|
|
|
|
|
|
|
|
|
static void wait_is_set() { do { } while (!(Port::pin() & (1<<Pin))); }
|
|
|
|
|
640: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
642: fe cf rjmp .-4 ; 0x640 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0xa>
|
|
|
|
|
#else
|
|
|
|
|
//round up by default
|
|
|
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
|
|
|
644: ef e9 ldi r30, 0x9F ; 159
|
|
|
|
|
646: ff e0 ldi r31, 0x0F ; 15
|
|
|
|
|
648: 31 97 sbiw r30, 0x01 ; 1
|
|
|
|
|
64a: f1 f7 brne .-4 ; 0x648 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x12>
|
|
|
|
|
64c: 00 c0 rjmp .+0 ; 0x64e <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x18>
|
|
|
|
|
64e: 00 00 nop
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
650: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
652: 08 c0 rjmp .+16 ; 0x664 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x2e>
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
654: ab 01 movw r20, r22
|
|
|
|
|
656: 02 2e mov r0, r18
|
|
|
|
|
658: 02 c0 rjmp .+4 ; 0x65e <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x28>
|
|
|
|
|
65a: 44 0f add r20, r20
|
|
|
|
|
65c: 55 1f adc r21, r21
|
|
|
|
|
65e: 0a 94 dec r0
|
|
|
|
|
660: e2 f7 brpl .-8 ; 0x65a <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x24>
|
|
|
|
|
662: 84 2b or r24, r20
|
|
|
|
|
}
|
|
|
|
|
for(uint8_t j=0;j<50;j++) {
|
|
|
|
|
if(!intpin::value()) {
|
|
|
|
|
664: 4a 99 sbic 0x09, 2 ; 9
|
|
|
|
|
666: 0f c0 rjmp .+30 ; 0x686 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x50>
|
|
|
|
|
668: 08 c0 rjmp .+16 ; 0x67a <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x44>
|
|
|
|
|
66a: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
66c: 06 c0 rjmp .+12 ; 0x67a <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x44>
|
|
|
|
|
66e: f5 e8 ldi r31, 0x85 ; 133
|
|
|
|
|
670: fa 95 dec r31
|
|
|
|
|
672: f1 f7 brne .-4 ; 0x670 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x3a>
|
|
|
|
|
674: 00 00 nop
|
|
|
|
|
676: 91 50 subi r25, 0x01 ; 1
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
}
|
|
|
|
|
for(uint8_t j=0;j<50;j++) {
|
|
|
|
|
678: c1 f7 brne .-16 ; 0x66a <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x34>
|
|
|
|
|
67a: 2f 5f subi r18, 0xFF ; 255
|
|
|
|
|
67c: 3f 4f sbci r19, 0xFF ; 255
|
|
|
|
|
EIMSK=(0<<INT1) | (1<<INT0);
|
|
|
|
|
EIFR=(0<<INTF1) | (0<<INTF0);
|
|
|
|
|
}
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
67e: 28 30 cpi r18, 0x08 ; 8
|
|
|
|
|
680: 31 05 cpc r19, r1
|
|
|
|
|
682: f1 f6 brne .-68 ; 0x640 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0xa>
|
|
|
|
|
684: 08 95 ret
|
|
|
|
|
686: 45 e8 ldi r20, 0x85 ; 133
|
|
|
|
|
688: 4a 95 dec r20
|
|
|
|
|
68a: f1 f7 brne .-4 ; 0x688 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x52>
|
|
|
|
|
68c: 00 00 nop
|
|
|
|
|
68e: 91 e3 ldi r25, 0x31 ; 49
|
|
|
|
|
690: ec cf rjmp .-40 ; 0x66a <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv+0x34>
|
|
|
|
|
|
|
|
|
|
00000692 <__vector_1>:
|
|
|
|
|
_delay_ms(99);
|
|
|
|
|
led.green(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ISR(INT0_vect) {
|
|
|
|
|
692: 1f 92 push r1
|
|
|
|
|
694: 0f 92 push r0
|
|
|
|
|
696: 0f b6 in r0, 0x3f ; 63
|
|
|
|
|
698: 0f 92 push r0
|
|
|
|
|
69a: 11 24 eor r1, r1
|
|
|
|
|
69c: 2f 93 push r18
|
|
|
|
|
69e: 3f 93 push r19
|
|
|
|
|
6a0: 4f 93 push r20
|
|
|
|
|
6a2: 5f 93 push r21
|
|
|
|
|
6a4: 6f 93 push r22
|
|
|
|
|
6a6: 7f 93 push r23
|
|
|
|
|
6a8: 8f 93 push r24
|
|
|
|
|
6aa: 9f 93 push r25
|
|
|
|
|
6ac: af 93 push r26
|
|
|
|
|
6ae: bf 93 push r27
|
|
|
|
|
6b0: cf 93 push r28
|
|
|
|
|
6b2: ef 93 push r30
|
|
|
|
|
6b4: ff 93 push r31
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portb
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTB; }
|
|
|
|
|
static void port(uint8_t v) { PORTB = v; }
|
|
|
|
|
6b6: 28 9a sbi 0x05, 0 ; 5
|
|
|
|
|
public:
|
|
|
|
|
IR() {
|
|
|
|
|
this->init();
|
|
|
|
|
}
|
|
|
|
|
int read() {
|
|
|
|
|
if(intpin::value()) { //Is High, Abbort
|
|
|
|
|
6b8: 4a 99 sbic 0x09, 2 ; 9
|
|
|
|
|
6ba: 79 c0 rjmp .+242 ; 0x7ae <__vector_1+0x11c>
|
|
|
|
|
#else
|
|
|
|
|
//round up by default
|
|
|
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
|
|
|
6bc: 8f e1 ldi r24, 0x1F ; 31
|
|
|
|
|
6be: 9e e4 ldi r25, 0x4E ; 78
|
|
|
|
|
6c0: 01 97 sbiw r24, 0x01 ; 1
|
|
|
|
|
6c2: f1 f7 brne .-4 ; 0x6c0 <__vector_1+0x2e>
|
|
|
|
|
6c4: 00 c0 rjmp .+0 ; 0x6c6 <__vector_1+0x34>
|
|
|
|
|
6c6: 00 00 nop
|
|
|
|
|
return 254;
|
2014-11-19 23:57:35 +01:00
|
|
|
|
}
|
2015-02-08 00:22:32 +01:00
|
|
|
|
_delay_ms(4); //Wait 4ms
|
|
|
|
|
if(intpin::value()) { //Is High, Abbort
|
|
|
|
|
6c8: 4a 99 sbic 0x09, 2 ; 9
|
|
|
|
|
6ca: 71 c0 rjmp .+226 ; 0x7ae <__vector_1+0x11c>
|
|
|
|
|
6cc: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
6ce: fe cf rjmp .-4 ; 0x6cc <__vector_1+0x3a>
|
|
|
|
|
static void wait_is_clear() { do {} while ((Port::pin() & (1<<Pin))); }
|
|
|
|
|
6d0: 4a 99 sbic 0x09, 2 ; 9
|
|
|
|
|
6d2: fe cf rjmp .-4 ; 0x6d0 <__vector_1+0x3e>
|
|
|
|
|
6d4: 80 e0 ldi r24, 0x00 ; 0
|
|
|
|
|
6d6: 90 e0 ldi r25, 0x00 ; 0
|
|
|
|
|
6d8: 60 e0 ldi r22, 0x00 ; 0
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
6da: 41 e0 ldi r20, 0x01 ; 1
|
|
|
|
|
6dc: 50 e0 ldi r21, 0x00 ; 0
|
|
|
|
|
static void set_high() { set(true); }
|
|
|
|
|
static void set_low() { set(false); }
|
|
|
|
|
static bool read() { return value(); }
|
|
|
|
|
static void pullup() { set_high(); }
|
|
|
|
|
|
|
|
|
|
static void wait_is_set() { do { } while (!(Port::pin() & (1<<Pin))); }
|
|
|
|
|
6de: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
6e0: fe cf rjmp .-4 ; 0x6de <__vector_1+0x4c>
|
|
|
|
|
#else
|
|
|
|
|
//round up by default
|
|
|
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
|
|
|
6e2: ef e9 ldi r30, 0x9F ; 159
|
|
|
|
|
6e4: ff e0 ldi r31, 0x0F ; 15
|
|
|
|
|
6e6: 31 97 sbiw r30, 0x01 ; 1
|
|
|
|
|
6e8: f1 f7 brne .-4 ; 0x6e6 <__vector_1+0x54>
|
|
|
|
|
6ea: 00 c0 rjmp .+0 ; 0x6ec <__vector_1+0x5a>
|
|
|
|
|
6ec: 00 00 nop
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
6ee: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
6f0: 08 c0 rjmp .+16 ; 0x702 <__vector_1+0x70>
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
6f2: 9a 01 movw r18, r20
|
|
|
|
|
6f4: 08 2e mov r0, r24
|
|
|
|
|
6f6: 02 c0 rjmp .+4 ; 0x6fc <__vector_1+0x6a>
|
|
|
|
|
6f8: 22 0f add r18, r18
|
|
|
|
|
6fa: 33 1f adc r19, r19
|
|
|
|
|
6fc: 0a 94 dec r0
|
|
|
|
|
6fe: e2 f7 brpl .-8 ; 0x6f8 <__vector_1+0x66>
|
|
|
|
|
700: 62 2b or r22, r18
|
|
|
|
|
}
|
|
|
|
|
for(uint8_t j=0;j<50;j++) {
|
|
|
|
|
if(!intpin::value()) {
|
|
|
|
|
702: 4a 99 sbic 0x09, 2 ; 9
|
|
|
|
|
704: 66 c0 rjmp .+204 ; 0x7d2 <__vector_1+0x140>
|
|
|
|
|
706: 08 c0 rjmp .+16 ; 0x718 <__vector_1+0x86>
|
|
|
|
|
708: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
70a: 06 c0 rjmp .+12 ; 0x718 <__vector_1+0x86>
|
|
|
|
|
70c: f5 e8 ldi r31, 0x85 ; 133
|
|
|
|
|
70e: fa 95 dec r31
|
|
|
|
|
710: f1 f7 brne .-4 ; 0x70e <__vector_1+0x7c>
|
|
|
|
|
712: 00 00 nop
|
|
|
|
|
714: 21 50 subi r18, 0x01 ; 1
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
}
|
|
|
|
|
for(uint8_t j=0;j<50;j++) {
|
|
|
|
|
716: c1 f7 brne .-16 ; 0x708 <__vector_1+0x76>
|
|
|
|
|
718: 01 96 adiw r24, 0x01 ; 1
|
|
|
|
|
EIMSK=(0<<INT1) | (1<<INT0);
|
|
|
|
|
EIFR=(0<<INTF1) | (0<<INTF0);
|
|
|
|
|
}
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
71a: 88 30 cpi r24, 0x08 ; 8
|
|
|
|
|
71c: 91 05 cpc r25, r1
|
|
|
|
|
71e: f9 f6 brne .-66 ; 0x6de <__vector_1+0x4c>
|
|
|
|
|
}
|
|
|
|
|
intpin::wait_is_set(); //Wait for the rest of the init.
|
|
|
|
|
intpin::wait_is_clear(); // Init Complete, wait for first Byte
|
|
|
|
|
|
|
|
|
|
//Read First Byte must be 0!
|
|
|
|
|
if(this->read8bit() != 0) { //Is first Byte not 0 Abbort;
|
|
|
|
|
720: 61 11 cpse r22, r1
|
|
|
|
|
722: 39 c0 rjmp .+114 ; 0x796 <__vector_1+0x104>
|
|
|
|
|
724: 80 e0 ldi r24, 0x00 ; 0
|
|
|
|
|
726: 90 e0 ldi r25, 0x00 ; 0
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
728: 41 e0 ldi r20, 0x01 ; 1
|
|
|
|
|
72a: 50 e0 ldi r21, 0x00 ; 0
|
|
|
|
|
72c: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
72e: fe cf rjmp .-4 ; 0x72c <__vector_1+0x9a>
|
|
|
|
|
730: ef e9 ldi r30, 0x9F ; 159
|
|
|
|
|
732: ff e0 ldi r31, 0x0F ; 15
|
|
|
|
|
734: 31 97 sbiw r30, 0x01 ; 1
|
|
|
|
|
736: f1 f7 brne .-4 ; 0x734 <__vector_1+0xa2>
|
|
|
|
|
738: 00 c0 rjmp .+0 ; 0x73a <__vector_1+0xa8>
|
|
|
|
|
73a: 00 00 nop
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
73c: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
73e: 08 c0 rjmp .+16 ; 0x750 <__vector_1+0xbe>
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
740: 9a 01 movw r18, r20
|
|
|
|
|
742: 08 2e mov r0, r24
|
|
|
|
|
744: 02 c0 rjmp .+4 ; 0x74a <__vector_1+0xb8>
|
|
|
|
|
746: 22 0f add r18, r18
|
|
|
|
|
748: 33 1f adc r19, r19
|
|
|
|
|
74a: 0a 94 dec r0
|
|
|
|
|
74c: e2 f7 brpl .-8 ; 0x746 <__vector_1+0xb4>
|
|
|
|
|
74e: 62 2b or r22, r18
|
|
|
|
|
}
|
|
|
|
|
for(uint8_t j=0;j<50;j++) {
|
|
|
|
|
if(!intpin::value()) {
|
|
|
|
|
750: 4a 99 sbic 0x09, 2 ; 9
|
|
|
|
|
752: 39 c0 rjmp .+114 ; 0x7c6 <__vector_1+0x134>
|
|
|
|
|
754: 08 c0 rjmp .+16 ; 0x766 <__vector_1+0xd4>
|
|
|
|
|
756: 4a 9b sbis 0x09, 2 ; 9
|
|
|
|
|
758: 06 c0 rjmp .+12 ; 0x766 <__vector_1+0xd4>
|
|
|
|
|
75a: f5 e8 ldi r31, 0x85 ; 133
|
|
|
|
|
75c: fa 95 dec r31
|
|
|
|
|
75e: f1 f7 brne .-4 ; 0x75c <__vector_1+0xca>
|
|
|
|
|
760: 00 00 nop
|
|
|
|
|
762: 21 50 subi r18, 0x01 ; 1
|
|
|
|
|
intpin::wait_is_set();
|
|
|
|
|
_delay_us(800);
|
|
|
|
|
if(intpin::read()) {
|
|
|
|
|
r |= (1<<i);
|
|
|
|
|
}
|
|
|
|
|
for(uint8_t j=0;j<50;j++) {
|
|
|
|
|
764: c1 f7 brne .-16 ; 0x756 <__vector_1+0xc4>
|
|
|
|
|
766: 01 96 adiw r24, 0x01 ; 1
|
|
|
|
|
EIMSK=(0<<INT1) | (1<<INT0);
|
|
|
|
|
EIFR=(0<<INTF1) | (0<<INTF0);
|
|
|
|
|
}
|
|
|
|
|
uint8_t read8bit() {
|
|
|
|
|
uint8_t r = 0;
|
|
|
|
|
for (uint8_t i=0;i<8;i++) {
|
|
|
|
|
768: 88 30 cpi r24, 0x08 ; 8
|
|
|
|
|
76a: 91 05 cpc r25, r1
|
|
|
|
|
76c: f9 f6 brne .-66 ; 0x72c <__vector_1+0x9a>
|
|
|
|
|
//Read First Byte must be 0!
|
|
|
|
|
if(this->read8bit() != 0) { //Is first Byte not 0 Abbort;
|
|
|
|
|
return 255;
|
|
|
|
|
}
|
|
|
|
|
//Read Second Byte must be 239!
|
|
|
|
|
if(this->read8bit() != 239) {
|
|
|
|
|
76e: 6f 3e cpi r22, 0xEF ; 239
|
|
|
|
|
770: 91 f4 brne .+36 ; 0x796 <__vector_1+0x104>
|
|
|
|
|
return 255;
|
|
|
|
|
}
|
|
|
|
|
//Read Byte 3 and 4 (Data Byte and Checksum Byte!
|
|
|
|
|
uint8_t a = this->read8bit();
|
|
|
|
|
772: 8c e6 ldi r24, 0x6C ; 108
|
|
|
|
|
774: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
776: 0e 94 1b 03 call 0x636 ; 0x636 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv>
|
|
|
|
|
77a: c8 2f mov r28, r24
|
|
|
|
|
uint8_t b = this->read8bit();
|
|
|
|
|
77c: 8c e6 ldi r24, 0x6C ; 108
|
|
|
|
|
77e: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
780: 0e 94 1b 03 call 0x636 ; 0x636 <_ZN2IRIN6avrlib5portdELi2E3LedINS0_5portbELi0ELi1EEE8read8bitEv>
|
|
|
|
|
//Make Checksum Byte 3 + 4 must be 255!
|
|
|
|
|
if(a+b != 255) {
|
|
|
|
|
784: 28 2f mov r18, r24
|
|
|
|
|
786: 30 e0 ldi r19, 0x00 ; 0
|
|
|
|
|
788: 2c 0f add r18, r28
|
|
|
|
|
78a: 31 1d adc r19, r1
|
|
|
|
|
78c: 2f 3f cpi r18, 0xFF ; 255
|
|
|
|
|
78e: 31 05 cpc r19, r1
|
|
|
|
|
790: 11 f4 brne .+4 ; 0x796 <__vector_1+0x104>
|
|
|
|
|
}
|
|
|
|
|
//The Interrupt Function
|
|
|
|
|
void interrupt() {
|
|
|
|
|
led.red(1);
|
|
|
|
|
uint8_t code = this->read();
|
|
|
|
|
if(code == 255) {
|
|
|
|
|
792: cf 3f cpi r28, 0xFF ; 255
|
|
|
|
|
794: 51 f4 brne .+20 ; 0x7aa <__vector_1+0x118>
|
|
|
|
|
#else
|
|
|
|
|
//round up by default
|
|
|
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
|
|
|
796: 2f e7 ldi r18, 0x7F ; 127
|
|
|
|
|
798: 34 e8 ldi r19, 0x84 ; 132
|
|
|
|
|
79a: 8e e1 ldi r24, 0x1E ; 30
|
|
|
|
|
79c: 21 50 subi r18, 0x01 ; 1
|
|
|
|
|
79e: 30 40 sbci r19, 0x00 ; 0
|
|
|
|
|
7a0: 80 40 sbci r24, 0x00 ; 0
|
|
|
|
|
7a2: e1 f7 brne .-8 ; 0x79c <__vector_1+0x10a>
|
|
|
|
|
7a4: 00 c0 rjmp .+0 ; 0x7a6 <__vector_1+0x114>
|
|
|
|
|
7a6: 00 00 nop
|
|
|
|
|
7a8: 0b c0 rjmp .+22 ; 0x7c0 <__vector_1+0x12e>
|
|
|
|
|
_delay_ms(500);
|
|
|
|
|
} else if(code == 254) {
|
|
|
|
|
7aa: ce 3f cpi r28, 0xFE ; 254
|
|
|
|
|
7ac: 39 f4 brne .+14 ; 0x7bc <__vector_1+0x12a>
|
|
|
|
|
7ae: e7 e8 ldi r30, 0x87 ; 135
|
|
|
|
|
7b0: f3 e1 ldi r31, 0x13 ; 19
|
|
|
|
|
7b2: 31 97 sbiw r30, 0x01 ; 1
|
|
|
|
|
7b4: f1 f7 brne .-4 ; 0x7b2 <__vector_1+0x120>
|
|
|
|
|
7b6: 00 c0 rjmp .+0 ; 0x7b8 <__vector_1+0x126>
|
|
|
|
|
7b8: 00 00 nop
|
|
|
|
|
7ba: 02 c0 rjmp .+4 ; 0x7c0 <__vector_1+0x12e>
|
|
|
|
|
_delay_ms(1);
|
|
|
|
|
} else {
|
|
|
|
|
this->_code = code;
|
|
|
|
|
7bc: c0 93 6d 01 sts 0x016D, r28
|
|
|
|
|
7c0: 28 98 cbi 0x05, 0 ; 5
|
|
|
|
|
}
|
|
|
|
|
led.red(0);
|
|
|
|
|
EIFR |= (1<<INTF0);
|
|
|
|
|
7c2: e0 9a sbi 0x1c, 0 ; 28
|
|
|
|
|
7c4: 0c c0 rjmp .+24 ; 0x7de <__vector_1+0x14c>
|
|
|
|
|
#else
|
|
|
|
|
//round up by default
|
|
|
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
|
|
|
7c6: f5 e8 ldi r31, 0x85 ; 133
|
|
|
|
|
7c8: fa 95 dec r31
|
|
|
|
|
7ca: f1 f7 brne .-4 ; 0x7c8 <__vector_1+0x136>
|
|
|
|
|
7cc: 00 00 nop
|
|
|
|
|
7ce: 21 e3 ldi r18, 0x31 ; 49
|
|
|
|
|
7d0: c2 cf rjmp .-124 ; 0x756 <__vector_1+0xc4>
|
|
|
|
|
7d2: 25 e8 ldi r18, 0x85 ; 133
|
|
|
|
|
7d4: 2a 95 dec r18
|
|
|
|
|
7d6: f1 f7 brne .-4 ; 0x7d4 <__vector_1+0x142>
|
|
|
|
|
7d8: 00 00 nop
|
|
|
|
|
7da: 21 e3 ldi r18, 0x31 ; 49
|
|
|
|
|
7dc: 95 cf rjmp .-214 ; 0x708 <__vector_1+0x76>
|
|
|
|
|
ir.interrupt();
|
|
|
|
|
}
|
|
|
|
|
7de: ff 91 pop r31
|
|
|
|
|
7e0: ef 91 pop r30
|
|
|
|
|
7e2: cf 91 pop r28
|
|
|
|
|
7e4: bf 91 pop r27
|
|
|
|
|
7e6: af 91 pop r26
|
|
|
|
|
7e8: 9f 91 pop r25
|
|
|
|
|
7ea: 8f 91 pop r24
|
|
|
|
|
7ec: 7f 91 pop r23
|
|
|
|
|
7ee: 6f 91 pop r22
|
|
|
|
|
7f0: 5f 91 pop r21
|
|
|
|
|
7f2: 4f 91 pop r20
|
|
|
|
|
7f4: 3f 91 pop r19
|
|
|
|
|
7f6: 2f 91 pop r18
|
|
|
|
|
7f8: 0f 90 pop r0
|
|
|
|
|
7fa: 0f be out 0x3f, r0 ; 63
|
|
|
|
|
7fc: 0f 90 pop r0
|
|
|
|
|
7fe: 1f 90 pop r1
|
|
|
|
|
800: 18 95 reti
|
|
|
|
|
|
|
|
|
|
00000802 <_GLOBAL__sub_I_Serial>:
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "peripheral.h"
|
|
|
|
|
#include <util/delay.h>
|
|
|
|
|
|
|
|
|
|
uartclass Serial;
|
|
|
|
|
802: 81 e7 ldi r24, 0x71 ; 113
|
|
|
|
|
804: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
806: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN4UartILm9600EEC1Ev>
|
|
|
|
|
|
|
|
|
|
template <typename PortR, int pin_red, typename PortG, int pin_green, typename PortB, int pin_blue>
|
|
|
|
|
class Stripe {
|
|
|
|
|
public:
|
|
|
|
|
Stripe() {
|
|
|
|
|
this->init();
|
|
|
|
|
80a: 80 e7 ldi r24, 0x70 ; 112
|
|
|
|
|
80c: 91 e0 ldi r25, 0x01 ; 1
|
|
|
|
|
80e: 0e 94 f9 02 call 0x5f2 ; 0x5f2 <_ZN6StripeIN6avrlib5portdELi5ES1_Li3ENS0_5portbELi3EE4initEv>
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PINB; }
|
|
|
|
|
static void pin(uint8_t v) { PINB = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRB; }
|
|
|
|
|
static void dir(uint8_t v) { DDRB = v; }
|
|
|
|
|
812: 20 9a sbi 0x04, 0 ; 4
|
|
|
|
|
814: 21 9a sbi 0x04, 1 ; 4
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portb
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTB; }
|
|
|
|
|
static void port(uint8_t v) { PORTB = v; }
|
|
|
|
|
816: 28 98 cbi 0x05, 0 ; 5
|
|
|
|
|
818: 29 98 cbi 0x05, 1 ; 5
|
|
|
|
|
81a: 56 98 cbi 0x0a, 6 ; 10
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portd
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTD; }
|
|
|
|
|
static void port(uint8_t v) { PORTD = v; }
|
|
|
|
|
81c: 5e 98 cbi 0x0b, 6 ; 11
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PIND; }
|
|
|
|
|
static void pin(uint8_t v) { PIND = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRD; }
|
|
|
|
|
static void dir(uint8_t v) { DDRD = v; }
|
|
|
|
|
81e: 57 98 cbi 0x0a, 7 ; 10
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portd
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTD; }
|
|
|
|
|
static void port(uint8_t v) { PORTD = v; }
|
|
|
|
|
820: 5f 98 cbi 0x0b, 7 ; 11
|
|
|
|
|
// The Analog Comparator's positive input is
|
|
|
|
|
// connected to the AIN0 pin
|
|
|
|
|
// The Analog Comparator's negative input is
|
|
|
|
|
// connected to the AIN1 pin
|
|
|
|
|
// Analog Comparator Input Capture by Timer/Counter 1: Off
|
|
|
|
|
ACSR=(0<<ACD) | (0<<ACBG) | (0<<ACO) | (0<<ACI) | (0<<ACIE) | (0<<ACIC) | (0<<ACIS1) | (0<<ACIS0);
|
|
|
|
|
822: 10 be out 0x30, r1 ; 48
|
|
|
|
|
ADCSRB=(0<<ACME);
|
|
|
|
|
824: 10 92 7b 00 sts 0x007B, r1
|
|
|
|
|
// Digital input buffer on AIN0: Off
|
|
|
|
|
// Digital input buffer on AIN1: Off
|
|
|
|
|
DIDR1=(1<<AIN0D) | (1<<AIN1D);
|
|
|
|
|
828: 83 e0 ldi r24, 0x03 ; 3
|
|
|
|
|
82a: 80 93 7f 00 sts 0x007F, r24
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PINB; }
|
|
|
|
|
static void pin(uint8_t v) { PINB = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRB; }
|
|
|
|
|
static void dir(uint8_t v) { DDRB = v; }
|
|
|
|
|
82e: 20 9a sbi 0x04, 0 ; 4
|
|
|
|
|
830: 21 9a sbi 0x04, 1 ; 4
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portb
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTB; }
|
|
|
|
|
static void port(uint8_t v) { PORTB = v; }
|
|
|
|
|
832: 28 98 cbi 0x05, 0 ; 5
|
|
|
|
|
834: 29 98 cbi 0x05, 1 ; 5
|
|
|
|
|
|
|
|
|
|
static uint8_t pin() { return PIND; }
|
|
|
|
|
static void pin(uint8_t v) { PIND = v; }
|
|
|
|
|
|
|
|
|
|
static uint8_t dir() { return DDRD; }
|
|
|
|
|
static void dir(uint8_t v) { DDRD = v; }
|
|
|
|
|
836: 52 98 cbi 0x0a, 2 ; 10
|
|
|
|
|
namespace avrlib {
|
|
|
|
|
|
|
|
|
|
struct portd
|
|
|
|
|
{
|
|
|
|
|
static uint8_t port() { return PORTD; }
|
|
|
|
|
static void port(uint8_t v) { PORTD = v; }
|
|
|
|
|
838: 5a 98 cbi 0x0b, 2 ; 11
|
|
|
|
|
private:
|
|
|
|
|
Led led;
|
|
|
|
|
uint8_t _code;
|
|
|
|
|
void init() {
|
|
|
|
|
intpin::make_input();
|
|
|
|
|
this->_code = 255;
|
|
|
|
|
83a: 8f ef ldi r24, 0xFF ; 255
|
|
|
|
|
83c: 80 93 6d 01 sts 0x016D, r24
|
|
|
|
|
// INT0 Mode: Falling Edge
|
|
|
|
|
// INT1: Off
|
|
|
|
|
// Interrupt on any change on pins PCINT0-7: Off
|
|
|
|
|
// Interrupt on any change on pins PCINT8-14: Off
|
|
|
|
|
// Interrupt on any change on pins PCINT16-23: Off
|
|
|
|
|
EICRA=(0<<ISC11) | (0<<ISC10) | (1<<ISC01) | (0<<ISC00);
|
|
|
|
|
840: 82 e0 ldi r24, 0x02 ; 2
|
|
|
|
|
842: 80 93 69 00 sts 0x0069, r24
|
|
|
|
|
EIMSK=(0<<INT1) | (1<<INT0);
|
|
|
|
|
846: 81 e0 ldi r24, 0x01 ; 1
|
|
|
|
|
848: 8d bb out 0x1d, r24 ; 29
|
|
|
|
|
EIFR=(0<<INTF1) | (0<<INTF0);
|
|
|
|
|
84a: 1c ba out 0x1c, r1 ; 28
|
|
|
|
|
84c: 08 95 ret
|
|
|
|
|
|
|
|
|
|
0000084e <__umulhisi3>:
|
|
|
|
|
84e: a2 9f mul r26, r18
|
|
|
|
|
850: b0 01 movw r22, r0
|
|
|
|
|
852: b3 9f mul r27, r19
|
|
|
|
|
854: c0 01 movw r24, r0
|
|
|
|
|
856: a3 9f mul r26, r19
|
|
|
|
|
858: 01 d0 rcall .+2 ; 0x85c <__umulhisi3+0xe>
|
|
|
|
|
85a: b2 9f mul r27, r18
|
|
|
|
|
85c: 70 0d add r23, r0
|
|
|
|
|
85e: 81 1d adc r24, r1
|
|
|
|
|
860: 11 24 eor r1, r1
|
|
|
|
|
862: 91 1d adc r25, r1
|
|
|
|
|
864: 08 95 ret
|
|
|
|
|
|
|
|
|
|
00000866 <__tablejump2__>:
|
|
|
|
|
866: ee 0f add r30, r30
|
|
|
|
|
868: ff 1f adc r31, r31
|
|
|
|
|
|
|
|
|
|
0000086a <__tablejump__>:
|
|
|
|
|
86a: 05 90 lpm r0, Z+
|
|
|
|
|
86c: f4 91 lpm r31, Z
|
|
|
|
|
86e: e0 2d mov r30, r0
|
|
|
|
|
870: 09 94 ijmp
|
2014-11-19 23:57:35 +01:00
|
|
|
|
|
2015-02-08 00:22:32 +01:00
|
|
|
|
00000872 <_exit>:
|
|
|
|
|
872: f8 94 cli
|
2014-11-19 23:57:35 +01:00
|
|
|
|
|
2015-02-08 00:22:32 +01:00
|
|
|
|
00000874 <__stop_program>:
|
|
|
|
|
874: ff cf rjmp .-2 ; 0x874 <__stop_program>
|