1036 lines
34 KiB
Plaintext
1036 lines
34 KiB
Plaintext
|
|
Mainboard.elf: file format elf32-avr
|
|
|
|
Sections:
|
|
Idx Name Size VMA LMA File off Algn
|
|
0 .data 00000006 00800100 0000051a 000005ae 2**0
|
|
CONTENTS, ALLOC, LOAD, DATA
|
|
1 .text 0000051a 00000000 00000000 00000094 2**1
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
2 .bss 00000003 00800106 00800106 000005b4 2**0
|
|
ALLOC
|
|
3 .stab 000006cc 00000000 00000000 000005b4 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
4 .stabstr 00000082 00000000 00000000 00000c80 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
5 .comment 0000002f 00000000 00000000 00000d02 2**0
|
|
CONTENTS, READONLY
|
|
6 .debug_aranges 00000118 00000000 00000000 00000d31 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
7 .debug_info 00001e0f 00000000 00000000 00000e49 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
8 .debug_abbrev 0000099e 00000000 00000000 00002c58 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
9 .debug_line 0000072a 00000000 00000000 000035f6 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
10 .debug_frame 00000338 00000000 00000000 00003d20 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
11 .debug_str 00000490 00000000 00000000 00004058 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
12 .debug_loc 00000d47 00000000 00000000 000044e8 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
13 .debug_ranges 00000120 00000000 00000000 0000522f 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
|
Disassembly of section .text:
|
|
|
|
00000000 <__vectors>:
|
|
0: 0c 94 3b 00 jmp 0x76 ; 0x76 <__ctors_end>
|
|
4: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
8: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
10: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
14: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
18: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
1c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
20: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
24: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
28: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
2c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
30: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
34: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
38: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
3c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
40: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
44: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
48: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
4c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
50: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
54: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
58: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
5c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
60: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
64: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
68: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
6c: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
70: 0c 94 63 00 jmp 0xc6 ; 0xc6 <__bad_interrupt>
|
|
|
|
00000074 <__ctors_start>:
|
|
74: 4b 02 muls r20, r27
|
|
|
|
00000076 <__ctors_end>:
|
|
76: 11 24 eor r1, r1
|
|
78: 1f be out 0x3f, r1 ; 63
|
|
7a: cf ef ldi r28, 0xFF ; 255
|
|
7c: d4 e0 ldi r29, 0x04 ; 4
|
|
7e: de bf out 0x3e, r29 ; 62
|
|
80: cd bf out 0x3d, r28 ; 61
|
|
|
|
00000082 <__do_copy_data>:
|
|
82: 11 e0 ldi r17, 0x01 ; 1
|
|
84: a0 e0 ldi r26, 0x00 ; 0
|
|
86: b1 e0 ldi r27, 0x01 ; 1
|
|
88: ea e1 ldi r30, 0x1A ; 26
|
|
8a: f5 e0 ldi r31, 0x05 ; 5
|
|
8c: 02 c0 rjmp .+4 ; 0x92 <__do_copy_data+0x10>
|
|
8e: 05 90 lpm r0, Z+
|
|
90: 0d 92 st X+, r0
|
|
92: a6 30 cpi r26, 0x06 ; 6
|
|
94: b1 07 cpc r27, r17
|
|
96: d9 f7 brne .-10 ; 0x8e <__do_copy_data+0xc>
|
|
|
|
00000098 <__do_clear_bss>:
|
|
98: 21 e0 ldi r18, 0x01 ; 1
|
|
9a: a6 e0 ldi r26, 0x06 ; 6
|
|
9c: b1 e0 ldi r27, 0x01 ; 1
|
|
9e: 01 c0 rjmp .+2 ; 0xa2 <.do_clear_bss_start>
|
|
|
|
000000a0 <.do_clear_bss_loop>:
|
|
a0: 1d 92 st X+, r1
|
|
|
|
000000a2 <.do_clear_bss_start>:
|
|
a2: a9 30 cpi r26, 0x09 ; 9
|
|
a4: b2 07 cpc r27, r18
|
|
a6: e1 f7 brne .-8 ; 0xa0 <.do_clear_bss_loop>
|
|
|
|
000000a8 <__do_global_ctors>:
|
|
a8: 10 e0 ldi r17, 0x00 ; 0
|
|
aa: c6 e7 ldi r28, 0x76 ; 118
|
|
ac: d0 e0 ldi r29, 0x00 ; 0
|
|
ae: 04 c0 rjmp .+8 ; 0xb8 <__do_global_ctors+0x10>
|
|
b0: 22 97 sbiw r28, 0x02 ; 2
|
|
b2: fe 01 movw r30, r28
|
|
b4: 0e 94 87 02 call 0x50e ; 0x50e <__tablejump__>
|
|
b8: c4 37 cpi r28, 0x74 ; 116
|
|
ba: d1 07 cpc r29, r17
|
|
bc: c9 f7 brne .-14 ; 0xb0 <__do_global_ctors+0x8>
|
|
be: 0e 94 f9 01 call 0x3f2 ; 0x3f2 <main>
|
|
c2: 0c 94 8b 02 jmp 0x516 ; 0x516 <_exit>
|
|
|
|
000000c6 <__bad_interrupt>:
|
|
c6: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
|
|
|
|
000000ca <_ZN3Can8spi_putcEh>:
|
|
spi_putc((1<<RTR) | length);
|
|
}
|
|
else
|
|
{
|
|
// Nachrichten Laenge einstellen
|
|
spi_putc(length);
|
|
ca: cf 93 push r28
|
|
cc: df 93 push r29
|
|
ce: 00 d0 rcall .+0 ; 0xd0 <_ZN3Can8spi_putcEh+0x6>
|
|
|
|
// Daten
|
|
for (uint8_t i=0;i<length;i++) {
|
|
d0: cd b7 in r28, 0x3d ; 61
|
|
d2: de b7 in r29, 0x3e ; 62
|
|
|
|
// /CS Leitung wieder freigeben
|
|
CANPORT_CS |= (1<<CANP_CS);
|
|
}
|
|
|
|
uint8_t Can::can_send_message(CANMessage *p_message)
|
|
d4: 6e bd out 0x2e, r22 ; 46
|
|
d6: 65 e0 ldi r22, 0x05 ; 5
|
|
d8: ce 01 movw r24, r28
|
|
da: 02 96 adiw r24, 0x02 ; 2
|
|
dc: 0e 94 ef 01 call 0x3de ; 0x3de <_ZN3Led5colorEh>
|
|
e0: 0d b4 in r0, 0x2d ; 45
|
|
e2: 07 fe sbrs r0, 7
|
|
e4: fd cf rjmp .-6 ; 0xe0 <_ZN3Can8spi_putcEh+0x16>
|
|
e6: 60 e0 ldi r22, 0x00 ; 0
|
|
// Nachrichten Laenge einstellen
|
|
spi_putc(length);
|
|
|
|
// Daten
|
|
for (uint8_t i=0;i<length;i++) {
|
|
spi_putc(p_message->data[i]);
|
|
e8: ce 01 movw r24, r28
|
|
ea: 01 96 adiw r24, 0x01 ; 1
|
|
ec: 0e 94 ef 01 call 0x3de ; 0x3de <_ZN3Led5colorEh>
|
|
f0: 8e b5 in r24, 0x2e ; 46
|
|
f2: 0f 90 pop r0
|
|
{
|
|
// Nachrichten Laenge einstellen
|
|
spi_putc(length);
|
|
|
|
// Daten
|
|
for (uint8_t i=0;i<length;i++) {
|
|
f4: 0f 90 pop r0
|
|
f6: df 91 pop r29
|
|
f8: cf 91 pop r28
|
|
spi_putc(p_message->data[i]);
|
|
}
|
|
}
|
|
CANPORT_CS |= (1<<CANP_CS); // CS auf High
|
|
fa: 08 95 ret
|
|
|
|
000000fc <_ZN3Can8init_pinEv>:
|
|
|
|
asm volatile ("nop");
|
|
fc: 84 b1 in r24, 0x04 ; 4
|
|
|
|
/* CAN Nachricht verschicken
|
|
die letzten drei Bit im RTS Kommando geben an welcher
|
|
Puffer gesendet werden soll */
|
|
CANPORT_CS &= ~(1<<CANP_CS); // CS wieder Low
|
|
fe: 86 60 ori r24, 0x06 ; 6
|
|
if (address == 0x00) {
|
|
100: 84 b9 out 0x04, r24 ; 4
|
|
102: 85 b1 in r24, 0x05 ; 5
|
|
spi_putc(SPI_RTS | 0x01);
|
|
104: 81 7f andi r24, 0xF1 ; 241
|
|
106: 85 b9 out 0x05, r24 ; 5
|
|
108: 24 9a sbi 0x04, 4 ; 4
|
|
10a: 2c 9a sbi 0x05, 4 ; 5
|
|
10c: 08 95 ret
|
|
|
|
0000010e <_ZN3Can8init_spiEv>:
|
|
} else {
|
|
spi_putc(SPI_RTS | address);
|
|
10e: 80 e5 ldi r24, 0x50 ; 80
|
|
110: 8c bd out 0x2c, r24 ; 44
|
|
112: 81 e0 ldi r24, 0x01 ; 1
|
|
114: 8d bd out 0x2d, r24 ; 45
|
|
116: 08 95 ret
|
|
|
|
00000118 <_ZN3Can22mcp2515_write_registerEhh>:
|
|
}
|
|
CANPORT_CS |= (1<<CANP_CS); // CS auf High
|
|
118: 0f 93 push r16
|
|
|
|
return 1;
|
|
11a: 1f 93 push r17
|
|
11c: cf 93 push r28
|
|
address = 0x04;
|
|
}
|
|
else {
|
|
/* Alle Puffer sind belegt,
|
|
Nachricht kann nicht verschickt werden */
|
|
return 0;
|
|
11e: df 93 push r29
|
|
spi_putc(SPI_RTS | address);
|
|
}
|
|
CANPORT_CS |= (1<<CANP_CS); // CS auf High
|
|
|
|
return 1;
|
|
}
|
|
120: ec 01 movw r28, r24
|
|
122: 06 2f mov r16, r22
|
|
124: 14 2f mov r17, r20
|
|
126: 2c 98 cbi 0x05, 4 ; 5
|
|
128: 62 e0 ldi r22, 0x02 ; 2
|
|
12a: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
12e: 60 2f mov r22, r16
|
|
130: ce 01 movw r24, r28
|
|
132: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
136: 61 2f mov r22, r17
|
|
// /CS des MCP2515 auf Low ziehen
|
|
CANPORT_CS &= ~(1<<CANP_CS);
|
|
|
|
spi_putc(SPI_WRITE);
|
|
spi_putc(adress);
|
|
spi_putc(data);
|
|
138: ce 01 movw r24, r28
|
|
13a: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
|
|
// /CS Leitung wieder freigeben
|
|
CANPORT_CS |= (1<<CANP_CS);
|
|
13e: 2c 9a sbi 0x05, 4 ; 5
|
|
}
|
|
140: df 91 pop r29
|
|
142: cf 91 pop r28
|
|
144: 1f 91 pop r17
|
|
146: 0f 91 pop r16
|
|
148: 08 95 ret
|
|
|
|
0000014a <_ZN3Can8init_canEv>:
|
|
SPCR = (1<<SPE) | (1<<MSTR);// | (1<<SPR1) | (1<<SPR0);
|
|
//SPSR = 0;
|
|
SPSR = (1<<SPI2X);
|
|
}
|
|
|
|
void Can::init_can() {
|
|
14a: cf 93 push r28
|
|
14c: df 93 push r29
|
|
14e: ec 01 movw r28, r24
|
|
|
|
// MCP2515 per Software Reset zuruecksetzten,
|
|
// danach ist der MCP2515 im Configuration Mode
|
|
CANPORT_CS &= ~(1<<CANP_CS);
|
|
150: 2c 98 cbi 0x05, 4 ; 5
|
|
spi_putc( SPI_RESET );
|
|
152: 60 ec ldi r22, 0xC0 ; 192
|
|
154: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
#else
|
|
//round up by default
|
|
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
|
#endif
|
|
|
|
__builtin_avr_delay_cycles(__ticks_dc);
|
|
158: 8f e9 ldi r24, 0x9F ; 159
|
|
15a: 9f e0 ldi r25, 0x0F ; 15
|
|
15c: 01 97 sbiw r24, 0x01 ; 1
|
|
15e: f1 f7 brne .-4 ; 0x15c <_ZN3Can8init_canEv+0x12>
|
|
160: 00 c0 rjmp .+0 ; 0x162 <_ZN3Can8init_canEv+0x18>
|
|
162: 00 00 nop
|
|
_delay_ms(1);
|
|
CANPORT_CS |= (1<<CANP_CS);
|
|
164: 2c 9a sbi 0x05, 4 ; 5
|
|
166: 8f e3 ldi r24, 0x3F ; 63
|
|
168: 9c e9 ldi r25, 0x9C ; 156
|
|
16a: 01 97 sbiw r24, 0x01 ; 1
|
|
16c: f1 f7 brne .-4 ; 0x16a <_ZN3Can8init_canEv+0x20>
|
|
16e: 00 c0 rjmp .+0 ; 0x170 <_ZN3Can8init_canEv+0x26>
|
|
170: 00 00 nop
|
|
* Bus speed = 1 / (Total # of TQ) * TQ
|
|
* = 1 / 8 * TQ = 125 kHz
|
|
*/
|
|
//return;
|
|
// BRP = 7
|
|
mcp2515_write_register( CNF1, (1<<BRP0)|(1<<BRP1)|(1<<BRP2) );
|
|
172: 47 e0 ldi r20, 0x07 ; 7
|
|
174: 6a e2 ldi r22, 0x2A ; 42
|
|
176: ce 01 movw r24, r28
|
|
178: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
//return;
|
|
// Prop Seg und Phase Seg1 einstellen
|
|
mcp2515_write_register( CNF2, (1<<BTLMODE)|(1<<PHSEG11) );
|
|
17c: 40 e9 ldi r20, 0x90 ; 144
|
|
17e: 69 e2 ldi r22, 0x29 ; 41
|
|
180: ce 01 movw r24, r28
|
|
182: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
//return;
|
|
// Wake-up Filter deaktivieren, Phase Seg2 einstellen
|
|
mcp2515_write_register( CNF3, (1<<PHSEG21) );
|
|
186: 42 e0 ldi r20, 0x02 ; 2
|
|
188: 68 e2 ldi r22, 0x28 ; 40
|
|
18a: ce 01 movw r24, r28
|
|
18c: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
//return;
|
|
// Aktivieren der Rx Buffer Interrupts
|
|
mcp2515_write_register( CANINTE, (1<<RX1IE)|(1<<RX0IE) );
|
|
190: 43 e0 ldi r20, 0x03 ; 3
|
|
192: 6b e2 ldi r22, 0x2B ; 43
|
|
194: ce 01 movw r24, r28
|
|
196: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
/*
|
|
* Einstellen der Filter
|
|
*/
|
|
|
|
// Buffer 0 : Empfangen aller Nachrichten
|
|
mcp2515_write_register( RXB0CTRL, (1<<RXM1)|(1<<RXM0) );
|
|
19a: 40 e6 ldi r20, 0x60 ; 96
|
|
19c: 60 e6 ldi r22, 0x60 ; 96
|
|
19e: ce 01 movw r24, r28
|
|
1a0: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
|
|
// Buffer 1 : Empfangen aller Nachrichten
|
|
mcp2515_write_register( RXB1CTRL, (1<<RXM1)|(1<<RXM0) );
|
|
1a4: 40 e6 ldi r20, 0x60 ; 96
|
|
1a6: 60 e7 ldi r22, 0x70 ; 112
|
|
1a8: ce 01 movw r24, r28
|
|
1aa: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
//return;
|
|
// Alle Bits der Empfangsmaske loeschen,
|
|
// damit werden alle Nachrichten empfangen
|
|
mcp2515_write_register( RXM0SIDH, 0 ); //return;
|
|
1ae: 40 e0 ldi r20, 0x00 ; 0
|
|
1b0: 60 e2 ldi r22, 0x20 ; 32
|
|
1b2: ce 01 movw r24, r28
|
|
1b4: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
mcp2515_write_register( RXM0SIDL, 0 ); //return;
|
|
1b8: 40 e0 ldi r20, 0x00 ; 0
|
|
1ba: 61 e2 ldi r22, 0x21 ; 33
|
|
1bc: ce 01 movw r24, r28
|
|
1be: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
mcp2515_write_register( RXM0EID8, 0 );
|
|
1c2: 40 e0 ldi r20, 0x00 ; 0
|
|
1c4: 62 e2 ldi r22, 0x22 ; 34
|
|
1c6: ce 01 movw r24, r28
|
|
1c8: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
mcp2515_write_register( RXM0EID0, 0 );
|
|
1cc: 40 e0 ldi r20, 0x00 ; 0
|
|
1ce: 63 e2 ldi r22, 0x23 ; 35
|
|
1d0: ce 01 movw r24, r28
|
|
1d2: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
//return;
|
|
mcp2515_write_register( RXM1SIDH, 0 ); //return;
|
|
1d6: 40 e0 ldi r20, 0x00 ; 0
|
|
1d8: 64 e2 ldi r22, 0x24 ; 36
|
|
1da: ce 01 movw r24, r28
|
|
1dc: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
mcp2515_write_register( RXM1SIDL, 0 ); //return;
|
|
1e0: 40 e0 ldi r20, 0x00 ; 0
|
|
1e2: 65 e2 ldi r22, 0x25 ; 37
|
|
1e4: ce 01 movw r24, r28
|
|
1e6: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
mcp2515_write_register( RXM1EID8, 0 );
|
|
1ea: 40 e0 ldi r20, 0x00 ; 0
|
|
1ec: 66 e2 ldi r22, 0x26 ; 38
|
|
1ee: ce 01 movw r24, r28
|
|
1f0: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
mcp2515_write_register( RXM1EID0, 0 );
|
|
1f4: 40 e0 ldi r20, 0x00 ; 0
|
|
1f6: 67 e2 ldi r22, 0x27 ; 39
|
|
1f8: ce 01 movw r24, r28
|
|
1fa: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
/*
|
|
* Einstellen der Pin Funktionen
|
|
*/
|
|
|
|
// Deaktivieren der Pins RXnBF Pins (High Impedance State)
|
|
mcp2515_write_register( BFPCTRL, 0 ); return;
|
|
1fe: 40 e0 ldi r20, 0x00 ; 0
|
|
200: 6c e0 ldi r22, 0x0C ; 12
|
|
202: ce 01 movw r24, r28
|
|
204: 0e 94 8c 00 call 0x118 ; 0x118 <_ZN3Can22mcp2515_write_registerEhh>
|
|
// TXnRTS Bits als Inputs schalten
|
|
mcp2515_write_register( TXRTSCTRL, 0 );
|
|
//return;
|
|
// Device zurueck in den normalen Modus versetzten
|
|
mcp2515_bit_modify( CANCTRL, 0xE0, 0);
|
|
}
|
|
208: df 91 pop r29
|
|
20a: cf 91 pop r28
|
|
20c: 08 95 ret
|
|
|
|
0000020e <_ZN3CanC1Ev>:
|
|
|
|
#define CANDDR_RST DDRD
|
|
#define CANPORT_RST PORTD
|
|
#define CANP_RST PIND6
|
|
|
|
Can::Can() {
|
|
20e: cf 93 push r28
|
|
210: df 93 push r29
|
|
212: ec 01 movw r28, r24
|
|
214: 8f e3 ldi r24, 0x3F ; 63
|
|
216: 9c e9 ldi r25, 0x9C ; 156
|
|
218: 01 97 sbiw r24, 0x01 ; 1
|
|
21a: f1 f7 brne .-4 ; 0x218 <_ZN3CanC1Ev+0xa>
|
|
21c: 00 c0 rjmp .+0 ; 0x21e <_ZN3CanC1Ev+0x10>
|
|
21e: 00 00 nop
|
|
_delay_ms(10);
|
|
init_pin();
|
|
220: ce 01 movw r24, r28
|
|
222: 0e 94 7e 00 call 0xfc ; 0xfc <_ZN3Can8init_pinEv>
|
|
init_spi();
|
|
226: ce 01 movw r24, r28
|
|
228: 0e 94 87 00 call 0x10e ; 0x10e <_ZN3Can8init_spiEv>
|
|
init_can();
|
|
22c: ce 01 movw r24, r28
|
|
22e: 0e 94 a5 00 call 0x14a ; 0x14a <_ZN3Can8init_canEv>
|
|
}
|
|
232: df 91 pop r29
|
|
234: cf 91 pop r28
|
|
236: 08 95 ret
|
|
|
|
00000238 <_ZN3Can18mcp2515_bit_modifyEhhh>:
|
|
|
|
return data;
|
|
}
|
|
|
|
void Can::mcp2515_bit_modify(uint8_t adress, uint8_t mask, uint8_t data)
|
|
{
|
|
238: ff 92 push r15
|
|
23a: 0f 93 push r16
|
|
23c: 1f 93 push r17
|
|
23e: cf 93 push r28
|
|
240: df 93 push r29
|
|
242: ec 01 movw r28, r24
|
|
244: f6 2e mov r15, r22
|
|
246: 04 2f mov r16, r20
|
|
248: 12 2f mov r17, r18
|
|
// /CS des MCP2515 auf Low ziehen
|
|
CANPORT_CS &= ~(1<<CANP_CS);
|
|
24a: 2c 98 cbi 0x05, 4 ; 5
|
|
|
|
spi_putc(SPI_BIT_MODIFY);
|
|
24c: 65 e0 ldi r22, 0x05 ; 5
|
|
24e: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
spi_putc(adress);
|
|
252: 6f 2d mov r22, r15
|
|
254: ce 01 movw r24, r28
|
|
256: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
spi_putc(mask);
|
|
25a: 60 2f mov r22, r16
|
|
25c: ce 01 movw r24, r28
|
|
25e: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
spi_putc(data);
|
|
262: 61 2f mov r22, r17
|
|
264: ce 01 movw r24, r28
|
|
266: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
|
|
// /CS Leitung wieder freigeben
|
|
CANPORT_CS |= (1<<CANP_CS);
|
|
26a: 2c 9a sbi 0x05, 4 ; 5
|
|
}
|
|
26c: df 91 pop r29
|
|
26e: cf 91 pop r28
|
|
270: 1f 91 pop r17
|
|
272: 0f 91 pop r16
|
|
274: ff 90 pop r15
|
|
276: 08 95 ret
|
|
|
|
00000278 <_ZN3Can22mcp2515_read_rx_statusEv>:
|
|
|
|
return (status & 0x07);
|
|
}
|
|
|
|
uint8_t Can::mcp2515_read_rx_status(void)
|
|
{
|
|
278: 1f 93 push r17
|
|
27a: cf 93 push r28
|
|
27c: df 93 push r29
|
|
27e: ec 01 movw r28, r24
|
|
uint8_t data;
|
|
|
|
// /CS des MCP2515 auf Low ziehen
|
|
CANPORT_CS &= ~(1<<CANP_CS);
|
|
280: 2c 98 cbi 0x05, 4 ; 5
|
|
|
|
spi_putc(SPI_RX_STATUS);
|
|
282: 60 eb ldi r22, 0xB0 ; 176
|
|
284: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
data = spi_putc(0xff);
|
|
288: 6f ef ldi r22, 0xFF ; 255
|
|
28a: ce 01 movw r24, r28
|
|
28c: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
290: 18 2f mov r17, r24
|
|
|
|
// Die Daten werden noch einmal wiederholt gesendet,
|
|
// man braucht also nur eins der beiden Bytes auswerten.
|
|
spi_putc(0xff);
|
|
292: 6f ef ldi r22, 0xFF ; 255
|
|
294: ce 01 movw r24, r28
|
|
296: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
|
|
// /CS Leitung wieder freigeben
|
|
CANPORT_CS |= (1<<CANP_CS);
|
|
29a: 2c 9a sbi 0x05, 4 ; 5
|
|
|
|
return data;
|
|
29c: 81 2f mov r24, r17
|
|
29e: df 91 pop r29
|
|
2a0: cf 91 pop r28
|
|
2a2: 1f 91 pop r17
|
|
2a4: 08 95 ret
|
|
|
|
000002a6 <_ZN3Can15can_get_messageEP10CANMessage>:
|
|
|
|
return 1;
|
|
}
|
|
|
|
uint8_t Can::can_get_message(CANMessage *p_message)
|
|
{
|
|
2a6: af 92 push r10
|
|
2a8: bf 92 push r11
|
|
2aa: cf 92 push r12
|
|
2ac: df 92 push r13
|
|
2ae: ef 92 push r14
|
|
2b0: ff 92 push r15
|
|
2b2: 0f 93 push r16
|
|
2b4: 1f 93 push r17
|
|
2b6: cf 93 push r28
|
|
2b8: df 93 push r29
|
|
2ba: 1f 92 push r1
|
|
2bc: cd b7 in r28, 0x3d ; 61
|
|
2be: de b7 in r29, 0x3e ; 62
|
|
2c0: 7c 01 movw r14, r24
|
|
2c2: 6b 01 movw r12, r22
|
|
// Status auslesen
|
|
uint8_t status = mcp2515_read_rx_status();
|
|
2c4: 0e 94 3c 01 call 0x278 ; 0x278 <_ZN3Can22mcp2515_read_rx_statusEv>
|
|
2c8: 89 83 std Y+1, r24 ; 0x01
|
|
|
|
if (bit_is_set(status,6))
|
|
2ca: 89 81 ldd r24, Y+1 ; 0x01
|
|
2cc: 86 ff sbrs r24, 6
|
|
2ce: 06 c0 rjmp .+12 ; 0x2dc <_ZN3Can15can_get_messageEP10CANMessage+0x36>
|
|
{
|
|
// Nachricht in Puffer 0
|
|
|
|
CANPORT_CS &= ~(1<<CANP_CS); // CS Low
|
|
2d0: 2c 98 cbi 0x05, 4 ; 5
|
|
spi_putc(SPI_READ_RX);
|
|
2d2: 60 e9 ldi r22, 0x90 ; 144
|
|
2d4: c7 01 movw r24, r14
|
|
2d6: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
2da: 09 c0 rjmp .+18 ; 0x2ee <_ZN3Can15can_get_messageEP10CANMessage+0x48>
|
|
}
|
|
else if (bit_is_set(status,7))
|
|
2dc: 89 81 ldd r24, Y+1 ; 0x01
|
|
2de: 88 23 and r24, r24
|
|
2e0: 0c f0 brlt .+2 ; 0x2e4 <_ZN3Can15can_get_messageEP10CANMessage+0x3e>
|
|
2e2: 69 c0 rjmp .+210 ; 0x3b6 <_ZN3Can15can_get_messageEP10CANMessage+0x110>
|
|
{
|
|
// Nachricht in Puffer 1
|
|
|
|
CANPORT_CS &= ~(1<<CANP_CS); // CS Low
|
|
2e4: 2c 98 cbi 0x05, 4 ; 5
|
|
spi_putc(SPI_READ_RX | 0x04);
|
|
2e6: 64 e9 ldi r22, 0x94 ; 148
|
|
2e8: c7 01 movw r24, r14
|
|
2ea: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
/* Fehler: Keine neue Nachricht vorhanden */
|
|
return 0xff;
|
|
}
|
|
|
|
// Standard ID auslesen
|
|
p_message->id = (uint16_t) spi_putc(0xff) << 3;
|
|
2ee: 6f ef ldi r22, 0xFF ; 255
|
|
2f0: c7 01 movw r24, r14
|
|
2f2: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
2f6: 90 e0 ldi r25, 0x00 ; 0
|
|
2f8: 88 0f add r24, r24
|
|
2fa: 99 1f adc r25, r25
|
|
2fc: 88 0f add r24, r24
|
|
2fe: 99 1f adc r25, r25
|
|
300: 88 0f add r24, r24
|
|
302: 99 1f adc r25, r25
|
|
304: f6 01 movw r30, r12
|
|
306: 91 83 std Z+1, r25 ; 0x01
|
|
308: 80 83 st Z, r24
|
|
p_message->id |= (uint16_t) spi_putc(0xff) >> 5;
|
|
30a: 6f ef ldi r22, 0xFF ; 255
|
|
30c: c7 01 movw r24, r14
|
|
30e: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
312: 90 e0 ldi r25, 0x00 ; 0
|
|
314: 96 95 lsr r25
|
|
316: 87 95 ror r24
|
|
318: 92 95 swap r25
|
|
31a: 82 95 swap r24
|
|
31c: 8f 70 andi r24, 0x0F ; 15
|
|
31e: 89 27 eor r24, r25
|
|
320: 9f 70 andi r25, 0x0F ; 15
|
|
322: 89 27 eor r24, r25
|
|
324: f6 01 movw r30, r12
|
|
326: 20 81 ld r18, Z
|
|
328: 31 81 ldd r19, Z+1 ; 0x01
|
|
32a: 82 2b or r24, r18
|
|
32c: 93 2b or r25, r19
|
|
32e: 91 83 std Z+1, r25 ; 0x01
|
|
330: 80 83 st Z, r24
|
|
|
|
spi_putc(0xff);
|
|
332: 6f ef ldi r22, 0xFF ; 255
|
|
334: c7 01 movw r24, r14
|
|
336: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
spi_putc(0xff);
|
|
33a: 6f ef ldi r22, 0xFF ; 255
|
|
33c: c7 01 movw r24, r14
|
|
33e: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
|
|
// Laenge auslesen
|
|
uint8_t length = spi_putc(0xff) & 0x0f;
|
|
342: 6f ef ldi r22, 0xFF ; 255
|
|
344: c7 01 movw r24, r14
|
|
346: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
34a: 8f 70 andi r24, 0x0F ; 15
|
|
p_message->length = length;
|
|
34c: f6 01 movw r30, r12
|
|
34e: 83 83 std Z+3, r24 ; 0x03
|
|
|
|
// Daten auslesen
|
|
for (uint8_t i=0;i<length;i++) {
|
|
350: 88 23 and r24, r24
|
|
352: a1 f0 breq .+40 ; 0x37c <_ZN3Can15can_get_messageEP10CANMessage+0xd6>
|
|
CANPORT_CS |= (1<<CANP_CS); // CS auf High
|
|
|
|
return 1;
|
|
}
|
|
|
|
uint8_t Can::can_get_message(CANMessage *p_message)
|
|
354: 86 01 movw r16, r12
|
|
356: 0c 5f subi r16, 0xFC ; 252
|
|
358: 1f 4f sbci r17, 0xFF ; 255
|
|
35a: 56 01 movw r10, r12
|
|
35c: f5 e0 ldi r31, 0x05 ; 5
|
|
35e: af 0e add r10, r31
|
|
360: b1 1c adc r11, r1
|
|
362: 81 50 subi r24, 0x01 ; 1
|
|
364: a8 0e add r10, r24
|
|
366: b1 1c adc r11, r1
|
|
uint8_t length = spi_putc(0xff) & 0x0f;
|
|
p_message->length = length;
|
|
|
|
// Daten auslesen
|
|
for (uint8_t i=0;i<length;i++) {
|
|
p_message->data[i] = spi_putc(0xff);
|
|
368: 6f ef ldi r22, 0xFF ; 255
|
|
36a: c7 01 movw r24, r14
|
|
36c: 0e 94 65 00 call 0xca ; 0xca <_ZN3Can8spi_putcEh>
|
|
370: f8 01 movw r30, r16
|
|
372: 81 93 st Z+, r24
|
|
374: 8f 01 movw r16, r30
|
|
// Laenge auslesen
|
|
uint8_t length = spi_putc(0xff) & 0x0f;
|
|
p_message->length = length;
|
|
|
|
// Daten auslesen
|
|
for (uint8_t i=0;i<length;i++) {
|
|
376: ea 15 cp r30, r10
|
|
378: fb 05 cpc r31, r11
|
|
37a: b1 f7 brne .-20 ; 0x368 <_ZN3Can15can_get_messageEP10CANMessage+0xc2>
|
|
p_message->data[i] = spi_putc(0xff);
|
|
}
|
|
|
|
CANPORT_CS |= (1<<CANP_CS);
|
|
37c: 2c 9a sbi 0x05, 4 ; 5
|
|
|
|
if (bit_is_set(status,3)) {
|
|
37e: 89 81 ldd r24, Y+1 ; 0x01
|
|
380: 83 ff sbrs r24, 3
|
|
382: 04 c0 rjmp .+8 ; 0x38c <_ZN3Can15can_get_messageEP10CANMessage+0xe6>
|
|
p_message->rtr = 1;
|
|
384: 81 e0 ldi r24, 0x01 ; 1
|
|
386: f6 01 movw r30, r12
|
|
388: 82 83 std Z+2, r24 ; 0x02
|
|
38a: 02 c0 rjmp .+4 ; 0x390 <_ZN3Can15can_get_messageEP10CANMessage+0xea>
|
|
} else {
|
|
p_message->rtr = 0;
|
|
38c: f6 01 movw r30, r12
|
|
38e: 12 82 std Z+2, r1 ; 0x02
|
|
}
|
|
|
|
// Interrupt Flag loeschen
|
|
if (bit_is_set(status,6)) {
|
|
390: 89 81 ldd r24, Y+1 ; 0x01
|
|
392: 86 ff sbrs r24, 6
|
|
394: 07 c0 rjmp .+14 ; 0x3a4 <_ZN3Can15can_get_messageEP10CANMessage+0xfe>
|
|
mcp2515_bit_modify(CANINTF, (1<<RX0IF), 0);
|
|
396: 20 e0 ldi r18, 0x00 ; 0
|
|
398: 41 e0 ldi r20, 0x01 ; 1
|
|
39a: 6c e2 ldi r22, 0x2C ; 44
|
|
39c: c7 01 movw r24, r14
|
|
39e: 0e 94 1c 01 call 0x238 ; 0x238 <_ZN3Can18mcp2515_bit_modifyEhhh>
|
|
3a2: 06 c0 rjmp .+12 ; 0x3b0 <_ZN3Can15can_get_messageEP10CANMessage+0x10a>
|
|
} else {
|
|
mcp2515_bit_modify(CANINTF, (1<<RX1IF), 0);
|
|
3a4: 20 e0 ldi r18, 0x00 ; 0
|
|
3a6: 42 e0 ldi r20, 0x02 ; 2
|
|
3a8: 6c e2 ldi r22, 0x2C ; 44
|
|
3aa: c7 01 movw r24, r14
|
|
3ac: 0e 94 1c 01 call 0x238 ; 0x238 <_ZN3Can18mcp2515_bit_modifyEhhh>
|
|
}
|
|
|
|
return (status & 0x07);
|
|
3b0: 89 81 ldd r24, Y+1 ; 0x01
|
|
3b2: 87 70 andi r24, 0x07 ; 7
|
|
3b4: 01 c0 rjmp .+2 ; 0x3b8 <_ZN3Can15can_get_messageEP10CANMessage+0x112>
|
|
CANPORT_CS &= ~(1<<CANP_CS); // CS Low
|
|
spi_putc(SPI_READ_RX | 0x04);
|
|
}
|
|
else {
|
|
/* Fehler: Keine neue Nachricht vorhanden */
|
|
return 0xff;
|
|
3b6: 8f ef ldi r24, 0xFF ; 255
|
|
} else {
|
|
mcp2515_bit_modify(CANINTF, (1<<RX1IF), 0);
|
|
}
|
|
|
|
return (status & 0x07);
|
|
}
|
|
3b8: 0f 90 pop r0
|
|
3ba: df 91 pop r29
|
|
3bc: cf 91 pop r28
|
|
3be: 1f 91 pop r17
|
|
3c0: 0f 91 pop r16
|
|
3c2: ff 90 pop r15
|
|
3c4: ef 90 pop r14
|
|
3c6: df 90 pop r13
|
|
3c8: cf 90 pop r12
|
|
3ca: bf 90 pop r11
|
|
3cc: af 90 pop r10
|
|
3ce: 08 95 ret
|
|
|
|
000003d0 <_ZN3Led4initEv>:
|
|
Led::Led() {
|
|
init();
|
|
}
|
|
|
|
void Led::init() {
|
|
LEDDDR |= (1<<LEDPINR) | (1<<LEDPING) | (1<<LEDPINB);
|
|
3d0: 84 b1 in r24, 0x04 ; 4
|
|
3d2: 80 6e ori r24, 0xE0 ; 224
|
|
3d4: 84 b9 out 0x04, r24 ; 4
|
|
3d6: 08 95 ret
|
|
|
|
000003d8 <_ZN3LedC1Ev>:
|
|
#define LEDPING PINC6
|
|
#define LEDPINB PINC7
|
|
#define LEDPINM PINC5
|
|
|
|
Led::Led() {
|
|
init();
|
|
3d8: 0e 94 e8 01 call 0x3d0 ; 0x3d0 <_ZN3Led4initEv>
|
|
3dc: 08 95 ret
|
|
|
|
000003de <_ZN3Led5colorEh>:
|
|
int rgb = 0;
|
|
rgb |= (mask & (1<<0)) ? (1<<0) : (0<<0);
|
|
rgb |= (mask & (1<<1)) ? (1<<1) : (0<<1);
|
|
rgb |= (mask & (1<<2)) ? (1<<2) : (0<<2);
|
|
|
|
LEDPORT &= ~((1<<LEDPINR) | (1<<LEDPING) | (1<<LEDPINB));
|
|
3de: 85 b1 in r24, 0x05 ; 5
|
|
3e0: 8f 71 andi r24, 0x1F ; 31
|
|
3e2: 85 b9 out 0x05, r24 ; 5
|
|
LEDPORT |= (rgb<<LEDPINM);
|
|
3e4: 85 b1 in r24, 0x05 ; 5
|
|
3e6: 62 95 swap r22
|
|
3e8: 66 0f add r22, r22
|
|
3ea: 60 7e andi r22, 0xE0 ; 224
|
|
3ec: 68 2b or r22, r24
|
|
3ee: 65 b9 out 0x05, r22 ; 5
|
|
3f0: 08 95 ret
|
|
|
|
000003f2 <main>:
|
|
Led l;
|
|
Rs232 r;
|
|
Can c;
|
|
|
|
int main(void)
|
|
{
|
|
3f2: cf 93 push r28
|
|
3f4: df 93 push r29
|
|
3f6: cd b7 in r28, 0x3d ; 61
|
|
3f8: de b7 in r29, 0x3e ; 62
|
|
3fa: 2c 97 sbiw r28, 0x0c ; 12
|
|
3fc: 0f b6 in r0, 0x3f ; 63
|
|
3fe: f8 94 cli
|
|
400: de bf out 0x3e, r29 ; 62
|
|
402: 0f be out 0x3f, r0 ; 63
|
|
404: cd bf out 0x3d, r28 ; 61
|
|
l.color(Led::YELLOW);
|
|
406: 66 e0 ldi r22, 0x06 ; 6
|
|
408: 88 e0 ldi r24, 0x08 ; 8
|
|
40a: 91 e0 ldi r25, 0x01 ; 1
|
|
40c: 0e 94 ef 01 call 0x3de ; 0x3de <_ZN3Led5colorEh>
|
|
r.send("bla\n");
|
|
410: 60 e0 ldi r22, 0x00 ; 0
|
|
412: 71 e0 ldi r23, 0x01 ; 1
|
|
414: 87 e0 ldi r24, 0x07 ; 7
|
|
416: 91 e0 ldi r25, 0x01 ; 1
|
|
418: 0e 94 70 02 call 0x4e0 ; 0x4e0 <_ZN5Rs2324sendEPc>
|
|
CANMessage m;
|
|
m.id = 0x0123;
|
|
41c: 83 e2 ldi r24, 0x23 ; 35
|
|
41e: 91 e0 ldi r25, 0x01 ; 1
|
|
420: 9a 83 std Y+2, r25 ; 0x02
|
|
422: 89 83 std Y+1, r24 ; 0x01
|
|
m.rtr = 0;
|
|
424: 1b 82 std Y+3, r1 ; 0x03
|
|
m.length = 2;
|
|
426: 82 e0 ldi r24, 0x02 ; 2
|
|
428: 8c 83 std Y+4, r24 ; 0x04
|
|
m.data[0] = 0xAF;
|
|
42a: 8f ea ldi r24, 0xAF ; 175
|
|
42c: 8d 83 std Y+5, r24 ; 0x05
|
|
m.data[1] = 0xFE;
|
|
42e: 8e ef ldi r24, 0xFE ; 254
|
|
430: 8e 83 std Y+6, r24 ; 0x06
|
|
while(1)
|
|
{
|
|
l.color(Led::GREEN);
|
|
432: 62 e0 ldi r22, 0x02 ; 2
|
|
434: 88 e0 ldi r24, 0x08 ; 8
|
|
436: 91 e0 ldi r25, 0x01 ; 1
|
|
438: 0e 94 ef 01 call 0x3de ; 0x3de <_ZN3Led5colorEh>
|
|
43c: 2f ef ldi r18, 0xFF ; 255
|
|
43e: 83 ed ldi r24, 0xD3 ; 211
|
|
440: 90 e3 ldi r25, 0x30 ; 48
|
|
442: 21 50 subi r18, 0x01 ; 1
|
|
444: 80 40 sbci r24, 0x00 ; 0
|
|
446: 90 40 sbci r25, 0x00 ; 0
|
|
448: e1 f7 brne .-8 ; 0x442 <main+0x50>
|
|
44a: 00 c0 rjmp .+0 ; 0x44c <main+0x5a>
|
|
44c: 00 00 nop
|
|
//c.can_send_message(&m);
|
|
//l.color(Led::BLACK);
|
|
//_delay_ms(100);
|
|
//l.color(Led::GREEN);
|
|
|
|
uint8_t r = c.can_get_message(&m);
|
|
44e: be 01 movw r22, r28
|
|
450: 6f 5f subi r22, 0xFF ; 255
|
|
452: 7f 4f sbci r23, 0xFF ; 255
|
|
454: 86 e0 ldi r24, 0x06 ; 6
|
|
456: 91 e0 ldi r25, 0x01 ; 1
|
|
458: 0e 94 53 01 call 0x2a6 ; 0x2a6 <_ZN3Can15can_get_messageEP10CANMessage>
|
|
if(r == 0xFF) {
|
|
45c: 8f 3f cpi r24, 0xFF ; 255
|
|
45e: 61 f4 brne .+24 ; 0x478 <main+0x86>
|
|
l.color(Led::RED);
|
|
460: 64 e0 ldi r22, 0x04 ; 4
|
|
462: 88 e0 ldi r24, 0x08 ; 8
|
|
464: 91 e0 ldi r25, 0x01 ; 1
|
|
466: 0e 94 ef 01 call 0x3de ; 0x3de <_ZN3Led5colorEh>
|
|
46a: 8f e3 ldi r24, 0x3F ; 63
|
|
46c: 9c e9 ldi r25, 0x9C ; 156
|
|
46e: 01 97 sbiw r24, 0x01 ; 1
|
|
470: f1 f7 brne .-4 ; 0x46e <main+0x7c>
|
|
472: 00 c0 rjmp .+0 ; 0x474 <main+0x82>
|
|
474: 00 00 nop
|
|
476: dd cf rjmp .-70 ; 0x432 <main+0x40>
|
|
_delay_ms(10);
|
|
} else {
|
|
l.color(Led::BLUE);
|
|
478: 61 e0 ldi r22, 0x01 ; 1
|
|
47a: 88 e0 ldi r24, 0x08 ; 8
|
|
47c: 91 e0 ldi r25, 0x01 ; 1
|
|
47e: 0e 94 ef 01 call 0x3de ; 0x3de <_ZN3Led5colorEh>
|
|
482: 9f ef ldi r25, 0xFF ; 255
|
|
484: 23 ed ldi r18, 0xD3 ; 211
|
|
486: 80 e3 ldi r24, 0x30 ; 48
|
|
488: 91 50 subi r25, 0x01 ; 1
|
|
48a: 20 40 sbci r18, 0x00 ; 0
|
|
48c: 80 40 sbci r24, 0x00 ; 0
|
|
48e: e1 f7 brne .-8 ; 0x488 <main+0x96>
|
|
490: 00 c0 rjmp .+0 ; 0x492 <main+0xa0>
|
|
492: 00 00 nop
|
|
494: ce cf rjmp .-100 ; 0x432 <main+0x40>
|
|
|
|
00000496 <_GLOBAL__sub_I_l>:
|
|
#include "Led.h"
|
|
#include "Rs232.h"
|
|
#include "Can.h"
|
|
#include <util/delay.h>
|
|
|
|
Led l;
|
|
496: 88 e0 ldi r24, 0x08 ; 8
|
|
498: 91 e0 ldi r25, 0x01 ; 1
|
|
49a: 0e 94 ec 01 call 0x3d8 ; 0x3d8 <_ZN3LedC1Ev>
|
|
Rs232 r;
|
|
49e: 87 e0 ldi r24, 0x07 ; 7
|
|
4a0: 91 e0 ldi r25, 0x01 ; 1
|
|
4a2: 0e 94 6d 02 call 0x4da ; 0x4da <_ZN5Rs232C1Ev>
|
|
Can c;
|
|
4a6: 86 e0 ldi r24, 0x06 ; 6
|
|
4a8: 91 e0 ldi r25, 0x01 ; 1
|
|
4aa: 0e 94 07 01 call 0x20e ; 0x20e <_ZN3CanC1Ev>
|
|
4ae: 08 95 ret
|
|
|
|
000004b0 <_ZN5Rs23212uart_putcharEh>:
|
|
init();
|
|
}
|
|
|
|
uint8_t Rs232::uart_putchar(uint8_t c)
|
|
{
|
|
loop_until_bit_is_set(UCSR1A, UDRE1); //Ausgabe des Zeichens
|
|
4b0: e8 ec ldi r30, 0xC8 ; 200
|
|
4b2: f0 e0 ldi r31, 0x00 ; 0
|
|
4b4: 80 81 ld r24, Z
|
|
4b6: 85 ff sbrs r24, 5
|
|
4b8: fd cf rjmp .-6 ; 0x4b4 <_ZN5Rs23212uart_putcharEh+0x4>
|
|
UDR1 = c;
|
|
4ba: 60 93 ce 00 sts 0x00CE, r22
|
|
return 0;
|
|
}
|
|
4be: 80 e0 ldi r24, 0x00 ; 0
|
|
4c0: 08 95 ret
|
|
|
|
000004c2 <_ZN5Rs2324initEv>:
|
|
|
|
void Rs232::init()
|
|
{
|
|
UCSR1C = (1 << UCSZ11) |(1 << UCSZ10); //8N1
|
|
4c2: 86 e0 ldi r24, 0x06 ; 6
|
|
4c4: 80 93 ca 00 sts 0x00CA, r24
|
|
UCSR1B |= /*(1<<RXEN1) | (1<<RXCIE1) | */ (1<<TXEN1); //Enable TXEN im Register UCR TX-Data Enable
|
|
4c8: e9 ec ldi r30, 0xC9 ; 201
|
|
4ca: f0 e0 ldi r31, 0x00 ; 0
|
|
4cc: 80 81 ld r24, Z
|
|
4ce: 88 60 ori r24, 0x08 ; 8
|
|
4d0: 80 83 st Z, r24
|
|
UBRR1L = (F_CPU / (BAUD_RATE * 16L) - 1); //Teiler wird gesetzt
|
|
4d2: 87 e6 ldi r24, 0x67 ; 103
|
|
4d4: 80 93 cc 00 sts 0x00CC, r24
|
|
4d8: 08 95 ret
|
|
|
|
000004da <_ZN5Rs232C1Ev>:
|
|
*/
|
|
|
|
#include "Rs232.h"
|
|
|
|
Rs232::Rs232() {
|
|
init();
|
|
4da: 0e 94 61 02 call 0x4c2 ; 0x4c2 <_ZN5Rs2324initEv>
|
|
4de: 08 95 ret
|
|
|
|
000004e0 <_ZN5Rs2324sendEPc>:
|
|
UCSR1C = (1 << UCSZ11) |(1 << UCSZ10); //8N1
|
|
UCSR1B |= /*(1<<RXEN1) | (1<<RXCIE1) | */ (1<<TXEN1); //Enable TXEN im Register UCR TX-Data Enable
|
|
UBRR1L = (F_CPU / (BAUD_RATE * 16L) - 1); //Teiler wird gesetzt
|
|
}
|
|
|
|
void Rs232::send(char * text) {
|
|
4e0: 0f 93 push r16
|
|
4e2: 1f 93 push r17
|
|
4e4: cf 93 push r28
|
|
4e6: df 93 push r29
|
|
4e8: 8c 01 movw r16, r24
|
|
4ea: eb 01 movw r28, r22
|
|
while (*text)
|
|
4ec: 68 81 ld r22, Y
|
|
4ee: 66 23 and r22, r22
|
|
4f0: 39 f0 breq .+14 ; 0x500 <__stack+0x1>
|
|
UCSR1C = (1 << UCSZ11) |(1 << UCSZ10); //8N1
|
|
UCSR1B |= /*(1<<RXEN1) | (1<<RXCIE1) | */ (1<<TXEN1); //Enable TXEN im Register UCR TX-Data Enable
|
|
UBRR1L = (F_CPU / (BAUD_RATE * 16L) - 1); //Teiler wird gesetzt
|
|
}
|
|
|
|
void Rs232::send(char * text) {
|
|
4f2: 21 96 adiw r28, 0x01 ; 1
|
|
while (*text)
|
|
{
|
|
uart_putchar(*text);
|
|
4f4: c8 01 movw r24, r16
|
|
4f6: 0e 94 58 02 call 0x4b0 ; 0x4b0 <_ZN5Rs23212uart_putcharEh>
|
|
UCSR1B |= /*(1<<RXEN1) | (1<<RXCIE1) | */ (1<<TXEN1); //Enable TXEN im Register UCR TX-Data Enable
|
|
UBRR1L = (F_CPU / (BAUD_RATE * 16L) - 1); //Teiler wird gesetzt
|
|
}
|
|
|
|
void Rs232::send(char * text) {
|
|
while (*text)
|
|
4fa: 69 91 ld r22, Y+
|
|
4fc: 61 11 cpse r22, r1
|
|
4fe: fa cf rjmp .-12 ; 0x4f4 <_ZN5Rs2324sendEPc+0x14>
|
|
{
|
|
uart_putchar(*text);
|
|
text++;
|
|
}
|
|
500: df 91 pop r29
|
|
502: cf 91 pop r28
|
|
504: 1f 91 pop r17
|
|
506: 0f 91 pop r16
|
|
508: 08 95 ret
|
|
|
|
0000050a <__tablejump2__>:
|
|
50a: ee 0f add r30, r30
|
|
50c: ff 1f adc r31, r31
|
|
|
|
0000050e <__tablejump__>:
|
|
50e: 05 90 lpm r0, Z+
|
|
510: f4 91 lpm r31, Z
|
|
512: e0 2d mov r30, r0
|
|
514: 09 94 ijmp
|
|
|
|
00000516 <_exit>:
|
|
516: f8 94 cli
|
|
|
|
00000518 <__stop_program>:
|
|
518: ff cf rjmp .-2 ; 0x518 <__stop_program>
|