20131111-181005

This commit is contained in:
BlubbFish 2013-11-11 17:10:07 +00:00
parent b275a520fa
commit 2ffd4de5f4
16 changed files with 1045 additions and 884 deletions

Binary file not shown.

View File

@ -21,6 +21,7 @@ typedef struct
uint8_t data[8];
} CANMessage;
template <typename Spi>
class Can {
private:
void init_can();
@ -29,9 +30,8 @@ class Can {
uint8_t mcp2515_read_register(uint8_t adress);
void mcp2515_bit_modify(uint8_t adress, uint8_t mask, uint8_t data);
uint8_t mcp2515_read_rx_status(void);
Spi s;
public:
Can(Spi spi);
Can();
uint8_t can_send_message(CANMessage *p_message);
uint8_t can_get_message(CANMessage *p_message);
};

View File

@ -1,4 +1,5 @@
Mainboard.d Mainboard.o: .././Mainboard.cpp .././config.h .././Led.h \
.././portc.hpp \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/io.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/sfr_defs.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/inttypes.h \
@ -10,7 +11,7 @@ Mainboard.d Mainboard.o: .././Mainboard.cpp .././config.h .././Led.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/version.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/fuse.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/lock.h \
.././Rs232.h \
.././pin.hpp .././Rs232.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/stdio.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/include/stdarg.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/include/stddef.h \
@ -18,12 +19,14 @@ Mainboard.d Mainboard.o: .././Mainboard.cpp .././config.h .././Led.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay_basic.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h \
.././mcp2515_defs.h .././Spi.h
.././mcp2515_defs.h .././Spi.h .././portb.hpp
.././config.h:
.././Led.h:
.././portc.hpp:
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/io.h:
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/sfr_defs.h:
@ -46,6 +49,8 @@ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/lock.h:
.././pin.hpp:
.././Rs232.h:
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/stdio.h:
@ -65,3 +70,5 @@ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-
.././mcp2515_defs.h:
.././Spi.h:
.././portb.hpp:

View File

@ -5,20 +5,20 @@
:100040000C9463000C9463000C9463000C946300A4
:100050000C9463000C9463000C9463000C94630094
:100060000C9463000C9463000C9463000C94630084
:100070000C9463005E0211241FBECFEFD4E0DEBFFC
:10008000CDBF11E0A0E0B1E0EAEFF5E002C00590DD
:100070000C946300400211241FBECFEFD4E0DEBF1A
:10008000CDBF11E0A0E0B1E0E4EAF5E002C00590E8
:100090000D92A630B107D9F721E0A6E0B1E001C08A
:1000A0001D92AB30B207E1F710E0C6E7D0E004C024
:1000B0002297FE010E94F702C437D107C9F70E94B8
:1000C00009020C94FB020C940000FF920F931F9303
:1000A0001D92A930B207E1F710E0C6E7D0E004C026
:1000B0002297FE010E94CC02C437D107C9F70E94E3
:1000C000F9010C94D0020C940000FF920F931F933F
:1000D000CF93DF931F92CDB7DEB7F82E092F162FDF
:1000E00049830E94C40262E08F2D902F0E94E90292
:1000F000612F8F2D902F0E94E9024981642F8F2D4F
:10010000902F0E94E9028F2D902F0F90DF91CF91B9
:100110001F910F91FF900C94C202CF93DF93D82FC1
:10012000C92F0E94C40260EC8D2F9C2F0E94E9020F
:1000E00049830E949A0262E08F2D902F0E94BE02E7
:1000F000612F8F2D902F0E94BE024981642F8F2D7A
:10010000902F0E94BE028F2D902F0F90DF91CF91E4
:100110001F910F91FF900C949702CF93DF93D82FEC
:10012000C92F0E949A0260EC8D2F9C2F0E94BE0264
:100130008FE99FE00197F1F700C000008D2F9C2F01
:100140000E94C2028FE39CE90197F1F700C0000012
:100140000E9497028FE39CE90197F1F700C000003D
:1001500047E06AE28D2F9C2F0E94650040E969E22A
:100160008D2F9C2F0E94650042E068E28D2F9C2F0E
:100170000E94650043E06BE28D2F9C2F0E9465007A
@ -30,69 +30,64 @@
:1001D0000E94650040E065E28D2F9C2F0E94650023
:1001E00040E066E28D2F9C2F0E94650040E067E2B0
:1001F0008D2F9C2F0E94650040E06CE08D2F9C2F7E
:10020000DF91CF910C946500FC01408351836283A0
:100210000C948D00FF920F931F93CF93DF9300D028
:10022000CDB7DEB7F82E092F162F2A8349830E94F7
:10023000C40265E08F2D902F0E94E902612F8F2D5F
:10024000902F0E94E9024981642F8F2D902F0E94E8
:10025000E9022A81622F8F2D902F0E94E9028F2DB3
:10026000902F0F900F90DF91CF911F910F91FF90E2
:100270000C94C2021F93CF93DF93D82FC92F0E94F3
:10028000C40260EB8D2F9C2F0E94E9026FEF8D2F2F
:100290009C2F0E94E902182F6FEF8D2F9C2F0E9438
:1002A000E9028D2F9C2F0E94C202812FDF91CF91F6
:1002B0001F9108959F92AF92BF92CF92DF92EF92DB
:1002C000FF920F931F93CF93DF931F92CDB7DEB7AB
:1002D0005C016B010E943A01982E8983898186FD19
:1002E00011C0898187FD7FC08FEF0F90DF91CF9183
:1002F0001F910F91FF90EF90DF90CF90BF90AF9044
:100300009F900895C5010E94C40260E9C5010E9442
:10031000E9026FEFC5010E94E902282F30E0220FA9
:10032000331F220F331F220F331FF6013183208327
:100330006FEFC5010E94E902482F50E0569547959E
:10034000529542954F7045275F704527F6012081F1
:100350003181242B352B318320836FEFC5010E941F
:10036000E9026FEFC5010E94E9026FEFC5010E942B
:10037000E9028F70F60183838823A1F086010C5F68
:100380001F4F7601F5E0EF0EF11C8150E80EF11CD5
:100390006FEFC5010E94E902F80181938F01EE150C
:1003A000FF05B1F7C5010E94C202898183FD0EC01D
:1003B000F6011282898120E086FF0FC041E06CE2E5
:1003C000C5010E940A01892D87708FCF81E0F60157
:1003D0008283898120E086FDF1CF42E06CE2C50195
:1003E0000E940A01F0CFC5010E94C40264E9C50160
:1003F0000E94E9028ECF84B1806E84B9089585B1E0
:100400008F7185B985B16295660F607E682B65B97D
:100410000895CF93DF93CDB7DEB72C970FB6F8943E
:10042000DEBF0FBECDBF66E08AE091E00E94FF0113
:1004300060E071E089E091E00E948A0283E291E04D
:100440009A8389831B8282E08C838FEA8D838EEF6F
:100450008E830EC061E08AE091E00E94FF012FEFE1
:1004600083ED90E3215080409040E1F700C0000010
:1004700062E08AE091E00E94FF012FEF81EE94E0BC
:10048000215080409040E1F700C00000BE016F5F46
:100490007F4F86E091E00E945A018F3FD9F664E0D9
:1004A0008AE091E00E94FF012FEF81EE94E021505D
:1004B00080409040E1F700C00000DACFCF93DF9397
:1004C00000D01F92CDB7DEB78AE091E00E94FB0119
:1004D00089E091E00E947E0260E0CE0101960E94D8
:1004E000B90249815A816B8186E091E00E94040142
:1004F0000F900F900F90DF91CF91089586E0809339
:10050000CA00E9ECF0E080818860808387E6809310
:10051000CC000895FB019081992351F03196809190
:10052000C80085FFFCCF9093CE0091919111F7CF39
:10053000089524B1266124B9239825B1217F25B9D6
:10054000DC011196ED91FC9112978081817F80836F
:100550002C9A0895CF93DF93EC010E949902888131
:10056000811104C080E58CBD81E08DBDDF91CF910C
:10057000089521E0FC01208325E230E032832183CD
:100580000C94AA022C9A08952C98089598E080E083
:1005900060FD2A9A60FF2A9829986695000000005D
:1005A000000000000000000000000000000000004B
:1005B000000000000000000000000000299A000078
:1005C00023B123FB222720F9880F822B915001F7BA
:1005D0000895FC012081211106C06EBD0DB407FEF7
:1005E000FDCF8EB508950C94C602EE0FFF1F059047
:0A05F000F491E02D0994F894FFCF78
:0605FA00626C610A0000C2
:10020000DF91CF910C946500FC0160830C948D000C
:10021000FF920F931F93CF93DF9300D0CDB7DEB73C
:10022000F82E092F162F2A8349830E949A0265E02F
:100230008F2D902F0E94BE02612F8F2D902F0E9434
:10024000BE024981642F8F2D902F0E94BE022A8109
:10025000622F8F2D902F0E94BE028F2D902F0F9016
:100260000F90DF91CF911F910F91FF900C94970207
:100270001F93CF93DF93D82FC92F0E949A0260EB70
:100280008D2F9C2F0E94BE026FEF8D2F9C2F0E94FE
:10029000BE02182F6FEF8D2F9C2F0E94BE028D2F54
:1002A0009C2F0E949702812FDF91CF911F9108957B
:1002B0009F92AF92BF92CF92DF92EF92FF920F93F5
:1002C0001F93CF93DF931F92CDB7DEB75C016B0115
:1002D0000E943801982E8983898186FD11C0898109
:1002E00087FD7FC08FEF0F90DF91CF911F910F910E
:1002F000FF90EF90DF90CF90BF90AF909F900895C8
:10030000C5010E949A0260E9C5010E94BE026FEF1A
:10031000C5010E94BE02282F30E0220F331F220F9A
:10032000331F220F331FF601318320836FEFC50186
:100330000E94BE02482F50E056954795529542952F
:100340004F7045275F704527F60120813181242BAE
:10035000352B318320836FEFC5010E94BE026FEF02
:10036000C5010E94BE026FEFC5010E94BE028F70E0
:10037000F60183838823A1F086010C5F1F4F76016D
:10038000F5E0EF0EF11C8150E80EF11C6FEFC50196
:100390000E94BE02F80181938F01EE15FF05B1F7AF
:1003A000C5010E949702898183FD0EC0F601128269
:1003B000898120E086FF0FC041E06CE2C5010E9408
:1003C0000801892D87708FCF81E0F60182838981B2
:1003D00020E086FDF1CF42E06CE2C5010E940801F9
:1003E000F0CFC5010E949A0264E9C5010E94BE02D5
:1003F0008ECFCF93DF93CDB7DEB72C970FB6F8949F
:10040000DEBF0FBECDBF47983F9A469A3E9A459AA7
:100410003D9A60E071E087E091E00E94660283E22D
:1004200091E09A8389831B8282E08C838FEA8D839B
:100430008EEF8E8309C02FEF83ED90E32150804033
:100440009040E1F700C000002FEF81EE94E02150D2
:1004500080409040E1F700C00000BE016F5F7F4F19
:1004600086E091E00E9458018F3F29F72FEF81EE3F
:1004700094E0215080409040E1F700C00000E4CFBC
:10048000CF93DF931F92CDB7DEB73D9A3E9A3F9A46
:1004900087E091E00E945A0260E0CE0101960E943E
:1004A0009202698186E091E00E9404010F90DF9141
:1004B000CF91089586E08093CA00E9ECF0E0808156
:1004C0008860808387E68093CC000895FB0190814B
:1004D000992351F031968091C80085FFFCCF90930D
:1004E000CE0091919111F7CF0895229A2A98229ADD
:1004F000219A2998219A249A2C9A249A23982B9805
:100500002B98239A0895CF93DF93EC010E947502F4
:100510008881811104C080E58CBD81E08DBDDF91B3
:10052000CF91089521E0FC0120830C9483022C9A42
:10053000249A08952C98249A089598E080E015C094
:100540002A98229A25E02A95F1F700001B998160EC
:1005500025E02A95F1F70000299A219A2AE02A95A8
:10056000F1F700C0660F915041F0880F2998219A49
:1005700067FFE6CF2A9A229AE5CF0895FC012081F1
:10058000211106C06EBD0DB407FEFDCF8EB50895D6
:100590000C949D02EE0FFF1F0590F491E02D09943D
:0405A000F894FFCFFD
:0605A400626C610A000018
:00000001FF

File diff suppressed because it is too large Load Diff

View File

@ -22,14 +22,6 @@ Discarded input sections
0x00000000 0x154 Can.o
.text 0x00000000 0x0 Led.o
.bss 0x00000000 0x0 Led.o
.text._ZN3Led4initEv
0x00000000 0x8 Led.o
.text._ZN3Led6uninitEv
0x00000000 0x2 Led.o
.text._ZN3Led4fadeEiii
0x00000000 0x68 Led.o
.text._ZN3Led7rainbowEh
0x00000000 0x7a Led.o
.text 0x00000000 0x0 Mainboard.o
.text 0x00000000 0x0 Rs232.o
.bss 0x00000000 0x0 Rs232.o
@ -228,7 +220,7 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
.rela.plt
*(.rela.plt)
.text 0x00000000 0x5fa
.text 0x00000000 0x5a4
*(.vectors)
.vectors 0x00000000 0x74 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr35/crtm32u2.o
0x00000000 __vector_default
@ -325,67 +317,60 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
0x0000011a 0xee Can.o
0x0000011a _ZN3Can8init_canEv
.text._ZN3CanC2E3Spi
0x00000208 0xc Can.o
0x00000208 0x8 Can.o
0x00000208 _ZN3CanC2E3Spi
0x00000208 _ZN3CanC1E3Spi
.text._ZN3Can18mcp2515_bit_modifyEhhh
0x00000214 0x60 Can.o
0x00000214 _ZN3Can18mcp2515_bit_modifyEhhh
0x00000210 0x60 Can.o
0x00000210 _ZN3Can18mcp2515_bit_modifyEhhh
.text._ZN3Can22mcp2515_read_rx_statusEv
0x00000274 0x40 Can.o
0x00000274 _ZN3Can22mcp2515_read_rx_statusEv
0x00000270 0x40 Can.o
0x00000270 _ZN3Can22mcp2515_read_rx_statusEv
.text._ZN3Can15can_get_messageEP10CANMessage
0x000002b4 0x142 Can.o
0x000002b4 _ZN3Can15can_get_messageEP10CANMessage
.text._ZN3LedC2Ev
0x000003f6 0x8 Led.o
0x000003f6 _ZN3LedC1Ev
0x000003f6 _ZN3LedC2Ev
.text._ZN3Led5colorEh
0x000003fe 0x14 Led.o
0x000003fe _ZN3Led5colorEh
0x000002b0 0x142 Can.o
0x000002b0 _ZN3Can15can_get_messageEP10CANMessage
.text.startup.main
0x00000412 0xaa Mainboard.o
0x00000412 main
0x000003f2 0x8e Mainboard.o
0x000003f2 main
.text.startup._GLOBAL__sub_I_l
0x000004bc 0x40 Mainboard.o
0x00000480 0x34 Mainboard.o
.text._ZN5Rs232C2Ev
0x000004fc 0x18 Rs232.o
0x000004fc _ZN5Rs232C2Ev
0x000004fc _ZN5Rs232C1Ev
0x000004b4 0x18 Rs232.o
0x000004b4 _ZN5Rs232C2Ev
0x000004b4 _ZN5Rs232C1Ev
.text._ZN5Rs2324sendEPKc
0x00000514 0x1e Rs232.o
0x00000514 _ZN5Rs2324sendEPKc
0x000004cc 0x1e Rs232.o
0x000004cc _ZN5Rs2324sendEPKc
.text._ZN3Spi9init_portEv
0x00000532 0x22 Spi.o
0x00000532 _ZN3Spi9init_portEv
0x000004ea 0x1c Spi.o
0x000004ea _ZN3Spi9init_portEv
.text._ZN3Spi4initEv
0x00000554 0x1e Spi.o
0x00000554 _ZN3Spi4initEv
0x00000506 0x1e Spi.o
0x00000506 _ZN3Spi4initEv
.text._ZN3SpiC2Eh
0x00000572 0x12 Spi.o
0x00000572 _ZN3SpiC1Eh
0x00000572 _ZN3SpiC2Eh
0x00000524 0xa Spi.o
0x00000524 _ZN3SpiC1Eh
0x00000524 _ZN3SpiC2Eh
.text._ZN3Spi5CSOffEv
0x00000584 0x4 Spi.o
0x00000584 _ZN3Spi5CSOffEv
0x0000052e 0x6 Spi.o
0x0000052e _ZN3Spi5CSOffEv
.text._ZN3Spi4CSOnEv
0x00000588 0x4 Spi.o
0x00000588 _ZN3Spi4CSOnEv
0x00000534 0x6 Spi.o
0x00000534 _ZN3Spi4CSOnEv
.text._ZN3Spi9send_softEh
0x0000058c 0x46 Spi.o
0x0000058c _ZN3Spi9send_softEh
0x0000053a 0x42 Spi.o
0x0000053a _ZN3Spi9send_softEh
.text._ZN3Spi4sendEh
0x000005d2 0x18 Spi.o
0x000005d2 _ZN3Spi4sendEh
.text.libgcc 0x000005ea 0xc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr35\libgcc.a(_tablejump.o)
0x000005ea __tablejump2__
0x000005ee __tablejump__
0x000005f6 . = ALIGN (0x2)
0x0000057c 0x18 Spi.o
0x0000057c _ZN3Spi4sendEh
.text.libgcc 0x00000594 0xc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr35\libgcc.a(_tablejump.o)
0x00000594 __tablejump2__
0x00000598 __tablejump__
0x000005a0 . = ALIGN (0x2)
*(.fini9)
.fini9 0x000005f6 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr35\libgcc.a(_exit.o)
0x000005f6 _exit
0x000005f6 exit
.fini9 0x000005a0 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr35\libgcc.a(_exit.o)
0x000005a0 _exit
0x000005a0 exit
*(.fini9)
*(.fini8)
*(.fini8)
@ -404,11 +389,11 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
*(.fini1)
*(.fini1)
*(.fini0)
.fini0 0x000005f6 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr35\libgcc.a(_exit.o)
.fini0 0x000005a0 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr35\libgcc.a(_exit.o)
*(.fini0)
0x000005fa _etext = .
0x000005a4 _etext = .
.data 0x00800100 0x6 load address 0x000005fa
.data 0x00800100 0x6 load address 0x000005a4
0x00800100 PROVIDE (__data_start, .)
*(.data)
.data 0x00800100 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr35/crtm32u2.o
@ -433,25 +418,25 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
0x00800106 _edata = .
0x00800106 PROVIDE (__data_end, .)
.bss 0x00800106 0x5
.bss 0x00800106 0x3
0x00800106 PROVIDE (__bss_start, .)
*(.bss)
.bss 0x00800106 0x5 Mainboard.o
.bss 0x00800106 0x3 Mainboard.o
0x00800106 c
0x00800109 r
0x0080010a l
0x00800107 r
0x00800108 l
*(.bss*)
*(COMMON)
0x0080010b PROVIDE (__bss_end, .)
0x000005fa __data_load_start = LOADADDR (.data)
0x00000600 __data_load_end = (__data_load_start + SIZEOF (.data))
0x00800109 PROVIDE (__bss_end, .)
0x000005a4 __data_load_start = LOADADDR (.data)
0x000005aa __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x0080010b 0x0
0x0080010b PROVIDE (__noinit_start, .)
.noinit 0x00800109 0x0
0x00800109 PROVIDE (__noinit_start, .)
*(.noinit*)
0x0080010b PROVIDE (__noinit_end, .)
0x0080010b _end = .
0x0080010b PROVIDE (__heap_start, .)
0x00800109 PROVIDE (__noinit_end, .)
0x00800109 _end = .
0x00800109 PROVIDE (__heap_start, .)
.eeprom 0x00810000 0x0
*(.eeprom*)
@ -513,75 +498,73 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
.debug_sfnames
*(.debug_sfnames)
.debug_aranges 0x00000000 0x160
.debug_aranges 0x00000000 0x130
*(.debug_aranges)
.debug_aranges
0x00000000 0x58 Can.o
.debug_aranges
0x00000058 0x48 Led.o
0x00000058 0x18 Led.o
.debug_aranges
0x000000a0 0x28 Mainboard.o
0x00000070 0x28 Mainboard.o
.debug_aranges
0x000000c8 0x38 Rs232.o
0x00000098 0x38 Rs232.o
.debug_aranges
0x00000100 0x60 Spi.o
0x000000d0 0x60 Spi.o
.debug_pubnames
*(.debug_pubnames)
.debug_info 0x00000000 0x233b
.debug_info 0x00000000 0x31fa
*(.debug_info)
.debug_info 0x00000000 0xdff Can.o
.debug_info 0x00000dff 0x564 Led.o
.debug_info 0x00001363 0x8d5 Mainboard.o
.debug_info 0x00001c38 0x27a Rs232.o
.debug_info 0x00001eb2 0x489 Spi.o
.debug_info 0x00000000 0xdec Can.o
.debug_info 0x00000dec 0x5d Led.o
.debug_info 0x00000e49 0xf68 Mainboard.o
.debug_info 0x00001db1 0x27a Rs232.o
.debug_info 0x0000202b 0x11cf Spi.o
*(.gnu.linkonce.wi.*)
.debug_abbrev 0x00000000 0xc52
.debug_abbrev 0x00000000 0xc55
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x350 Can.o
.debug_abbrev 0x00000350 0x22c Led.o
.debug_abbrev 0x0000057c 0x33d Mainboard.o
.debug_abbrev 0x000008b9 0x15b Rs232.o
.debug_abbrev 0x00000a14 0x23e Spi.o
.debug_abbrev 0x00000000 0x354 Can.o
.debug_abbrev 0x00000354 0x31 Led.o
.debug_abbrev 0x00000385 0x414 Mainboard.o
.debug_abbrev 0x00000799 0x15b Rs232.o
.debug_abbrev 0x000008f4 0x361 Spi.o
.debug_line 0x00000000 0x8ce
.debug_line 0x00000000 0x88d
*(.debug_line)
.debug_line 0x00000000 0x2b3 Can.o
.debug_line 0x000002b3 0x16e Led.o
.debug_line 0x00000421 0x1d8 Mainboard.o
.debug_line 0x000005f9 0x122 Rs232.o
.debug_line 0x0000071b 0x1b3 Spi.o
.debug_line 0x00000000 0x2be Can.o
.debug_line 0x000002be 0x2c Led.o
.debug_line 0x000002ea 0x1f6 Mainboard.o
.debug_line 0x000004e0 0x122 Rs232.o
.debug_line 0x00000602 0x28b Spi.o
.debug_frame 0x00000000 0x35c
.debug_frame 0x00000000 0x2d8
*(.debug_frame)
.debug_frame 0x00000000 0x180 Can.o
.debug_frame 0x00000180 0x84 Led.o
.debug_frame 0x00000204 0x54 Mainboard.o
.debug_frame 0x00000258 0x54 Rs232.o
.debug_frame 0x000002ac 0xb0 Spi.o
.debug_frame 0x00000180 0x54 Mainboard.o
.debug_frame 0x000001d4 0x54 Rs232.o
.debug_frame 0x00000228 0xb0 Spi.o
.debug_str 0x00000000 0x54c
.debug_str 0x00000000 0xf02
*(.debug_str)
.debug_str 0x00000000 0x38c Can.o
0x3e4 (size before relaxing)
.debug_str 0x0000038c 0xbb Led.o
0x185 (size before relaxing)
.debug_str 0x00000447 0xbe Mainboard.o
0x4f9 (size before relaxing)
.debug_str 0x00000505 0x22 Rs232.o
.debug_str 0x00000000 0x38b Can.o
0x3e3 (size before relaxing)
.debug_str 0x0000038b 0xd Led.o
0xc7 (size before relaxing)
.debug_str 0x00000398 0x618 Mainboard.o
0x9d0 (size before relaxing)
.debug_str 0x000009b0 0x22 Rs232.o
0x14b (size before relaxing)
.debug_str 0x00000527 0x25 Spi.o
0x1c8 (size before relaxing)
.debug_str 0x000009d2 0x530 Spi.o
0x757 (size before relaxing)
.debug_loc 0x00000000 0xdbb
.debug_loc 0x00000000 0xc7f
*(.debug_loc)
.debug_loc 0x00000000 0x6f2 Can.o
.debug_loc 0x000006f2 0x2c1 Led.o
.debug_loc 0x000009b3 0x16d Mainboard.o
.debug_loc 0x00000b20 0x8a Rs232.o
.debug_loc 0x00000baa 0x211 Spi.o
.debug_loc 0x00000000 0x6ea Can.o
.debug_loc 0x000006ea 0xf5 Mainboard.o
.debug_loc 0x000007df 0x8a Rs232.o
.debug_loc 0x00000869 0x416 Spi.o
.debug_macinfo
*(.debug_macinfo)
@ -589,13 +572,12 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
.debug_pubtypes
*(.debug_pubtypes)
.debug_ranges 0x00000000 0x188
.debug_ranges 0x00000000 0x120
*(.debug_ranges)
.debug_ranges 0x00000000 0x90 Can.o
.debug_ranges 0x00000090 0x68 Led.o
.debug_ranges 0x000000f8 0x18 Mainboard.o
.debug_ranges 0x00000110 0x28 Rs232.o
.debug_ranges 0x00000138 0x50 Spi.o
.debug_ranges 0x00000090 0x18 Mainboard.o
.debug_ranges 0x000000a8 0x28 Rs232.o
.debug_ranges 0x000000d0 0x50 Spi.o
.debug_macro
*(.debug_macro)

View File

@ -6,20 +6,20 @@ S11300300C9463000C9463000C9463000C946300B0
S11300400C9463000C9463000C9463000C946300A0
S11300500C9463000C9463000C9463000C94630090
S11300600C9463000C9463000C9463000C94630080
S11300700C9463005E0211241FBECFEFD4E0DEBFF8
S1130080CDBF11E0A0E0B1E0EAEFF5E002C00590D9
S11300700C946300400211241FBECFEFD4E0DEBF16
S1130080CDBF11E0A0E0B1E0E4EAF5E002C00590E4
S11300900D92A630B107D9F721E0A6E0B1E001C086
S11300A01D92AB30B207E1F710E0C6E7D0E004C020
S11300B02297FE010E94F702C437D107C9F70E94B4
S11300C009020C94FB020C940000FF920F931F93FF
S11300A01D92A930B207E1F710E0C6E7D0E004C022
S11300B02297FE010E94CC02C437D107C9F70E94DF
S11300C0F9010C94D0020C940000FF920F931F933B
S11300D0CF93DF931F92CDB7DEB7F82E092F162FDB
S11300E049830E94C40262E08F2D902F0E94E9028E
S11300F0612F8F2D902F0E94E9024981642F8F2D4B
S1130100902F0E94E9028F2D902F0F90DF91CF91B5
S11301101F910F91FF900C94C202CF93DF93D82FBD
S1130120C92F0E94C40260EC8D2F9C2F0E94E9020B
S11300E049830E949A0262E08F2D902F0E94BE02E3
S11300F0612F8F2D902F0E94BE024981642F8F2D76
S1130100902F0E94BE028F2D902F0F90DF91CF91E0
S11301101F910F91FF900C949702CF93DF93D82FE8
S1130120C92F0E949A0260EC8D2F9C2F0E94BE0260
S11301308FE99FE00197F1F700C000008D2F9C2FFD
S11301400E94C2028FE39CE90197F1F700C000000E
S11301400E9497028FE39CE90197F1F700C0000039
S113015047E06AE28D2F9C2F0E94650040E969E226
S11301608D2F9C2F0E94650042E068E28D2F9C2F0A
S11301700E94650043E06BE28D2F9C2F0E94650076
@ -31,69 +31,64 @@ S11301C08D2F9C2F0E94650040E064E28D2F9C2FB0
S11301D00E94650040E065E28D2F9C2F0E9465001F
S11301E040E066E28D2F9C2F0E94650040E067E2AC
S11301F08D2F9C2F0E94650040E06CE08D2F9C2F7A
S1130200DF91CF910C946500FC014083518362839C
S11302100C948D00FF920F931F93CF93DF9300D024
S1130220CDB7DEB7F82E092F162F2A8349830E94F3
S1130230C40265E08F2D902F0E94E902612F8F2D5B
S1130240902F0E94E9024981642F8F2D902F0E94E4
S1130250E9022A81622F8F2D902F0E94E9028F2DAF
S1130260902F0F900F90DF91CF911F910F91FF90DE
S11302700C94C2021F93CF93DF93D82FC92F0E94EF
S1130280C40260EB8D2F9C2F0E94E9026FEF8D2F2B
S11302909C2F0E94E902182F6FEF8D2F9C2F0E9434
S11302A0E9028D2F9C2F0E94C202812FDF91CF91F2
S11302B01F9108959F92AF92BF92CF92DF92EF92D7
S11302C0FF920F931F93CF93DF931F92CDB7DEB7A7
S11302D05C016B010E943A01982E8983898186FD15
S11302E011C0898187FD7FC08FEF0F90DF91CF917F
S11302F01F910F91FF90EF90DF90CF90BF90AF9040
S11303009F900895C5010E94C40260E9C5010E943E
S1130310E9026FEFC5010E94E902282F30E0220FA5
S1130320331F220F331F220F331FF6013183208323
S11303306FEFC5010E94E902482F50E0569547959A
S1130340529542954F7045275F704527F6012081ED
S11303503181242B352B318320836FEFC5010E941B
S1130360E9026FEFC5010E94E9026FEFC5010E9427
S1130370E9028F70F60183838823A1F086010C5F64
S11303801F4F7601F5E0EF0EF11C8150E80EF11CD1
S11303906FEFC5010E94E902F80181938F01EE1508
S11303A0FF05B1F7C5010E94C202898183FD0EC019
S11303B0F6011282898120E086FF0FC041E06CE2E1
S11303C0C5010E940A01892D87708FCF81E0F60153
S11303D08283898120E086FDF1CF42E06CE2C50191
S11303E00E940A01F0CFC5010E94C40264E9C5015C
S11303F00E94E9028ECF84B1806E84B9089585B1DC
S11304008F7185B985B16295660F607E682B65B979
S11304100895CF93DF93CDB7DEB72C970FB6F8943A
S1130420DEBF0FBECDBF66E08AE091E00E94FF010F
S113043060E071E089E091E00E948A0283E291E049
S11304409A8389831B8282E08C838FEA8D838EEF6B
S11304508E830EC061E08AE091E00E94FF012FEFDD
S113046083ED90E3215080409040E1F700C000000C
S113047062E08AE091E00E94FF012FEF81EE94E0B8
S1130480215080409040E1F700C00000BE016F5F42
S11304907F4F86E091E00E945A018F3FD9F664E0D5
S11304A08AE091E00E94FF012FEF81EE94E0215059
S11304B080409040E1F700C00000DACFCF93DF9393
S11304C000D01F92CDB7DEB78AE091E00E94FB0115
S11304D089E091E00E947E0260E0CE0101960E94D4
S11304E0B90249815A816B8186E091E00E9404013E
S11304F00F900F900F90DF91CF91089586E0809335
S1130500CA00E9ECF0E080818860808387E680930C
S1130510CC000895FB019081992351F0319680918C
S1130520C80085FFFCCF9093CE0091919111F7CF35
S1130530089524B1266124B9239825B1217F25B9D2
S1130540DC011196ED91FC9112978081817F80836B
S11305502C9A0895CF93DF93EC010E94990288812D
S1130560811104C080E58CBD81E08DBDDF91CF9108
S1130570089521E0FC01208325E230E032832183C9
S11305800C94AA022C9A08952C98089598E080E07F
S113059060FD2A9A60FF2A98299866950000000059
S11305A00000000000000000000000000000000047
S11305B0000000000000000000000000299A000074
S11305C023B123FB222720F9880F822B915001F7B6
S11305D00895FC012081211106C06EBD0DB407FEF3
S11305E0FDCF8EB508950C94C602EE0FFF1F059043
S10D05F0F491E02D0994F894FFCF74
S10905FA626C610A0000BE
S1130200DF91CF910C946500FC0160830C948D0008
S1130210FF920F931F93CF93DF9300D0CDB7DEB738
S1130220F82E092F162F2A8349830E949A0265E02B
S11302308F2D902F0E94BE02612F8F2D902F0E9430
S1130240BE024981642F8F2D902F0E94BE022A8105
S1130250622F8F2D902F0E94BE028F2D902F0F9012
S11302600F90DF91CF911F910F91FF900C94970203
S11302701F93CF93DF93D82FC92F0E949A0260EB6C
S11302808D2F9C2F0E94BE026FEF8D2F9C2F0E94FA
S1130290BE02182F6FEF8D2F9C2F0E94BE028D2F50
S11302A09C2F0E949702812FDF91CF911F91089577
S11302B09F92AF92BF92CF92DF92EF92FF920F93F1
S11302C01F93CF93DF931F92CDB7DEB75C016B0111
S11302D00E943801982E8983898186FD11C0898105
S11302E087FD7FC08FEF0F90DF91CF911F910F910A
S11302F0FF90EF90DF90CF90BF90AF909F900895C4
S1130300C5010E949A0260E9C5010E94BE026FEF16
S1130310C5010E94BE02282F30E0220F331F220F96
S1130320331F220F331FF601318320836FEFC50182
S11303300E94BE02482F50E056954795529542952B
S11303404F7045275F704527F60120813181242BAA
S1130350352B318320836FEFC5010E94BE026FEFFE
S1130360C5010E94BE026FEFC5010E94BE028F70DC
S1130370F60183838823A1F086010C5F1F4F760169
S1130380F5E0EF0EF11C8150E80EF11C6FEFC50192
S11303900E94BE02F80181938F01EE15FF05B1F7AB
S11303A0C5010E949702898183FD0EC0F601128265
S11303B0898120E086FF0FC041E06CE2C5010E9404
S11303C00801892D87708FCF81E0F60182838981AE
S11303D020E086FDF1CF42E06CE2C5010E940801F5
S11303E0F0CFC5010E949A0264E9C5010E94BE02D1
S11303F08ECFCF93DF93CDB7DEB72C970FB6F8949B
S1130400DEBF0FBECDBF47983F9A469A3E9A459AA3
S11304103D9A60E071E087E091E00E94660283E229
S113042091E09A8389831B8282E08C838FEA8D8397
S11304308EEF8E8309C02FEF83ED90E3215080402F
S11304409040E1F700C000002FEF81EE94E02150CE
S113045080409040E1F700C00000BE016F5F7F4F15
S113046086E091E00E9458018F3F29F72FEF81EE3B
S113047094E0215080409040E1F700C00000E4CFB8
S1130480CF93DF931F92CDB7DEB73D9A3E9A3F9A42
S113049087E091E00E945A0260E0CE0101960E943A
S11304A09202698186E091E00E9404010F90DF913D
S11304B0CF91089586E08093CA00E9ECF0E0808152
S11304C08860808387E68093CC000895FB01908147
S11304D0992351F031968091C80085FFFCCF909309
S11304E0CE0091919111F7CF0895229A2A98229AD9
S11304F0219A2998219A249A2C9A249A23982B9801
S11305002B98239A0895CF93DF93EC010E947502F0
S11305108881811104C080E58CBD81E08DBDDF91AF
S1130520CF91089521E0FC0120830C9483022C9A3E
S1130530249A08952C98249A089598E080E015C090
S11305402A98229A25E02A95F1F700001B998160E8
S113055025E02A95F1F70000299A219A2AE02A95A4
S1130560F1F700C0660F915041F0880F2998219A45
S113057067FFE6CF2A9A229AE5CF0895FC012081ED
S1130580211106C06EBD0DB407FEFDCF8EB50895D2
S11305900C949D02EE0FFF1F0590F491E02D099439
S10705A0F894FFCFF9
S10905A4626C610A000014
S9030000FC

View File

@ -5,11 +5,11 @@
* Author: BlubbFish
*/
#include "portc.hpp"
#include "pin.hpp"
#ifndef LED_H_
#define LED_H_
#include "pin.hpp"
template <typename Port, int pin_red, int pin_green, int pin_blue>
class Led {
public:

View File

@ -11,17 +11,25 @@
#include "Can.h"
#include "Spi.h"
#include "portc.hpp"
#include "portb.hpp";
#include <util/delay.h>
//Led l;
typedef Led<avrlib::portc, PINC5, PINC6, PINC7> l;
//////////////////// LED ///////////////////////////////
typedef Led<avrlib::portc, PINC5, PINC6, PINC7> ledclass;
ledclass l;
typedef Spi<avrlib::portb, PINB4, PINB3, PINB2, PINB1, 0> spiclass;
spiclass s;
typedef Rs232<9600> rs232class;
rs232class r;
Rs232 r;
Can c(Spi(0));
Can c(s);
int main(void)
{
//l.color(Led::YELLOW);
l::color(l::YELLOW);
l.color(l.YELLOW);
r.send("bla\n");
CANMessage m;
m.id = 0x0123;

View File

@ -5,7 +5,7 @@
* Author: netz
*/
#include "Rs232.h"
/* #include "Rs232.h"
Rs232::Rs232() {
init();
@ -21,7 +21,7 @@ uint8_t Rs232::uart_putchar(uint8_t c)
void Rs232::init()
{
UCSR1C = (1 << UCSZ11) |(1 << UCSZ10); //8N1
UCSR1B |= /*(1<<RXEN1) | (1<<RXCIE1) | */ (1<<TXEN1); //Enable TXEN im Register UCR TX-Data Enable
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
}
@ -31,4 +31,5 @@ void Rs232::send(const char * text) {
uart_putchar(*text);
text++;
}
}
} */

View File

@ -13,14 +13,30 @@
#include <stdio.h>
#include <avr/io.h>
template <uint32_t baudrate>
class Rs232 {
private:
void init();
uint8_t uart_putchar(uint8_t c);
public:
Rs232();
Rs232(int) {}
void send(const char *text);
Rs232() {
init();
}
void send(const char *text) {
while (*text)
{
uart_putchar(*text);
text++;
}
}
private:
void init() {
UCSR1C = (1 << UCSZ11) |(1 << UCSZ10); //8N1
UCSR1B |= /*(1<<RXEN1) | (1<<RXCIE1) | */ (1<<TXEN1); //Enable TXEN im Register UCR TX-Data Enable
UBRR1L = (F_CPU / (baudrate * 16L) - 1); //Teiler wird gesetzt
}
uint8_t uart_putchar(uint8_t c) {
loop_until_bit_is_set(UCSR1A, UDRE1); //Ausgabe des Zeichens
UDR1 = c;
return 0;
}
};

View File

@ -5,9 +5,9 @@
* Author: netz
*/
#include "Spi.h"
/* #include "Spi.h"
Spi::Spi(uint8_t index) : mode(1) { //, canport(&PORTB) /* : m_index (index) {} */ {
Spi::Spi(uint8_t index) : mode(1) { //, canport(&PORTB) /* : m_index (index) {} *-/ {
init();
}
@ -24,7 +24,7 @@ void Spi::init() {
#define CANP_MISO PINB3
#define CANP_MOSI PINB2
#define CANP_SCK PINB1
#define CANP_CS PINB4*/
#define CANP_CS PINB4*-/
void Spi::init_port() {
mosi::make_output();
@ -103,5 +103,5 @@ uint8_t Spi::send_soft(uint8_t data) {
asm volatile ("nop");
werti = (werti << 1) | ((CANPIN_SPI >> CANP_MISO) & 1);
}
return werti; */
}
return werti; *-/
} */

View File

@ -13,30 +13,82 @@
#include <avr/io.h>
#include <util/delay.h>
#include "pin.hpp"
#include "portb.hpp"
template <typename Port, int cspin, int misopin, int mosipin, int sckpin, int mode>
class Spi {
public:
Spi(uint8_t index);
void CSOn();
void CSOff();
uint8_t send(uint8_t data);
Spi() {
init();
}
void CSOn() {
cs::make_low();
}
void CSOff() {
cs::make_high();
}
uint8_t send(uint8_t data) {
if(mode == 0) {
return send_hard(data);
}
return send_soft(data);
}
private:
const uint8_t mode; //0 Hardware, 1 Software
const typedef avrlib::pin<avrlib::portb, PINB4> cs;
const typedef avrlib::pin<avrlib::portb, PINB3> miso;
const typedef avrlib::pin<avrlib::portb, PINB2> mosi;
const typedef avrlib::pin<avrlib::portb, PINB1> sck;
void init();
void init_port();
void init_spi();
uint8_t send_soft(uint8_t data);
uint8_t send_hard(uint8_t data);
/*protected:
uint8_t m_index;*/
const typedef avrlib::pin<Port, cspin> cs;
const typedef avrlib::pin<Port, misopin> miso;
const typedef avrlib::pin<Port, mosipin> mosi;
const typedef avrlib::pin<Port, sckpin> sck;
void init() {
init_port();
if(mode == 0) {
init_spi();
}
}
void init_port() {
mosi::make_output();
mosi::make_low();
sck::make_output();
sck::make_low();
cs::make_output();
cs::make_high();
miso::make_input();
miso::make_low();
}
void init_spi() {
SPCR = (1<<SPE) | (1<<MSTR);
SPSR = (1<<SPI2X);
}
uint8_t send_soft(uint8_t data) {
uint8_t datain=0;
for (uint8_t a=8; a>0; a--) { //das Byte wird Bitweise nacheinander Gesendet MSB zuerst
datain<<=1; //Schieben um das Richtige Bit zusetzen
sck::make_low(); // Clock auf LOW
if (data & 0x80) { //Ist Bit a in Byte gesetzt
mosi::make_high(); //Set Output High
}
else{
mosi::make_low(); //Set Output Low
}
_delay_us(1);
if(miso::read()) //Lesen des Pegels
{
datain |= 1;
}
_delay_us(1);
sck::make_high(); // Clock auf High
_delay_us(2);
data<<=1; //Schiebe um nächstes Bit zusenden
}
return datain;
}
uint8_t send_hard(uint8_t data) {
// Sendet ein Byte
SPDR = data;
// Wartet bis Byte gesendet wurde
loop_until_bit_is_set(SPSR, SPIF);
return SPDR;
}
};
#endif /* SPI_H_ */

View File

@ -0,0 +1,7 @@
/*
* Spi.hpp
*
* Created: 11.11.2013 18:01:21
* Author: netz
*/

View File

@ -10,6 +10,5 @@
#define CONFIG_H_
#define F_CPU 16000000
#define BAUD_RATE 9600
#endif /* CONFIG_H_ */