diff --git a/V5B/Reciver/Reciver.atsuo b/V5B/Reciver/Reciver.atsuo index ecc1998..92ce29c 100644 Binary files a/V5B/Reciver/Reciver.atsuo and b/V5B/Reciver/Reciver.atsuo differ diff --git a/V5B/Reciver/Reciver/Debug/Makefile b/V5B/Reciver/Reciver/Debug/Makefile index 2f82e60..e778fbb 100644 --- a/V5B/Reciver/Reciver/Debug/Makefile +++ b/V5B/Reciver/Reciver/Debug/Makefile @@ -85,7 +85,7 @@ LIB_DEP+= ./%.o: .././%.c @echo Building file: $< @echo Invoking: AVR/GNU C Compiler : - $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega168a -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -funsigned-char -funsigned-bitfields -O1 -ffunction-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=attiny24a -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" @echo Finished building: $< @@ -113,7 +113,7 @@ all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) $(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) @echo Building target: $@ @echo Invoking: AVR/GNU Linker : - $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="Reciver.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega168a + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="Reciver.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=attiny24a @echo Finished building target: $@ "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "Reciver.elf" "Reciver.hex" "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "Reciver.elf" "Reciver.eep" || exit 0 diff --git a/V5B/Reciver/Reciver/Debug/Reciver.d b/V5B/Reciver/Reciver/Debug/Reciver.d index e511ad9..b1a43c8 100644 --- a/V5B/Reciver/Reciver/Debug/Reciver.d +++ b/V5B/Reciver/Reciver/Debug/Reciver.d @@ -4,9 +4,7 @@ Reciver.d Reciver.o: .././Reciver.c .././global.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 \ 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/stdint.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/stdint.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/iom168a.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/iom168.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/iomx8.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/iotn24a.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/portpins.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/common.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 \ @@ -30,11 +28,7 @@ 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/stdint.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/iom168a.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/iom168.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/iomx8.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/iotn24a.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/portpins.h: diff --git a/V5B/Reciver/Reciver/Debug/Reciver.elf b/V5B/Reciver/Reciver/Debug/Reciver.elf index ecf529a..fc8efc3 100644 Binary files a/V5B/Reciver/Reciver/Debug/Reciver.elf and b/V5B/Reciver/Reciver/Debug/Reciver.elf differ diff --git a/V5B/Reciver/Reciver/Debug/Reciver.hex b/V5B/Reciver/Reciver/Debug/Reciver.hex index 4df8690..83dce53 100644 --- a/V5B/Reciver/Reciver/Debug/Reciver.hex +++ b/V5B/Reciver/Reciver/Debug/Reciver.hex @@ -1,110 +1,98 @@ -:100000000C9434000C9451000C9451000C94510049 -:100010000C9451000C9451000C9451000C9451001C -:100020000C9451000C9451000C9451000C9451000C -:100030000C9451000C9451000C9451000C945100FC -:100040000C9470010C9451000C9451000C945100CC -:100050000C9451000C9451000C9451000C945100DC -:100060000C9451000C94510011241FBECFEFD4E02A -:10007000DEBFCDBF11E0A0E0B1E0E8EBF6E002C0EA -:1000800005900D92A430B107D9F721E0A4E0B1E0CA -:1000900001C01D92A630B207E1F70E94E9010C945D -:1000A0005A030C940000809102019091030106977D -:1000B00009F441C086E090E090930301809302012F -:1000C00088E290E090930101809300018FE39CE926 -:1000D0000197F1F700C00000409102015091030127 -:1000E0006AE081E00E94C6029FEF23EC89E0915014 -:1000F00020408040E1F700C0000084E190E0909350 -:100100000101809300019FEF22E587E0915020409C -:100110008040E1F700C0000084EB90E09093010183 -:10012000809300019FEF26E181E1915020408040C3 -:10013000E1F700C00000089522988091020190919B -:100140000301039741F41A9B06C00E94C1020E945A -:1001500053000E94A702809102019091030102972F -:1001600059F41A9B09C00E94C10248E06AE081E08C -:100170000E94C6020E94A7024B992DC080910201E5 -:1001800090910301029739F586E090E09093030186 -:10019000809302012FEF81E19AE721508040904047 -:1001A000E1F700C000002FEF81E19AE72150804085 -:1001B0009040E1F700C000002FEF81E19AE7215065 -:1001C00080409040E1F700C0000083E090E0909311 -:1001D0000301809302010895CF930E94A70202C0F9 -:1001E0000E949C000E94B4028111FACF0E94BC02BE -:1001F000882341F08A3031F0803F09F048C002C0C6 -:100200000E949C000E94B4028111FACF0E94BC029D -:10021000C82F02C00E949C000E94B4028111FACF34 -:10022000C130A9F50E94BC02843049F018F4813035 -:10023000D9F41DC0853051F08730B1F40EC082E092 -:1002400090E0909303018093020111C083E090E05D -:1002500090930301809302010AC00E94C1020E9490 -:1002600053000E94A70213C00E94C10210C00E9446 -:10027000C1028FE39CE90197F1F700C000004091B3 -:100280000201509103016AE081E00E94C602CF9111 -:10029000089514BC85E085BD88E586BD81E0809326 -:1002A0006E00209A289A8FEA94E00197F1F700C037 -:1002B000000080910001909101011816190674F454 -:1002C00080E090E025E12A95F1F700000196209169 -:1002D00000013091010182179307A4F32898089533 -:1002E0001F920F920FB60F9211242F933F938F936B -:1002F0009F9388E586BD809102019091030102974A -:1003000079F48091040190910501C39794F19BB118 -:1003100080E489278BB9109205011092040129C04D -:100320008091020190910301039779F48091040177 -:10033000909105010697ECF09BB180E489278BB979 -:10034000109205011092040114C080910201909155 -:100350000301069771F480910401909105010297C1 -:1003600044F09BB180E489278BB91092050110926B -:10037000040180910401909105010196909305017B -:1003800080930401209A289A8FEA94E00197F1F76C -:1003900000C000008091000190910101181619061B -:1003A00074F480E090E025E12A95F1F700000196D1 -:1003B000209100013091010182179307A4F328983E -:1003C0009F918F913F912F910F900FBE0F901F9093 -:1003D00018950E941E0280E296E00E945F0247E0AC -:1003E00060E081E00E94480280E895E20E946F028E -:1003F00066E080E00E9496020E944901569A539856 -:100400005B9A78940E94EC00FDCF449840E120E094 -:1004100030E0992314F4409A01C04098220F331F12 -:1004200033992160419A880F991F00C000004198BC -:10043000415079F7449A822F932F089587B18361B1 -:1004400087B9449A2FEF80E792E021508040904096 -:10045000E1F700C0000080EE90EC0E94050287EDFD -:1004600090E80E9405028BEA92EC0E94050281E866 -:100470009AEC0E94050280E090EE0E94050280E066 -:1004800098EC0E94050287EF94EC0E940502089503 -:10049000477050E05469637070E0660F771F660F15 -:1004A000771F660F771F20E2829FC00111249927D2 -:1004B000862B972B842B952B0E940502089580365E -:1004C000910538F080342FE0920728F08FE39FE009 -:1004D00002C080E690E0906A0E9405020895873984 -:1004E00022E0920710F1883125E1920780F49C0107 -:1004F00040E050E060E678EA80E090E00E943E0351 -:10050000C90101978068966C0E94050208959C01BC -:1005100040E050E06CEF72E485E090E00E941C0344 -:10052000C9010197966C0E9405020895877090E0BA -:10053000986920E1629FB00111247727862B972BC1 -:100540000E94050208954498339BFECF089588ECDD -:1005500092E80E94050281E89AEC0E94050283E875 -:100560009AEC0E9405020895449886B183FB88277F -:1005700080F991E08927089580E090EB0E940502C0 -:10058000089588E092E80E94050208951F93CF9392 -:10059000DF93182FD62FC42F88E392E80E9405021C -:1005A0000E94A3028AEA98EB0E9405020E94A3021D -:1005B0008AEA98EB0E9405020E94A3028AEA98EB5D -:1005C0000E9405020E94A3028DE298EB0E940502A0 -:1005D0000E94A30284ED98EB0E9405020E94A302F0 -:1005E000812F90E0986B0E9405020E94A3028D2F3C -:1005F00090E0986B0E9405020E94A3028C2F90E06D -:10060000986B0E9405020E94A30280E098EB0E9472 -:1006100005020E94A30288E092E80E9405022FEFE3 -:1006200080E792E0215080409040E1F700C0000058 -:10063000DF91CF911F910895A1E21A2EAA1BBB1B37 -:10064000FD010DC0AA1FBB1FEE1FFF1FA217B3079E -:10065000E407F50720F0A21BB30BE40BF50B661FB4 -:10066000771F881F991F1A9469F760957095809578 -:1006700090959B01AC01BD01CF010895052E97FB1C -:1006800016F4009407D057FD0DD00E941C0307FC00 -:1006900009D07EF490958095709561957F4F8F4F2E -:1006A0009F4F089550954095309521953F4F4F4F5E -:0806B0005F4F0895F894FFCF9D -:0406B800B400020088 +:1000000010C028C027C026C025C024C023C022C0DD +:1000100021C020C01FC02AC11DC01CC01BC01AC0E7 +:1000200019C011241FBECFEDCDBF10E0A0E6B0E097 +:10003000E4EFF5E002C005900D92A436B107D9F7C0 +:1000400020E0A4E6B0E001C01D92A636B207E1F7B9 +:1000500086D1CEC2D5CF8091620090916300069781 +:1000600009F443C086E090E09093630080936200BF +:1000700088E290E090936100809360002FE788E32E +:1000800091E0215080409040E1F700C00000409195 +:1000900062005091630068E281E02CD22FEF83EC84 +:1000A00099E0215080409040E1F700C0000084E1D9 +:1000B00090E090936100809360002FEF82E597E0DD +:1000C000215080409040E1F700C0000084EB90E0B8 +:1000D00090936100809360002FEF86E191E12150C1 +:1000E00080409040E1F700C000000895BA988091E8 +:1000F000620090916300039729F4B29B03C0F6D18C +:10010000AADFE1D18091620090916300029741F4EF +:10011000B29B06C0EBD148E068E281E0EBD1D3D1DD +:10012000CC992DC08091620090916300029739F5BF +:1001300086E090E090936300809362002FEF81E16E +:100140009AE7215080409040E1F700C000002FEF77 +:1001500081E19AE7215080409040E1F700C0000023 +:100160002FEF81E19AE7215080409040E1F700C0F5 +:10017000000083E090E09093630080936200089514 +:10018000CF93A1D101C0B2DFA8D18111FCCFAAD1F8 +:10019000882339F0883229F0803F09F03FC001C040 +:1001A000A5DF9BD18111FCCF9DD1C82F01C09EDF5F +:1001B00094D18111FCCFC13089F594D1843049F0BC +:1001C00018F48130C1F419C0853051F0873099F4AA +:1001D0000EC082E090E090936300809362000DC0B7 +:1001E00083E090E0909363008093620006C07ED12C +:1001F00032DF69D113C07AD111C078D12FE788E3FB +:1002000091E0215080409040E1F700C00000409113 +:1002100062005091630068E281E06CD1CF91089553 +:1002200010BE85E083BF88E582BF81E089BFB89AB0 +:10023000C09A8FEA94E00197F1F700C00000809126 +:100240006000909161001816190674F480E090E047 +:1002500025E12A95F1F70000019620916000309188 +:10026000610082179307A4F3C09808951F920F921C +:100270000FB60F9211242F933F938F939F9388E58E +:1002800082BF8091620090916300029779F480911F +:10029000640090916500C39794F198B382E0892738 +:1002A00088BB109265001092640029C080916200A2 +:1002B00090916300039779F48091640090916500B8 +:1002C0000697ECF098B382E0892788BB109265000E +:1002D0001092640014C080916200909163000697B0 +:1002E00071F48091640090916500029744F098B396 +:1002F00082E0892788BB109265001092640080918B +:10030000640090916500019690936500809364006D +:10031000B89AC09A8FEA94E00197F1F700C0000004 +:1003200080916000909161001816190674F480E0C5 +:1003300090E025E12A95F1F70000019620916000F8 +:100340003091610082179307A4F3C0989F918F9119 +:100350003F912F910F900FBE0F901F9018952FD0A7 +:1003600080E296E06BD047E060E081E04BD080E82F +:1003700095E273D066E080E093D052DFB99AD498CA +:10038000DC9AD69ADE987894FBDEFECFD99840E1CD +:1003900020E030E0992314F4DB9A01C0DB98220FAF +:1003A000331FC8992160DA9A880F991F00C0000096 +:1003B000DA98415079F7D99A822F932F08958AB30A +:1003C0008E608ABBD99A2FEF80E792E0215080405F +:1003D0009040E1F700C0000080EE90ECD7DF87EDA1 +:1003E00090E8D4DF8BEA92ECD1DF81E89AECCEDFA3 +:1003F00080E090EECBDF80E098ECC8DF87EF94ECF4 +:10040000C5DF0895477050E054696370262F30E0CF +:10041000220F331F220F331F220F331F90E0880F4C +:10042000991F82959295907F9827807F982799278A +:10043000822B932B842B952BA9DF08958036910571 +:1004400038F080342FE0920728F08FE39FE002C05D +:1004500080E690E0906A9ADF0895873922E092075B +:10046000F0F0883125E1920770F49C0140E050E003 +:1004700060E678EA80E090E0A0D0C901019780684A +:10048000966C84DF08959C0140E050E06CEF72E4CC +:1004900085E090E070D0C9010197966C77DF0895F0 +:1004A000877090E0986970E062957295707F76270A +:1004B000607F76277727862B972B68DF0895D9985A +:1004C000C89BFECF089588EC92E860DF81E89AEC43 +:1004D0005DDF83E89AEC5ADF0895D99889B3809557 +:1004E0008170089580E090EB51DF089588E092E8F4 +:1004F0004DDF08951F93CF93DF93182FD62FC42F6E +:1005000088E392E843DFDBDF8AEA98EB3FDFD7DF5F +:100510008AEA98EB3BDFD3DF8AEA98EB37DFCFDF5D +:100520008DE298EB33DFCBDF84ED98EB2FDFC7DF75 +:10053000812F90E0986B2ADFC2DF8D2F90E0986BBF +:1005400025DFBDDF8C2F90E0986B20DFB8DF80E0E7 +:1005500098EB1CDFB4DF88E092E818DF2FEF80E72C +:1005600092E0215080409040E1F700C00000DF9110 +:10057000CF911F910895A1E21A2EAA1BBB1BFD016A +:100580000DC0AA1FBB1FEE1FFF1FA217B307E40772 +:10059000F50720F0A21BB30BE40BF50B661F771FCA +:1005A000881F991F1A9469F76095709580959095AA +:1005B0009B01AC01BD01CF010895052E97FB16F4F8 +:1005C000009406D057FD0CD0D6DF07FC09D07EF48E +:1005D00090958095709561957F4F8F4F9F4F0895AF +:1005E00050954095309521953F4F4F4F5F4F08955F +:0405F000F894FFCFAD +:0405F400B40002004D :00000001FF diff --git a/V5B/Reciver/Reciver/Debug/Reciver.lss b/V5B/Reciver/Reciver/Debug/Reciver.lss index ec57fe0..4030479 100644 --- a/V5B/Reciver/Reciver/Debug/Reciver.lss +++ b/V5B/Reciver/Reciver/Debug/Reciver.lss @@ -3,1148 +3,1151 @@ Reciver.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn - 0 .data 00000004 00800100 000006b8 0000074c 2**0 - CONTENTS, ALLOC, LOAD, DATA - 1 .text 000006b8 00000000 00000000 00000094 2**1 + 0 .text 000005f4 00000000 00000000 00000094 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .bss 00000002 00800104 00800104 00000750 2**0 + 1 .data 00000004 00800060 000005f4 00000688 2**0 + CONTENTS, ALLOC, LOAD, DATA + 2 .bss 00000002 00800064 00800064 0000068c 2**0 ALLOC - 3 .stab 000006cc 00000000 00000000 00000750 2**2 + 3 .stab 000006b4 00000000 00000000 0000068c 2**2 CONTENTS, READONLY, DEBUGGING - 4 .stabstr 00000082 00000000 00000000 00000e1c 2**0 + 4 .stabstr 00000082 00000000 00000000 00000d40 2**0 CONTENTS, READONLY, DEBUGGING - 5 .comment 0000002f 00000000 00000000 00000e9e 2**0 + 5 .comment 0000002f 00000000 00000000 00000dc2 2**0 CONTENTS, READONLY - 6 .debug_aranges 000000d0 00000000 00000000 00000ecd 2**0 + 6 .debug_aranges 000000d0 00000000 00000000 00000df1 2**0 CONTENTS, READONLY, DEBUGGING - 7 .debug_info 00001023 00000000 00000000 00000f9d 2**0 + 7 .debug_info 00001026 00000000 00000000 00000ec1 2**0 CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 0000040a 00000000 00000000 00001fc0 2**0 + 8 .debug_abbrev 0000040a 00000000 00000000 00001ee7 2**0 CONTENTS, READONLY, DEBUGGING - 9 .debug_line 0000056c 00000000 00000000 000023ca 2**0 + 9 .debug_line 0000056e 00000000 00000000 000022f1 2**0 CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 000001c8 00000000 00000000 00002938 2**2 + 10 .debug_frame 000001c8 00000000 00000000 00002860 2**2 CONTENTS, READONLY, DEBUGGING - 11 .debug_str 00000243 00000000 00000000 00002b00 2**0 + 11 .debug_str 00000243 00000000 00000000 00002a28 2**0 CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 000007d0 00000000 00000000 00002d43 2**0 + 12 .debug_loc 000007d0 00000000 00000000 00002c6b 2**0 CONTENTS, READONLY, DEBUGGING - 13 .debug_ranges 000000b0 00000000 00000000 00003513 2**0 + 13 .debug_ranges 000000b0 00000000 00000000 0000343b 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: - 0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end> - 4: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 8: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - c: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 10: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 14: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 18: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 1c: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 20: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 24: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 28: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 2c: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 30: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 34: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 38: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 3c: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 40: 0c 94 70 01 jmp 0x2e0 ; 0x2e0 <__vector_16> - 44: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 48: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 4c: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 50: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 54: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 58: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 5c: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 60: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> - 64: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__bad_interrupt> + 0: 10 c0 rjmp .+32 ; 0x22 <__ctors_end> + 2: 28 c0 rjmp .+80 ; 0x54 <__bad_interrupt> + 4: 27 c0 rjmp .+78 ; 0x54 <__bad_interrupt> + 6: 26 c0 rjmp .+76 ; 0x54 <__bad_interrupt> + 8: 25 c0 rjmp .+74 ; 0x54 <__bad_interrupt> + a: 24 c0 rjmp .+72 ; 0x54 <__bad_interrupt> + c: 23 c0 rjmp .+70 ; 0x54 <__bad_interrupt> + e: 22 c0 rjmp .+68 ; 0x54 <__bad_interrupt> + 10: 21 c0 rjmp .+66 ; 0x54 <__bad_interrupt> + 12: 20 c0 rjmp .+64 ; 0x54 <__bad_interrupt> + 14: 1f c0 rjmp .+62 ; 0x54 <__bad_interrupt> + 16: 2a c1 rjmp .+596 ; 0x26c <__vector_11> + 18: 1d c0 rjmp .+58 ; 0x54 <__bad_interrupt> + 1a: 1c c0 rjmp .+56 ; 0x54 <__bad_interrupt> + 1c: 1b c0 rjmp .+54 ; 0x54 <__bad_interrupt> + 1e: 1a c0 rjmp .+52 ; 0x54 <__bad_interrupt> + 20: 19 c0 rjmp .+50 ; 0x54 <__bad_interrupt> -00000068 <__ctors_end>: - 68: 11 24 eor r1, r1 - 6a: 1f be out 0x3f, r1 ; 63 - 6c: cf ef ldi r28, 0xFF ; 255 - 6e: d4 e0 ldi r29, 0x04 ; 4 - 70: de bf out 0x3e, r29 ; 62 - 72: cd bf out 0x3d, r28 ; 61 +00000022 <__ctors_end>: + 22: 11 24 eor r1, r1 + 24: 1f be out 0x3f, r1 ; 63 + 26: cf ed ldi r28, 0xDF ; 223 + 28: cd bf out 0x3d, r28 ; 61 -00000074 <__do_copy_data>: - 74: 11 e0 ldi r17, 0x01 ; 1 - 76: a0 e0 ldi r26, 0x00 ; 0 - 78: b1 e0 ldi r27, 0x01 ; 1 - 7a: e8 eb ldi r30, 0xB8 ; 184 - 7c: f6 e0 ldi r31, 0x06 ; 6 - 7e: 02 c0 rjmp .+4 ; 0x84 <__do_copy_data+0x10> - 80: 05 90 lpm r0, Z+ - 82: 0d 92 st X+, r0 - 84: a4 30 cpi r26, 0x04 ; 4 - 86: b1 07 cpc r27, r17 - 88: d9 f7 brne .-10 ; 0x80 <__do_copy_data+0xc> +0000002a <__do_copy_data>: + 2a: 10 e0 ldi r17, 0x00 ; 0 + 2c: a0 e6 ldi r26, 0x60 ; 96 + 2e: b0 e0 ldi r27, 0x00 ; 0 + 30: e4 ef ldi r30, 0xF4 ; 244 + 32: f5 e0 ldi r31, 0x05 ; 5 + 34: 02 c0 rjmp .+4 ; 0x3a <__do_copy_data+0x10> + 36: 05 90 lpm r0, Z+ + 38: 0d 92 st X+, r0 + 3a: a4 36 cpi r26, 0x64 ; 100 + 3c: b1 07 cpc r27, r17 + 3e: d9 f7 brne .-10 ; 0x36 <__do_copy_data+0xc> -0000008a <__do_clear_bss>: - 8a: 21 e0 ldi r18, 0x01 ; 1 - 8c: a4 e0 ldi r26, 0x04 ; 4 - 8e: b1 e0 ldi r27, 0x01 ; 1 - 90: 01 c0 rjmp .+2 ; 0x94 <.do_clear_bss_start> +00000040 <__do_clear_bss>: + 40: 20 e0 ldi r18, 0x00 ; 0 + 42: a4 e6 ldi r26, 0x64 ; 100 + 44: b0 e0 ldi r27, 0x00 ; 0 + 46: 01 c0 rjmp .+2 ; 0x4a <.do_clear_bss_start> -00000092 <.do_clear_bss_loop>: - 92: 1d 92 st X+, r1 +00000048 <.do_clear_bss_loop>: + 48: 1d 92 st X+, r1 -00000094 <.do_clear_bss_start>: - 94: a6 30 cpi r26, 0x06 ; 6 - 96: b2 07 cpc r27, r18 - 98: e1 f7 brne .-8 ; 0x92 <.do_clear_bss_loop> - 9a: 0e 94 e9 01 call 0x3d2 ; 0x3d2
- 9e: 0c 94 5a 03 jmp 0x6b4 ; 0x6b4 <_exit> +0000004a <.do_clear_bss_start>: + 4a: a6 36 cpi r26, 0x66 ; 102 + 4c: b2 07 cpc r27, r18 + 4e: e1 f7 brne .-8 ; 0x48 <.do_clear_bss_loop> + 50: 86 d1 rcall .+780 ; 0x35e
+ 52: ce c2 rjmp .+1436 ; 0x5f0 <_exit> -000000a2 <__bad_interrupt>: - a2: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> +00000054 <__bad_interrupt>: + 54: d5 cf rjmp .-86 ; 0x0 <__vectors> -000000a6 : +00000056 : volatile int pwm_led = 0; volatile int servopos = RIGHT; void turn() { if(status == RUN) - a6: 80 91 02 01 lds r24, 0x0102 - aa: 90 91 03 01 lds r25, 0x0103 - ae: 06 97 sbiw r24, 0x06 ; 6 - b0: 09 f4 brne .+2 ; 0xb4 - b2: 41 c0 rjmp .+130 ; 0x136 + 56: 80 91 62 00 lds r24, 0x0062 + 5a: 90 91 63 00 lds r25, 0x0063 + 5e: 06 97 sbiw r24, 0x06 ; 6 + 60: 09 f4 brne .+2 ; 0x64 + 62: 43 c0 rjmp .+134 ; 0xea <__stack+0xb> return; status = RUN; - b4: 86 e0 ldi r24, 0x06 ; 6 - b6: 90 e0 ldi r25, 0x00 ; 0 - b8: 90 93 03 01 sts 0x0103, r25 - bc: 80 93 02 01 sts 0x0102, r24 + 64: 86 e0 ldi r24, 0x06 ; 6 + 66: 90 e0 ldi r25, 0x00 ; 0 + 68: 90 93 63 00 sts 0x0063, r25 + 6c: 80 93 62 00 sts 0x0062, r24 servopos = RIGHT-140; - c0: 88 e2 ldi r24, 0x28 ; 40 - c2: 90 e0 ldi r25, 0x00 ; 0 - c4: 90 93 01 01 sts 0x0101, r25 - c8: 80 93 00 01 sts 0x0100, r24 + 70: 88 e2 ldi r24, 0x28 ; 40 + 72: 90 e0 ldi r25, 0x00 ; 0 + 74: 90 93 61 00 sts 0x0061, r25 + 78: 80 93 60 00 sts 0x0060, r24 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); - cc: 8f e3 ldi r24, 0x3F ; 63 - ce: 9c e9 ldi r25, 0x9C ; 156 - d0: 01 97 sbiw r24, 0x01 ; 1 - d2: f1 f7 brne .-4 ; 0xd0 - d4: 00 c0 rjmp .+0 ; 0xd6 - d6: 00 00 nop + 7c: 2f e7 ldi r18, 0x7F ; 127 + 7e: 88 e3 ldi r24, 0x38 ; 56 + 80: 91 e0 ldi r25, 0x01 ; 1 + 82: 21 50 subi r18, 0x01 ; 1 + 84: 80 40 sbci r24, 0x00 ; 0 + 86: 90 40 sbci r25, 0x00 ; 0 + 88: e1 f7 brne .-8 ; 0x82 + 8a: 00 c0 rjmp .+0 ; 0x8c + 8c: 00 00 nop _delay_ms(10+DEVICE); rf12_txpacket(MASTER, DEVICE, status); - d8: 40 91 02 01 lds r20, 0x0102 - dc: 50 91 03 01 lds r21, 0x0103 - e0: 6a e0 ldi r22, 0x0A ; 10 - e2: 81 e0 ldi r24, 0x01 ; 1 - e4: 0e 94 c6 02 call 0x58c ; 0x58c - e8: 9f ef ldi r25, 0xFF ; 255 - ea: 23 ec ldi r18, 0xC3 ; 195 - ec: 89 e0 ldi r24, 0x09 ; 9 - ee: 91 50 subi r25, 0x01 ; 1 - f0: 20 40 sbci r18, 0x00 ; 0 - f2: 80 40 sbci r24, 0x00 ; 0 - f4: e1 f7 brne .-8 ; 0xee - f6: 00 c0 rjmp .+0 ; 0xf8 - f8: 00 00 nop + 8e: 40 91 62 00 lds r20, 0x0062 + 92: 50 91 63 00 lds r21, 0x0063 + 96: 68 e2 ldi r22, 0x28 ; 40 + 98: 81 e0 ldi r24, 0x01 ; 1 + 9a: 2c d2 rcall .+1112 ; 0x4f4 + 9c: 2f ef ldi r18, 0xFF ; 255 + 9e: 83 ec ldi r24, 0xC3 ; 195 + a0: 99 e0 ldi r25, 0x09 ; 9 + a2: 21 50 subi r18, 0x01 ; 1 + a4: 80 40 sbci r24, 0x00 ; 0 + a6: 90 40 sbci r25, 0x00 ; 0 + a8: e1 f7 brne .-8 ; 0xa2 + aa: 00 c0 rjmp .+0 ; 0xac + ac: 00 00 nop _delay_ms(400); servopos = RIGHT-160; - fa: 84 e1 ldi r24, 0x14 ; 20 - fc: 90 e0 ldi r25, 0x00 ; 0 - fe: 90 93 01 01 sts 0x0101, r25 - 102: 80 93 00 01 sts 0x0100, r24 - 106: 9f ef ldi r25, 0xFF ; 255 - 108: 22 e5 ldi r18, 0x52 ; 82 - 10a: 87 e0 ldi r24, 0x07 ; 7 - 10c: 91 50 subi r25, 0x01 ; 1 - 10e: 20 40 sbci r18, 0x00 ; 0 - 110: 80 40 sbci r24, 0x00 ; 0 - 112: e1 f7 brne .-8 ; 0x10c - 114: 00 c0 rjmp .+0 ; 0x116 - 116: 00 00 nop + ae: 84 e1 ldi r24, 0x14 ; 20 + b0: 90 e0 ldi r25, 0x00 ; 0 + b2: 90 93 61 00 sts 0x0061, r25 + b6: 80 93 60 00 sts 0x0060, r24 + ba: 2f ef ldi r18, 0xFF ; 255 + bc: 82 e5 ldi r24, 0x52 ; 82 + be: 97 e0 ldi r25, 0x07 ; 7 + c0: 21 50 subi r18, 0x01 ; 1 + c2: 80 40 sbci r24, 0x00 ; 0 + c4: 90 40 sbci r25, 0x00 ; 0 + c6: e1 f7 brne .-8 ; 0xc0 + c8: 00 c0 rjmp .+0 ; 0xca + ca: 00 00 nop _delay_ms(300); servopos = RIGHT; - 118: 84 eb ldi r24, 0xB4 ; 180 - 11a: 90 e0 ldi r25, 0x00 ; 0 - 11c: 90 93 01 01 sts 0x0101, r25 - 120: 80 93 00 01 sts 0x0100, r24 - 124: 9f ef ldi r25, 0xFF ; 255 - 126: 26 e1 ldi r18, 0x16 ; 22 - 128: 81 e1 ldi r24, 0x11 ; 17 - 12a: 91 50 subi r25, 0x01 ; 1 - 12c: 20 40 sbci r18, 0x00 ; 0 - 12e: 80 40 sbci r24, 0x00 ; 0 - 130: e1 f7 brne .-8 ; 0x12a - 132: 00 c0 rjmp .+0 ; 0x134 - 134: 00 00 nop - 136: 08 95 ret + cc: 84 eb ldi r24, 0xB4 ; 180 + ce: 90 e0 ldi r25, 0x00 ; 0 + d0: 90 93 61 00 sts 0x0061, r25 + d4: 80 93 60 00 sts 0x0060, r24 + d8: 2f ef ldi r18, 0xFF ; 255 + da: 86 e1 ldi r24, 0x16 ; 22 + dc: 91 e1 ldi r25, 0x11 ; 17 + de: 21 50 subi r18, 0x01 ; 1 + e0: 80 40 sbci r24, 0x00 ; 0 + e2: 90 40 sbci r25, 0x00 ; 0 + e4: e1 f7 brne .-8 ; 0xde + e6: 00 c0 rjmp .+0 ; 0xe8 <__stack+0x9> + e8: 00 00 nop + ea: 08 95 ret -00000138 : +000000ec : _delay_ms(700); } void poll() { DDRB &= ~(1< + ee: 80 91 62 00 lds r24, 0x0062 + f2: 90 91 63 00 lds r25, 0x0063 + f6: 03 97 sbiw r24, 0x03 ; 3 + f8: 29 f4 brne .+10 ; 0x104 if(PINB & (1< + fa: b2 9b sbis 0x16, 2 ; 22 + fc: 03 c0 rjmp .+6 ; 0x104 rf12_endasyncrx(); - 14a: 0e 94 c1 02 call 0x582 ; 0x582 + fe: f6 d1 rcall .+1004 ; 0x4ec turn(); - 14e: 0e 94 53 00 call 0xa6 ; 0xa6 + 100: aa df rcall .-172 ; 0x56 rf12_beginasyncrx(); - 152: 0e 94 a7 02 call 0x54e ; 0x54e + 102: e1 d1 rcall .+962 ; 0x4c6 } } if(status == SLEEP) { - 156: 80 91 02 01 lds r24, 0x0102 - 15a: 90 91 03 01 lds r25, 0x0103 - 15e: 02 97 sbiw r24, 0x02 ; 2 - 160: 59 f4 brne .+22 ; 0x178 + 104: 80 91 62 00 lds r24, 0x0062 + 108: 90 91 63 00 lds r25, 0x0063 + 10c: 02 97 sbiw r24, 0x02 ; 2 + 10e: 41 f4 brne .+16 ; 0x120 if(PINB & (1< + 110: b2 9b sbis 0x16, 2 ; 22 + 112: 06 c0 rjmp .+12 ; 0x120 rf12_endasyncrx(); - 166: 0e 94 c1 02 call 0x582 ; 0x582 + 114: eb d1 rcall .+982 ; 0x4ec rf12_txpacket(MASTER, DEVICE, DEDECT); - 16a: 48 e0 ldi r20, 0x08 ; 8 - 16c: 6a e0 ldi r22, 0x0A ; 10 - 16e: 81 e0 ldi r24, 0x01 ; 1 - 170: 0e 94 c6 02 call 0x58c ; 0x58c + 116: 48 e0 ldi r20, 0x08 ; 8 + 118: 68 e2 ldi r22, 0x28 ; 40 + 11a: 81 e0 ldi r24, 0x01 ; 1 + 11c: eb d1 rcall .+982 ; 0x4f4 rf12_beginasyncrx(); - 174: 0e 94 a7 02 call 0x54e ; 0x54e + 11e: d3 d1 rcall .+934 ; 0x4c6 } } - if(!(PIND & (1< + if(!(PINA & (1< if(status == SLEEP) { - 17c: 80 91 02 01 lds r24, 0x0102 - 180: 90 91 03 01 lds r25, 0x0103 - 184: 02 97 sbiw r24, 0x02 ; 2 - 186: 39 f5 brne .+78 ; 0x1d6 + 124: 80 91 62 00 lds r24, 0x0062 + 128: 90 91 63 00 lds r25, 0x0063 + 12c: 02 97 sbiw r24, 0x02 ; 2 + 12e: 39 f5 brne .+78 ; 0x17e status = RUN; - 188: 86 e0 ldi r24, 0x06 ; 6 - 18a: 90 e0 ldi r25, 0x00 ; 0 - 18c: 90 93 03 01 sts 0x0103, r25 - 190: 80 93 02 01 sts 0x0102, r24 - 194: 2f ef ldi r18, 0xFF ; 255 - 196: 81 e1 ldi r24, 0x11 ; 17 - 198: 9a e7 ldi r25, 0x7A ; 122 - 19a: 21 50 subi r18, 0x01 ; 1 - 19c: 80 40 sbci r24, 0x00 ; 0 - 19e: 90 40 sbci r25, 0x00 ; 0 - 1a0: e1 f7 brne .-8 ; 0x19a - 1a2: 00 c0 rjmp .+0 ; 0x1a4 - 1a4: 00 00 nop - 1a6: 2f ef ldi r18, 0xFF ; 255 - 1a8: 81 e1 ldi r24, 0x11 ; 17 - 1aa: 9a e7 ldi r25, 0x7A ; 122 - 1ac: 21 50 subi r18, 0x01 ; 1 - 1ae: 80 40 sbci r24, 0x00 ; 0 - 1b0: 90 40 sbci r25, 0x00 ; 0 - 1b2: e1 f7 brne .-8 ; 0x1ac - 1b4: 00 c0 rjmp .+0 ; 0x1b6 - 1b6: 00 00 nop - 1b8: 2f ef ldi r18, 0xFF ; 255 - 1ba: 81 e1 ldi r24, 0x11 ; 17 - 1bc: 9a e7 ldi r25, 0x7A ; 122 - 1be: 21 50 subi r18, 0x01 ; 1 - 1c0: 80 40 sbci r24, 0x00 ; 0 - 1c2: 90 40 sbci r25, 0x00 ; 0 - 1c4: e1 f7 brne .-8 ; 0x1be - 1c6: 00 c0 rjmp .+0 ; 0x1c8 - 1c8: 00 00 nop + 130: 86 e0 ldi r24, 0x06 ; 6 + 132: 90 e0 ldi r25, 0x00 ; 0 + 134: 90 93 63 00 sts 0x0063, r25 + 138: 80 93 62 00 sts 0x0062, r24 + 13c: 2f ef ldi r18, 0xFF ; 255 + 13e: 81 e1 ldi r24, 0x11 ; 17 + 140: 9a e7 ldi r25, 0x7A ; 122 + 142: 21 50 subi r18, 0x01 ; 1 + 144: 80 40 sbci r24, 0x00 ; 0 + 146: 90 40 sbci r25, 0x00 ; 0 + 148: e1 f7 brne .-8 ; 0x142 + 14a: 00 c0 rjmp .+0 ; 0x14c + 14c: 00 00 nop + 14e: 2f ef ldi r18, 0xFF ; 255 + 150: 81 e1 ldi r24, 0x11 ; 17 + 152: 9a e7 ldi r25, 0x7A ; 122 + 154: 21 50 subi r18, 0x01 ; 1 + 156: 80 40 sbci r24, 0x00 ; 0 + 158: 90 40 sbci r25, 0x00 ; 0 + 15a: e1 f7 brne .-8 ; 0x154 + 15c: 00 c0 rjmp .+0 ; 0x15e + 15e: 00 00 nop + 160: 2f ef ldi r18, 0xFF ; 255 + 162: 81 e1 ldi r24, 0x11 ; 17 + 164: 9a e7 ldi r25, 0x7A ; 122 + 166: 21 50 subi r18, 0x01 ; 1 + 168: 80 40 sbci r24, 0x00 ; 0 + 16a: 90 40 sbci r25, 0x00 ; 0 + 16c: e1 f7 brne .-8 ; 0x166 + 16e: 00 c0 rjmp .+0 ; 0x170 + 170: 00 00 nop _delay_ms(5000); _delay_ms(5000); _delay_ms(5000); status = ACTIVE; - 1ca: 83 e0 ldi r24, 0x03 ; 3 - 1cc: 90 e0 ldi r25, 0x00 ; 0 - 1ce: 90 93 03 01 sts 0x0103, r25 - 1d2: 80 93 02 01 sts 0x0102, r24 - 1d6: 08 95 ret + 172: 83 e0 ldi r24, 0x03 ; 3 + 174: 90 e0 ldi r25, 0x00 ; 0 + 176: 90 93 63 00 sts 0x0063, r25 + 17a: 80 93 62 00 sts 0x0062, r24 + 17e: 08 95 ret -000001d8 : +00000180 : } } } void recive() { - 1d8: cf 93 push r28 + 180: cf 93 push r28 rf12_beginasyncrx(); - 1da: 0e 94 a7 02 call 0x54e ; 0x54e + 182: a1 d1 rcall .+834 ; 0x4c6 while(rf12_hasdata()) { - 1de: 02 c0 rjmp .+4 ; 0x1e4 + 184: 01 c0 rjmp .+2 ; 0x188 poll(); - 1e0: 0e 94 9c 00 call 0x138 ; 0x138 + 186: b2 df rcall .-156 ; 0xec } } void recive() { rf12_beginasyncrx(); while(rf12_hasdata()) { - 1e4: 0e 94 b4 02 call 0x568 ; 0x568 - 1e8: 81 11 cpse r24, r1 - 1ea: fa cf rjmp .-12 ; 0x1e0 + 188: a8 d1 rcall .+848 ; 0x4da + 18a: 81 11 cpse r24, r1 + 18c: fc cf rjmp .-8 ; 0x186 poll(); } uint8_t addr = rf12_rxbyte(); - 1ec: 0e 94 bc 02 call 0x578 ; 0x578 + 18e: aa d1 rcall .+852 ; 0x4e4 if(addr == ALL || addr == DEVICE || addr == GROUP) { - 1f0: 88 23 and r24, r24 - 1f2: 41 f0 breq .+16 ; 0x204 - 1f4: 8a 30 cpi r24, 0x0A ; 10 - 1f6: 31 f0 breq .+12 ; 0x204 - 1f8: 80 3f cpi r24, 0xF0 ; 240 - 1fa: 09 f0 breq .+2 ; 0x1fe - 1fc: 48 c0 rjmp .+144 ; 0x28e - 1fe: 02 c0 rjmp .+4 ; 0x204 + 190: 88 23 and r24, r24 + 192: 39 f0 breq .+14 ; 0x1a2 + 194: 88 32 cpi r24, 0x28 ; 40 + 196: 29 f0 breq .+10 ; 0x1a2 + 198: 80 3f cpi r24, 0xF0 ; 240 + 19a: 09 f0 breq .+2 ; 0x19e + 19c: 3f c0 rjmp .+126 ; 0x21c + 19e: 01 c0 rjmp .+2 ; 0x1a2 while(rf12_hasdata()) { poll(); - 200: 0e 94 9c 00 call 0x138 ; 0x138 + 1a0: a5 df rcall .-182 ; 0xec while(rf12_hasdata()) { poll(); } uint8_t addr = rf12_rxbyte(); if(addr == ALL || addr == DEVICE || addr == GROUP) { while(rf12_hasdata()) { - 204: 0e 94 b4 02 call 0x568 ; 0x568 - 208: 81 11 cpse r24, r1 - 20a: fa cf rjmp .-12 ; 0x200 + 1a2: 9b d1 rcall .+822 ; 0x4da + 1a4: 81 11 cpse r24, r1 + 1a6: fc cf rjmp .-8 ; 0x1a0 poll(); } uint8_t from = rf12_rxbyte(); - 20c: 0e 94 bc 02 call 0x578 ; 0x578 - 210: c8 2f mov r28, r24 + 1a8: 9d d1 rcall .+826 ; 0x4e4 + 1aa: c8 2f mov r28, r24 while(rf12_hasdata()) { - 212: 02 c0 rjmp .+4 ; 0x218 + 1ac: 01 c0 rjmp .+2 ; 0x1b0 poll(); - 214: 0e 94 9c 00 call 0x138 ; 0x138 + 1ae: 9e df rcall .-196 ; 0xec if(addr == ALL || addr == DEVICE || addr == GROUP) { while(rf12_hasdata()) { poll(); } uint8_t from = rf12_rxbyte(); while(rf12_hasdata()) { - 218: 0e 94 b4 02 call 0x568 ; 0x568 - 21c: 81 11 cpse r24, r1 - 21e: fa cf rjmp .-12 ; 0x214 + 1b0: 94 d1 rcall .+808 ; 0x4da + 1b2: 81 11 cpse r24, r1 + 1b4: fc cf rjmp .-8 ; 0x1ae poll(); } if(from == MASTER) { - 220: c1 30 cpi r28, 0x01 ; 1 - 222: a9 f5 brne .+106 ; 0x28e + 1b6: c1 30 cpi r28, 0x01 ; 1 + 1b8: 89 f5 brne .+98 ; 0x21c uint8_t data = rf12_rxbyte(); - 224: 0e 94 bc 02 call 0x578 ; 0x578 + 1ba: 94 d1 rcall .+808 ; 0x4e4 switch(data) { - 228: 84 30 cpi r24, 0x04 ; 4 - 22a: 49 f0 breq .+18 ; 0x23e - 22c: 18 f4 brcc .+6 ; 0x234 - 22e: 81 30 cpi r24, 0x01 ; 1 - 230: d9 f4 brne .+54 ; 0x268 - 232: 1d c0 rjmp .+58 ; 0x26e - 234: 85 30 cpi r24, 0x05 ; 5 - 236: 51 f0 breq .+20 ; 0x24c - 238: 87 30 cpi r24, 0x07 ; 7 - 23a: b1 f4 brne .+44 ; 0x268 - 23c: 0e c0 rjmp .+28 ; 0x25a + 1bc: 84 30 cpi r24, 0x04 ; 4 + 1be: 49 f0 breq .+18 ; 0x1d2 + 1c0: 18 f4 brcc .+6 ; 0x1c8 + 1c2: 81 30 cpi r24, 0x01 ; 1 + 1c4: c1 f4 brne .+48 ; 0x1f6 + 1c6: 19 c0 rjmp .+50 ; 0x1fa + 1c8: 85 30 cpi r24, 0x05 ; 5 + 1ca: 51 f0 breq .+20 ; 0x1e0 + 1cc: 87 30 cpi r24, 0x07 ; 7 + 1ce: 99 f4 brne .+38 ; 0x1f6 + 1d0: 0e c0 rjmp .+28 ; 0x1ee case PING: { break; } case SETSLEEP: { status = SLEEP; - 23e: 82 e0 ldi r24, 0x02 ; 2 - 240: 90 e0 ldi r25, 0x00 ; 0 - 242: 90 93 03 01 sts 0x0103, r25 - 246: 80 93 02 01 sts 0x0102, r24 + 1d2: 82 e0 ldi r24, 0x02 ; 2 + 1d4: 90 e0 ldi r25, 0x00 ; 0 + 1d6: 90 93 63 00 sts 0x0063, r25 + 1da: 80 93 62 00 sts 0x0062, r24 break; - 24a: 11 c0 rjmp .+34 ; 0x26e + 1de: 0d c0 rjmp .+26 ; 0x1fa } case SETACTIVE: { status = ACTIVE; - 24c: 83 e0 ldi r24, 0x03 ; 3 - 24e: 90 e0 ldi r25, 0x00 ; 0 - 250: 90 93 03 01 sts 0x0103, r25 - 254: 80 93 02 01 sts 0x0102, r24 + 1e0: 83 e0 ldi r24, 0x03 ; 3 + 1e2: 90 e0 ldi r25, 0x00 ; 0 + 1e4: 90 93 63 00 sts 0x0063, r25 + 1e8: 80 93 62 00 sts 0x0062, r24 break; - 258: 0a c0 rjmp .+20 ; 0x26e + 1ec: 06 c0 rjmp .+12 ; 0x1fa } case SETRUN: { rf12_endasyncrx(); - 25a: 0e 94 c1 02 call 0x582 ; 0x582 + 1ee: 7e d1 rcall .+764 ; 0x4ec turn(); - 25e: 0e 94 53 00 call 0xa6 ; 0xa6 + 1f0: 32 df rcall .-412 ; 0x56 rf12_beginasyncrx(); - 262: 0e 94 a7 02 call 0x54e ; 0x54e + 1f2: 69 d1 rcall .+722 ; 0x4c6 return; - 266: 13 c0 rjmp .+38 ; 0x28e + 1f4: 13 c0 rjmp .+38 ; 0x21c } default: { rf12_endasyncrx(); - 268: 0e 94 c1 02 call 0x582 ; 0x582 + 1f6: 7a d1 rcall .+756 ; 0x4ec return; - 26c: 10 c0 rjmp .+32 ; 0x28e + 1f8: 11 c0 rjmp .+34 ; 0x21c } } rf12_endasyncrx(); - 26e: 0e 94 c1 02 call 0x582 ; 0x582 - 272: 8f e3 ldi r24, 0x3F ; 63 - 274: 9c e9 ldi r25, 0x9C ; 156 - 276: 01 97 sbiw r24, 0x01 ; 1 - 278: f1 f7 brne .-4 ; 0x276 - 27a: 00 c0 rjmp .+0 ; 0x27c - 27c: 00 00 nop + 1fa: 78 d1 rcall .+752 ; 0x4ec + 1fc: 2f e7 ldi r18, 0x7F ; 127 + 1fe: 88 e3 ldi r24, 0x38 ; 56 + 200: 91 e0 ldi r25, 0x01 ; 1 + 202: 21 50 subi r18, 0x01 ; 1 + 204: 80 40 sbci r24, 0x00 ; 0 + 206: 90 40 sbci r25, 0x00 ; 0 + 208: e1 f7 brne .-8 ; 0x202 + 20a: 00 c0 rjmp .+0 ; 0x20c + 20c: 00 00 nop _delay_ms(10+DEVICE); rf12_txpacket(MASTER, DEVICE, status); - 27e: 40 91 02 01 lds r20, 0x0102 - 282: 50 91 03 01 lds r21, 0x0103 - 286: 6a e0 ldi r22, 0x0A ; 10 - 288: 81 e0 ldi r24, 0x01 ; 1 - 28a: 0e 94 c6 02 call 0x58c ; 0x58c + 20e: 40 91 62 00 lds r20, 0x0062 + 212: 50 91 63 00 lds r21, 0x0063 + 216: 68 e2 ldi r22, 0x28 ; 40 + 218: 81 e0 ldi r24, 0x01 ; 1 + 21a: 6c d1 rcall .+728 ; 0x4f4 return; } } } - 28e: cf 91 pop r28 - 290: 08 95 ret + 21c: cf 91 pop r28 + 21e: 08 95 ret -00000292 : +00000220 : // Clock value: 7,813 kHz // Mode: Normal top=0xFF // OC0A output: Disconnected // OC0B output: Disconnected // Timer Period: 21,504 ms TCCR0A = (0< - 2ae: 00 c0 rjmp .+0 ; 0x2b0 - 2b0: 00 00 nop + 232: 8f ea ldi r24, 0xAF ; 175 + 234: 94 e0 ldi r25, 0x04 ; 4 + 236: 01 97 sbiw r24, 0x01 ; 1 + 238: f1 f7 brne .-4 ; 0x236 + 23a: 00 c0 rjmp .+0 ; 0x23c + 23c: 00 00 nop _delay_us(LEFT); for(int i=0;i - 2c0: 80 e0 ldi r24, 0x00 ; 0 - 2c2: 90 e0 ldi r25, 0x00 ; 0 - 2c4: 25 e1 ldi r18, 0x15 ; 21 - 2c6: 2a 95 dec r18 - 2c8: f1 f7 brne .-4 ; 0x2c6 - 2ca: 00 00 nop - 2cc: 01 96 adiw r24, 0x01 ; 1 - 2ce: 20 91 00 01 lds r18, 0x0100 - 2d2: 30 91 01 01 lds r19, 0x0101 - 2d6: 82 17 cp r24, r18 - 2d8: 93 07 cpc r25, r19 - 2da: a4 f3 brlt .-24 ; 0x2c4 + 23e: 80 91 60 00 lds r24, 0x0060 + 242: 90 91 61 00 lds r25, 0x0061 + 246: 18 16 cp r1, r24 + 248: 19 06 cpc r1, r25 + 24a: 74 f4 brge .+28 ; 0x268 + 24c: 80 e0 ldi r24, 0x00 ; 0 + 24e: 90 e0 ldi r25, 0x00 ; 0 + 250: 25 e1 ldi r18, 0x15 ; 21 + 252: 2a 95 dec r18 + 254: f1 f7 brne .-4 ; 0x252 + 256: 00 00 nop + 258: 01 96 adiw r24, 0x01 ; 1 + 25a: 20 91 60 00 lds r18, 0x0060 + 25e: 30 91 61 00 lds r19, 0x0061 + 262: 82 17 cp r24, r18 + 264: 93 07 cpc r25, r19 + 266: a4 f3 brlt .-24 ; 0x250 _delay_us(STEP); } PORTB &= ~(1<: +0000026c <__vector_11>: } -ISR(TIMER0_OVF_vect) { - 2e0: 1f 92 push r1 - 2e2: 0f 92 push r0 - 2e4: 0f b6 in r0, 0x3f ; 63 - 2e6: 0f 92 push r0 - 2e8: 11 24 eor r1, r1 - 2ea: 2f 93 push r18 - 2ec: 3f 93 push r19 - 2ee: 8f 93 push r24 - 2f0: 9f 93 push r25 +ISR(TIM0_OVF_vect) { + 26c: 1f 92 push r1 + 26e: 0f 92 push r0 + 270: 0f b6 in r0, 0x3f ; 63 + 272: 0f 92 push r0 + 274: 11 24 eor r1, r1 + 276: 2f 93 push r18 + 278: 3f 93 push r19 + 27a: 8f 93 push r24 + 27c: 9f 93 push r25 // Reinitialize Timer 0 value TCNT0 = 0x58; - 2f2: 88 e5 ldi r24, 0x58 ; 88 - 2f4: 86 bd out 0x26, r24 ; 38 + 27e: 88 e5 ldi r24, 0x58 ; 88 + 280: 82 bf out 0x32, r24 ; 50 if(status == SLEEP) { - 2f6: 80 91 02 01 lds r24, 0x0102 - 2fa: 90 91 03 01 lds r25, 0x0103 - 2fe: 02 97 sbiw r24, 0x02 ; 2 - 300: 79 f4 brne .+30 ; 0x320 <__vector_16+0x40> + 282: 80 91 62 00 lds r24, 0x0062 + 286: 90 91 63 00 lds r25, 0x0063 + 28a: 02 97 sbiw r24, 0x02 ; 2 + 28c: 79 f4 brne .+30 ; 0x2ac <__vector_11+0x40> if(pwm_led > 50) { - 302: 80 91 04 01 lds r24, 0x0104 - 306: 90 91 05 01 lds r25, 0x0105 - 30a: c3 97 sbiw r24, 0x33 ; 51 - 30c: 94 f1 brlt .+100 ; 0x372 <__vector_16+0x92> - PORTD ^= (1< + PORTB ^= (1< + 2a2: 10 92 65 00 sts 0x0065, r1 + 2a6: 10 92 64 00 sts 0x0064, r1 + 2aa: 29 c0 rjmp .+82 ; 0x2fe <__vector_11+0x92> } } else if(status == ACTIVE) { - 320: 80 91 02 01 lds r24, 0x0102 - 324: 90 91 03 01 lds r25, 0x0103 - 328: 03 97 sbiw r24, 0x03 ; 3 - 32a: 79 f4 brne .+30 ; 0x34a <__vector_16+0x6a> + 2ac: 80 91 62 00 lds r24, 0x0062 + 2b0: 90 91 63 00 lds r25, 0x0063 + 2b4: 03 97 sbiw r24, 0x03 ; 3 + 2b6: 79 f4 brne .+30 ; 0x2d6 <__vector_11+0x6a> if(pwm_led > 5) { - 32c: 80 91 04 01 lds r24, 0x0104 - 330: 90 91 05 01 lds r25, 0x0105 - 334: 06 97 sbiw r24, 0x06 ; 6 - 336: ec f0 brlt .+58 ; 0x372 <__vector_16+0x92> - PORTD ^= (1< + PORTB ^= (1< + 2cc: 10 92 65 00 sts 0x0065, r1 + 2d0: 10 92 64 00 sts 0x0064, r1 + 2d4: 14 c0 rjmp .+40 ; 0x2fe <__vector_11+0x92> } } else if(status == RUN) { - 34a: 80 91 02 01 lds r24, 0x0102 - 34e: 90 91 03 01 lds r25, 0x0103 - 352: 06 97 sbiw r24, 0x06 ; 6 - 354: 71 f4 brne .+28 ; 0x372 <__vector_16+0x92> + 2d6: 80 91 62 00 lds r24, 0x0062 + 2da: 90 91 63 00 lds r25, 0x0063 + 2de: 06 97 sbiw r24, 0x06 ; 6 + 2e0: 71 f4 brne .+28 ; 0x2fe <__vector_11+0x92> if(pwm_led > 1) { - 356: 80 91 04 01 lds r24, 0x0104 - 35a: 90 91 05 01 lds r25, 0x0105 - 35e: 02 97 sbiw r24, 0x02 ; 2 - 360: 44 f0 brlt .+16 ; 0x372 <__vector_16+0x92> - PORTD ^= (1< + PORTB ^= (1< - 390: 00 c0 rjmp .+0 ; 0x392 <__vector_16+0xb2> - 392: 00 00 nop + 312: c0 9a sbi 0x18, 0 ; 24 + 314: 8f ea ldi r24, 0xAF ; 175 + 316: 94 e0 ldi r25, 0x04 ; 4 + 318: 01 97 sbiw r24, 0x01 ; 1 + 31a: f1 f7 brne .-4 ; 0x318 <__vector_11+0xac> + 31c: 00 c0 rjmp .+0 ; 0x31e <__vector_11+0xb2> + 31e: 00 00 nop _delay_us(LEFT); for(int i=0;i - 3a2: 80 e0 ldi r24, 0x00 ; 0 - 3a4: 90 e0 ldi r25, 0x00 ; 0 - 3a6: 25 e1 ldi r18, 0x15 ; 21 - 3a8: 2a 95 dec r18 - 3aa: f1 f7 brne .-4 ; 0x3a8 <__vector_16+0xc8> - 3ac: 00 00 nop - 3ae: 01 96 adiw r24, 0x01 ; 1 - 3b0: 20 91 00 01 lds r18, 0x0100 - 3b4: 30 91 01 01 lds r19, 0x0101 - 3b8: 82 17 cp r24, r18 - 3ba: 93 07 cpc r25, r19 - 3bc: a4 f3 brlt .-24 ; 0x3a6 <__vector_16+0xc6> + 320: 80 91 60 00 lds r24, 0x0060 + 324: 90 91 61 00 lds r25, 0x0061 + 328: 18 16 cp r1, r24 + 32a: 19 06 cpc r1, r25 + 32c: 74 f4 brge .+28 ; 0x34a <__vector_11+0xde> + 32e: 80 e0 ldi r24, 0x00 ; 0 + 330: 90 e0 ldi r25, 0x00 ; 0 + 332: 25 e1 ldi r18, 0x15 ; 21 + 334: 2a 95 dec r18 + 336: f1 f7 brne .-4 ; 0x334 <__vector_11+0xc8> + 338: 00 00 nop + 33a: 01 96 adiw r24, 0x01 ; 1 + 33c: 20 91 60 00 lds r18, 0x0060 + 340: 30 91 61 00 lds r19, 0x0061 + 344: 82 17 cp r24, r18 + 346: 93 07 cpc r25, r19 + 348: a4 f3 brlt .-24 ; 0x332 <__vector_11+0xc6> _delay_us(STEP); } PORTB &= ~(1<: +0000035e
: int main(void) { rf12_init(); // ein paar Register setzen (z.B. CLK auf 10MHz) - 3d2: 0e 94 1e 02 call 0x43c ; 0x43c + 35e: 2f d0 rcall .+94 ; 0x3be rf12_setfreq(RF12FREQ(433.92)); // Sende/Empfangsfrequenz auf 433,92MHz einstellen - 3d6: 80 e2 ldi r24, 0x20 ; 32 - 3d8: 96 e0 ldi r25, 0x06 ; 6 - 3da: 0e 94 5f 02 call 0x4be ; 0x4be + 360: 80 e2 ldi r24, 0x20 ; 32 + 362: 96 e0 ldi r25, 0x06 ; 6 + 364: 6b d0 rcall .+214 ; 0x43c rf12_setbandwidth(1, 0, 7); // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm - 3de: 47 e0 ldi r20, 0x07 ; 7 - 3e0: 60 e0 ldi r22, 0x00 ; 0 - 3e2: 81 e0 ldi r24, 0x01 ; 1 - 3e4: 0e 94 48 02 call 0x490 ; 0x490 + 366: 47 e0 ldi r20, 0x07 ; 7 + 368: 60 e0 ldi r22, 0x00 ; 0 + 36a: 81 e0 ldi r24, 0x01 ; 1 + 36c: 4b d0 rcall .+150 ; 0x404 rf12_setbaud(9600); // 19200 baud - 3e8: 80 e8 ldi r24, 0x80 ; 128 - 3ea: 95 e2 ldi r25, 0x25 ; 37 - 3ec: 0e 94 6f 02 call 0x4de ; 0x4de + 36e: 80 e8 ldi r24, 0x80 ; 128 + 370: 95 e2 ldi r25, 0x25 ; 37 + 372: 73 d0 rcall .+230 ; 0x45a rf12_setpower(0, 6); // 1mW Ausgangsleistung, 120kHz Frequenzshift - 3f0: 66 e0 ldi r22, 0x06 ; 6 - 3f2: 80 e0 ldi r24, 0x00 ; 0 - 3f4: 0e 94 96 02 call 0x52c ; 0x52c + 374: 66 e0 ldi r22, 0x06 ; 6 + 376: 80 e0 ldi r24, 0x00 ; 0 + 378: 93 d0 rcall .+294 ; 0x4a0 init_timer(); - 3f8: 0e 94 49 01 call 0x292 ; 0x292 - DDRD |= (1< + DDRB |= (1< - 408: fd cf rjmp .-6 ; 0x404 + 388: fb de rcall .-522 ; 0x180 + 38a: fe cf rjmp .-4 ; 0x388 -0000040a : +0000038c : unsigned short rf12_trans(unsigned short wert) { unsigned short werti = 0; unsigned char i; RF_PORT &= ~(1< unsigned short rf12_trans(unsigned short wert) { unsigned short werti = 0; - 40e: 20 e0 ldi r18, 0x00 ; 0 - 410: 30 e0 ldi r19, 0x00 ; 0 + 390: 20 e0 ldi r18, 0x00 ; 0 + 392: 30 e0 ldi r19, 0x00 ; 0 unsigned char i; RF_PORT &= ~(1< + 394: 99 23 and r25, r25 + 396: 14 f4 brge .+4 ; 0x39c RF_PORT |= (1< + 398: db 9a sbi 0x1b, 3 ; 27 + 39a: 01 c0 rjmp .+2 ; 0x39e } else { RF_PORT &= ~(1< - 42c: 00 00 nop + 3a8: 88 0f add r24, r24 + 3aa: 99 1f adc r25, r25 + 3ac: 00 c0 rjmp .+0 ; 0x3ae + 3ae: 00 00 nop _delay_us(0.3); RF_PORT &= ~(1< + 3b4: 79 f7 brne .-34 ; 0x394 RF_PORT |= (1<: +000003be : void rf12_init(void) { RF_DDR |= (1< - 452: 00 c0 rjmp .+0 ; 0x454 - 454: 00 00 nop + 3c6: 2f ef ldi r18, 0xFF ; 255 + 3c8: 80 e7 ldi r24, 0x70 ; 112 + 3ca: 92 e0 ldi r25, 0x02 ; 2 + 3cc: 21 50 subi r18, 0x01 ; 1 + 3ce: 80 40 sbci r24, 0x00 ; 0 + 3d0: 90 40 sbci r25, 0x00 ; 0 + 3d2: e1 f7 brne .-8 ; 0x3cc + 3d4: 00 c0 rjmp .+0 ; 0x3d6 + 3d6: 00 00 nop _delay_ms(100); rf12_trans(0xC0E0); // AVR CLK: 10MHz - 456: 80 ee ldi r24, 0xE0 ; 224 - 458: 90 ec ldi r25, 0xC0 ; 192 - 45a: 0e 94 05 02 call 0x40a ; 0x40a + 3d8: 80 ee ldi r24, 0xE0 ; 224 + 3da: 90 ec ldi r25, 0xC0 ; 192 + 3dc: d7 df rcall .-82 ; 0x38c rf12_trans(0x80D7); // Enable FIFO - 45e: 87 ed ldi r24, 0xD7 ; 215 - 460: 90 e8 ldi r25, 0x80 ; 128 - 462: 0e 94 05 02 call 0x40a ; 0x40a + 3de: 87 ed ldi r24, 0xD7 ; 215 + 3e0: 90 e8 ldi r25, 0x80 ; 128 + 3e2: d4 df rcall .-88 ; 0x38c rf12_trans(0xC2AB); // Data Filter: internal - 466: 8b ea ldi r24, 0xAB ; 171 - 468: 92 ec ldi r25, 0xC2 ; 194 - 46a: 0e 94 05 02 call 0x40a ; 0x40a + 3e4: 8b ea ldi r24, 0xAB ; 171 + 3e6: 92 ec ldi r25, 0xC2 ; 194 + 3e8: d1 df rcall .-94 ; 0x38c rf12_trans(0xCA81); // Set FIFO mode - 46e: 81 e8 ldi r24, 0x81 ; 129 - 470: 9a ec ldi r25, 0xCA ; 202 - 472: 0e 94 05 02 call 0x40a ; 0x40a + 3ea: 81 e8 ldi r24, 0x81 ; 129 + 3ec: 9a ec ldi r25, 0xCA ; 202 + 3ee: ce df rcall .-100 ; 0x38c rf12_trans(0xE000); // disable wakeuptimer - 476: 80 e0 ldi r24, 0x00 ; 0 - 478: 90 ee ldi r25, 0xE0 ; 224 - 47a: 0e 94 05 02 call 0x40a ; 0x40a + 3f0: 80 e0 ldi r24, 0x00 ; 0 + 3f2: 90 ee ldi r25, 0xE0 ; 224 + 3f4: cb df rcall .-106 ; 0x38c rf12_trans(0xC800); // disable low duty cycle - 47e: 80 e0 ldi r24, 0x00 ; 0 - 480: 98 ec ldi r25, 0xC8 ; 200 - 482: 0e 94 05 02 call 0x40a ; 0x40a + 3f6: 80 e0 ldi r24, 0x00 ; 0 + 3f8: 98 ec ldi r25, 0xC8 ; 200 + 3fa: c8 df rcall .-112 ; 0x38c rf12_trans(0xC4F7); // AFC settings: autotuning: -10kHz...+7,5kHz - 486: 87 ef ldi r24, 0xF7 ; 247 - 488: 94 ec ldi r25, 0xC4 ; 196 - 48a: 0e 94 05 02 call 0x40a ; 0x40a - 48e: 08 95 ret + 3fc: 87 ef ldi r24, 0xF7 ; 247 + 3fe: 94 ec ldi r25, 0xC4 ; 196 + 400: c5 df rcall .-118 ; 0x38c + 402: 08 95 ret -00000490 : +00000404 : } void rf12_setbandwidth(unsigned char bandwidth, unsigned char gain, unsigned char drssi) { rf12_trans(0x9400|((bandwidth&7)<<5)|((gain&3)<<3)|(drssi&7)); - 490: 47 70 andi r20, 0x07 ; 7 - 492: 50 e0 ldi r21, 0x00 ; 0 - 494: 54 69 ori r21, 0x94 ; 148 - 496: 63 70 andi r22, 0x03 ; 3 - 498: 70 e0 ldi r23, 0x00 ; 0 - 49a: 66 0f add r22, r22 - 49c: 77 1f adc r23, r23 - 49e: 66 0f add r22, r22 - 4a0: 77 1f adc r23, r23 - 4a2: 66 0f add r22, r22 - 4a4: 77 1f adc r23, r23 - 4a6: 20 e2 ldi r18, 0x20 ; 32 - 4a8: 82 9f mul r24, r18 - 4aa: c0 01 movw r24, r0 - 4ac: 11 24 eor r1, r1 - 4ae: 99 27 eor r25, r25 - 4b0: 86 2b or r24, r22 - 4b2: 97 2b or r25, r23 - 4b4: 84 2b or r24, r20 - 4b6: 95 2b or r25, r21 - 4b8: 0e 94 05 02 call 0x40a ; 0x40a - 4bc: 08 95 ret + 404: 47 70 andi r20, 0x07 ; 7 + 406: 50 e0 ldi r21, 0x00 ; 0 + 408: 54 69 ori r21, 0x94 ; 148 + 40a: 63 70 andi r22, 0x03 ; 3 + 40c: 26 2f mov r18, r22 + 40e: 30 e0 ldi r19, 0x00 ; 0 + 410: 22 0f add r18, r18 + 412: 33 1f adc r19, r19 + 414: 22 0f add r18, r18 + 416: 33 1f adc r19, r19 + 418: 22 0f add r18, r18 + 41a: 33 1f adc r19, r19 + 41c: 90 e0 ldi r25, 0x00 ; 0 + 41e: 88 0f add r24, r24 + 420: 99 1f adc r25, r25 + 422: 82 95 swap r24 + 424: 92 95 swap r25 + 426: 90 7f andi r25, 0xF0 ; 240 + 428: 98 27 eor r25, r24 + 42a: 80 7f andi r24, 0xF0 ; 240 + 42c: 98 27 eor r25, r24 + 42e: 99 27 eor r25, r25 + 430: 82 2b or r24, r18 + 432: 93 2b or r25, r19 + 434: 84 2b or r24, r20 + 436: 95 2b or r25, r21 + 438: a9 df rcall .-174 ; 0x38c + 43a: 08 95 ret -000004be : +0000043c : } void rf12_setfreq(unsigned short freq) { if (freq<96) { // 430,2400MHz - 4be: 80 36 cpi r24, 0x60 ; 96 - 4c0: 91 05 cpc r25, r1 - 4c2: 38 f0 brcs .+14 ; 0x4d2 - 4c4: 80 34 cpi r24, 0x40 ; 64 - 4c6: 2f e0 ldi r18, 0x0F ; 15 - 4c8: 92 07 cpc r25, r18 - 4ca: 28 f0 brcs .+10 ; 0x4d6 - 4cc: 8f e3 ldi r24, 0x3F ; 63 - 4ce: 9f e0 ldi r25, 0x0F ; 15 - 4d0: 02 c0 rjmp .+4 ; 0x4d6 + 43c: 80 36 cpi r24, 0x60 ; 96 + 43e: 91 05 cpc r25, r1 + 440: 38 f0 brcs .+14 ; 0x450 + 442: 80 34 cpi r24, 0x40 ; 64 + 444: 2f e0 ldi r18, 0x0F ; 15 + 446: 92 07 cpc r25, r18 + 448: 28 f0 brcs .+10 ; 0x454 + 44a: 8f e3 ldi r24, 0x3F ; 63 + 44c: 9f e0 ldi r25, 0x0F ; 15 + 44e: 02 c0 rjmp .+4 ; 0x454 freq=96; - 4d2: 80 e6 ldi r24, 0x60 ; 96 - 4d4: 90 e0 ldi r25, 0x00 ; 0 + 450: 80 e6 ldi r24, 0x60 ; 96 + 452: 90 e0 ldi r25, 0x00 ; 0 } else if (freq>3903) { // 439,7575MHz freq=3903; } rf12_trans(0xA000|freq); - 4d6: 90 6a ori r25, 0xA0 ; 160 - 4d8: 0e 94 05 02 call 0x40a ; 0x40a - 4dc: 08 95 ret + 454: 90 6a ori r25, 0xA0 ; 160 + 456: 9a df rcall .-204 ; 0x38c + 458: 08 95 ret -000004de : +0000045a : } void rf12_setbaud(unsigned short baud) { if (baud<663) { - 4de: 87 39 cpi r24, 0x97 ; 151 - 4e0: 22 e0 ldi r18, 0x02 ; 2 - 4e2: 92 07 cpc r25, r18 - 4e4: 10 f1 brcs .+68 ; 0x52a <__stack+0x2b> + 45a: 87 39 cpi r24, 0x97 ; 151 + 45c: 22 e0 ldi r18, 0x02 ; 2 + 45e: 92 07 cpc r25, r18 + 460: f0 f0 brcs .+60 ; 0x49e return; } if (baud<5400) { // Baudrate= 344827,58621/(R+1)/(1+CS*7) - 4e6: 88 31 cpi r24, 0x18 ; 24 - 4e8: 25 e1 ldi r18, 0x15 ; 21 - 4ea: 92 07 cpc r25, r18 - 4ec: 80 f4 brcc .+32 ; 0x50e <__stack+0xf> + 462: 88 31 cpi r24, 0x18 ; 24 + 464: 25 e1 ldi r18, 0x15 ; 21 + 466: 92 07 cpc r25, r18 + 468: 70 f4 brcc .+28 ; 0x486 rf12_trans(0xC680|((43104/baud)-1)); - 4ee: 9c 01 movw r18, r24 - 4f0: 40 e0 ldi r20, 0x00 ; 0 - 4f2: 50 e0 ldi r21, 0x00 ; 0 - 4f4: 60 e6 ldi r22, 0x60 ; 96 - 4f6: 78 ea ldi r23, 0xA8 ; 168 - 4f8: 80 e0 ldi r24, 0x00 ; 0 - 4fa: 90 e0 ldi r25, 0x00 ; 0 - 4fc: 0e 94 3e 03 call 0x67c ; 0x67c <__divmodsi4> - 500: c9 01 movw r24, r18 - 502: 01 97 sbiw r24, 0x01 ; 1 - 504: 80 68 ori r24, 0x80 ; 128 - 506: 96 6c ori r25, 0xC6 ; 198 - 508: 0e 94 05 02 call 0x40a ; 0x40a - 50c: 08 95 ret + 46a: 9c 01 movw r18, r24 + 46c: 40 e0 ldi r20, 0x00 ; 0 + 46e: 50 e0 ldi r21, 0x00 ; 0 + 470: 60 e6 ldi r22, 0x60 ; 96 + 472: 78 ea ldi r23, 0xA8 ; 168 + 474: 80 e0 ldi r24, 0x00 ; 0 + 476: 90 e0 ldi r25, 0x00 ; 0 + 478: a0 d0 rcall .+320 ; 0x5ba <__divmodsi4> + 47a: c9 01 movw r24, r18 + 47c: 01 97 sbiw r24, 0x01 ; 1 + 47e: 80 68 ori r24, 0x80 ; 128 + 480: 96 6c ori r25, 0xC6 ; 198 + 482: 84 df rcall .-248 ; 0x38c + 484: 08 95 ret } else { rf12_trans(0xC600|((344828UL/baud)-1)); - 50e: 9c 01 movw r18, r24 - 510: 40 e0 ldi r20, 0x00 ; 0 - 512: 50 e0 ldi r21, 0x00 ; 0 - 514: 6c ef ldi r22, 0xFC ; 252 - 516: 72 e4 ldi r23, 0x42 ; 66 - 518: 85 e0 ldi r24, 0x05 ; 5 - 51a: 90 e0 ldi r25, 0x00 ; 0 - 51c: 0e 94 1c 03 call 0x638 ; 0x638 <__udivmodsi4> - 520: c9 01 movw r24, r18 - 522: 01 97 sbiw r24, 0x01 ; 1 - 524: 96 6c ori r25, 0xC6 ; 198 - 526: 0e 94 05 02 call 0x40a ; 0x40a - 52a: 08 95 ret + 486: 9c 01 movw r18, r24 + 488: 40 e0 ldi r20, 0x00 ; 0 + 48a: 50 e0 ldi r21, 0x00 ; 0 + 48c: 6c ef ldi r22, 0xFC ; 252 + 48e: 72 e4 ldi r23, 0x42 ; 66 + 490: 85 e0 ldi r24, 0x05 ; 5 + 492: 90 e0 ldi r25, 0x00 ; 0 + 494: 70 d0 rcall .+224 ; 0x576 <__udivmodsi4> + 496: c9 01 movw r24, r18 + 498: 01 97 sbiw r24, 0x01 ; 1 + 49a: 96 6c ori r25, 0xC6 ; 198 + 49c: 77 df rcall .-274 ; 0x38c + 49e: 08 95 ret -0000052c : +000004a0 : } } void rf12_setpower(unsigned char power, unsigned char mod) { rf12_trans(0x9800|(power&7)|((mod&15)<<4)); - 52c: 87 70 andi r24, 0x07 ; 7 - 52e: 90 e0 ldi r25, 0x00 ; 0 - 530: 98 69 ori r25, 0x98 ; 152 - 532: 20 e1 ldi r18, 0x10 ; 16 - 534: 62 9f mul r22, r18 - 536: b0 01 movw r22, r0 - 538: 11 24 eor r1, r1 - 53a: 77 27 eor r23, r23 - 53c: 86 2b or r24, r22 - 53e: 97 2b or r25, r23 - 540: 0e 94 05 02 call 0x40a ; 0x40a - 544: 08 95 ret + 4a0: 87 70 andi r24, 0x07 ; 7 + 4a2: 90 e0 ldi r25, 0x00 ; 0 + 4a4: 98 69 ori r25, 0x98 ; 152 + 4a6: 70 e0 ldi r23, 0x00 ; 0 + 4a8: 62 95 swap r22 + 4aa: 72 95 swap r23 + 4ac: 70 7f andi r23, 0xF0 ; 240 + 4ae: 76 27 eor r23, r22 + 4b0: 60 7f andi r22, 0xF0 ; 240 + 4b2: 76 27 eor r23, r22 + 4b4: 77 27 eor r23, r23 + 4b6: 86 2b or r24, r22 + 4b8: 97 2b or r25, r23 + 4ba: 68 df rcall .-304 ; 0x38c + 4bc: 08 95 ret -00000546 : +000004be : } void rf12_ready(void) { RF_PORT &= ~(1< + 4c0: c8 9b sbis 0x19, 0 ; 25 + 4c2: fe cf rjmp .-4 ; 0x4c0 } - 54c: 08 95 ret + 4c4: 08 95 ret -0000054e : +000004c6 : void rf12_beginasyncrx() { rf12_trans(0x82C8); // RX on - 54e: 88 ec ldi r24, 0xC8 ; 200 - 550: 92 e8 ldi r25, 0x82 ; 130 - 552: 0e 94 05 02 call 0x40a ; 0x40a + 4c6: 88 ec ldi r24, 0xC8 ; 200 + 4c8: 92 e8 ldi r25, 0x82 ; 130 + 4ca: 60 df rcall .-320 ; 0x38c rf12_trans(0xCA81); // set FIFO mode - 556: 81 e8 ldi r24, 0x81 ; 129 - 558: 9a ec ldi r25, 0xCA ; 202 - 55a: 0e 94 05 02 call 0x40a ; 0x40a + 4cc: 81 e8 ldi r24, 0x81 ; 129 + 4ce: 9a ec ldi r25, 0xCA ; 202 + 4d0: 5d df rcall .-326 ; 0x38c rf12_trans(0xCA83); // enable FIFO - 55e: 83 e8 ldi r24, 0x83 ; 131 - 560: 9a ec ldi r25, 0xCA ; 202 - 562: 0e 94 05 02 call 0x40a ; 0x40a - 566: 08 95 ret + 4d2: 83 e8 ldi r24, 0x83 ; 131 + 4d4: 9a ec ldi r25, 0xCA ; 202 + 4d6: 5a df rcall .-332 ; 0x38c + 4d8: 08 95 ret -00000568 : +000004da : } uint8_t rf12_hasdata() { RF_PORT &= ~(1<: +000004e4 : uint8_t rf12_rxbyte() { return rf12_trans(0xB000); - 578: 80 e0 ldi r24, 0x00 ; 0 - 57a: 90 eb ldi r25, 0xB0 ; 176 - 57c: 0e 94 05 02 call 0x40a ; 0x40a + 4e4: 80 e0 ldi r24, 0x00 ; 0 + 4e6: 90 eb ldi r25, 0xB0 ; 176 + 4e8: 51 df rcall .-350 ; 0x38c } - 580: 08 95 ret + 4ea: 08 95 ret -00000582 : +000004ec : void rf12_endasyncrx() { rf12_trans(0x8208); // RX off - 582: 88 e0 ldi r24, 0x08 ; 8 - 584: 92 e8 ldi r25, 0x82 ; 130 - 586: 0e 94 05 02 call 0x40a ; 0x40a - 58a: 08 95 ret + 4ec: 88 e0 ldi r24, 0x08 ; 8 + 4ee: 92 e8 ldi r25, 0x82 ; 130 + 4f0: 4d df rcall .-358 ; 0x38c + 4f2: 08 95 ret -0000058c : +000004f4 : *data++=rf12_trans(0xB000); } rf12_trans(0x8208); // RX off } void rf12_txpacket(uint8_t addr, uint8_t from, uint8_t data) { - 58c: 1f 93 push r17 - 58e: cf 93 push r28 - 590: df 93 push r29 - 592: 18 2f mov r17, r24 - 594: d6 2f mov r29, r22 - 596: c4 2f mov r28, r20 + 4f4: 1f 93 push r17 + 4f6: cf 93 push r28 + 4f8: df 93 push r29 + 4fa: 18 2f mov r17, r24 + 4fc: d6 2f mov r29, r22 + 4fe: c4 2f mov r28, r20 rf12_trans(0x8238); // TX on - 598: 88 e3 ldi r24, 0x38 ; 56 - 59a: 92 e8 ldi r25, 0x82 ; 130 - 59c: 0e 94 05 02 call 0x40a ; 0x40a + 500: 88 e3 ldi r24, 0x38 ; 56 + 502: 92 e8 ldi r25, 0x82 ; 130 + 504: 43 df rcall .-378 ; 0x38c rf12_ready(); - 5a0: 0e 94 a3 02 call 0x546 ; 0x546 + 506: db df rcall .-74 ; 0x4be rf12_trans(0xB8AA); - 5a4: 8a ea ldi r24, 0xAA ; 170 - 5a6: 98 eb ldi r25, 0xB8 ; 184 - 5a8: 0e 94 05 02 call 0x40a ; 0x40a + 508: 8a ea ldi r24, 0xAA ; 170 + 50a: 98 eb ldi r25, 0xB8 ; 184 + 50c: 3f df rcall .-386 ; 0x38c rf12_ready(); - 5ac: 0e 94 a3 02 call 0x546 ; 0x546 + 50e: d7 df rcall .-82 ; 0x4be rf12_trans(0xB8AA); - 5b0: 8a ea ldi r24, 0xAA ; 170 - 5b2: 98 eb ldi r25, 0xB8 ; 184 - 5b4: 0e 94 05 02 call 0x40a ; 0x40a + 510: 8a ea ldi r24, 0xAA ; 170 + 512: 98 eb ldi r25, 0xB8 ; 184 + 514: 3b df rcall .-394 ; 0x38c rf12_ready(); - 5b8: 0e 94 a3 02 call 0x546 ; 0x546 + 516: d3 df rcall .-90 ; 0x4be rf12_trans(0xB8AA); - 5bc: 8a ea ldi r24, 0xAA ; 170 - 5be: 98 eb ldi r25, 0xB8 ; 184 - 5c0: 0e 94 05 02 call 0x40a ; 0x40a + 518: 8a ea ldi r24, 0xAA ; 170 + 51a: 98 eb ldi r25, 0xB8 ; 184 + 51c: 37 df rcall .-402 ; 0x38c rf12_ready(); - 5c4: 0e 94 a3 02 call 0x546 ; 0x546 + 51e: cf df rcall .-98 ; 0x4be rf12_trans(0xB82D); - 5c8: 8d e2 ldi r24, 0x2D ; 45 - 5ca: 98 eb ldi r25, 0xB8 ; 184 - 5cc: 0e 94 05 02 call 0x40a ; 0x40a + 520: 8d e2 ldi r24, 0x2D ; 45 + 522: 98 eb ldi r25, 0xB8 ; 184 + 524: 33 df rcall .-410 ; 0x38c rf12_ready(); - 5d0: 0e 94 a3 02 call 0x546 ; 0x546 + 526: cb df rcall .-106 ; 0x4be rf12_trans(0xB8D4); - 5d4: 84 ed ldi r24, 0xD4 ; 212 - 5d6: 98 eb ldi r25, 0xB8 ; 184 - 5d8: 0e 94 05 02 call 0x40a ; 0x40a + 528: 84 ed ldi r24, 0xD4 ; 212 + 52a: 98 eb ldi r25, 0xB8 ; 184 + 52c: 2f df rcall .-418 ; 0x38c rf12_ready(); - 5dc: 0e 94 a3 02 call 0x546 ; 0x546 + 52e: c7 df rcall .-114 ; 0x4be rf12_trans(0xB800|addr); - 5e0: 81 2f mov r24, r17 - 5e2: 90 e0 ldi r25, 0x00 ; 0 - 5e4: 98 6b ori r25, 0xB8 ; 184 - 5e6: 0e 94 05 02 call 0x40a ; 0x40a + 530: 81 2f mov r24, r17 + 532: 90 e0 ldi r25, 0x00 ; 0 + 534: 98 6b ori r25, 0xB8 ; 184 + 536: 2a df rcall .-428 ; 0x38c rf12_ready(); - 5ea: 0e 94 a3 02 call 0x546 ; 0x546 + 538: c2 df rcall .-124 ; 0x4be rf12_trans(0xB800|from); - 5ee: 8d 2f mov r24, r29 - 5f0: 90 e0 ldi r25, 0x00 ; 0 - 5f2: 98 6b ori r25, 0xB8 ; 184 - 5f4: 0e 94 05 02 call 0x40a ; 0x40a + 53a: 8d 2f mov r24, r29 + 53c: 90 e0 ldi r25, 0x00 ; 0 + 53e: 98 6b ori r25, 0xB8 ; 184 + 540: 25 df rcall .-438 ; 0x38c rf12_ready(); - 5f8: 0e 94 a3 02 call 0x546 ; 0x546 + 542: bd df rcall .-134 ; 0x4be rf12_trans(0xB800|data); - 5fc: 8c 2f mov r24, r28 - 5fe: 90 e0 ldi r25, 0x00 ; 0 - 600: 98 6b ori r25, 0xB8 ; 184 - 602: 0e 94 05 02 call 0x40a ; 0x40a + 544: 8c 2f mov r24, r28 + 546: 90 e0 ldi r25, 0x00 ; 0 + 548: 98 6b ori r25, 0xB8 ; 184 + 54a: 20 df rcall .-448 ; 0x38c rf12_ready(); - 606: 0e 94 a3 02 call 0x546 ; 0x546 + 54c: b8 df rcall .-144 ; 0x4be rf12_trans(0xB800); - 60a: 80 e0 ldi r24, 0x00 ; 0 - 60c: 98 eb ldi r25, 0xB8 ; 184 - 60e: 0e 94 05 02 call 0x40a ; 0x40a + 54e: 80 e0 ldi r24, 0x00 ; 0 + 550: 98 eb ldi r25, 0xB8 ; 184 + 552: 1c df rcall .-456 ; 0x38c rf12_ready(); - 612: 0e 94 a3 02 call 0x546 ; 0x546 + 554: b4 df rcall .-152 ; 0x4be rf12_trans(0x8208); // TX off - 616: 88 e0 ldi r24, 0x08 ; 8 - 618: 92 e8 ldi r25, 0x82 ; 130 - 61a: 0e 94 05 02 call 0x40a ; 0x40a - 61e: 2f ef ldi r18, 0xFF ; 255 - 620: 80 e7 ldi r24, 0x70 ; 112 - 622: 92 e0 ldi r25, 0x02 ; 2 - 624: 21 50 subi r18, 0x01 ; 1 - 626: 80 40 sbci r24, 0x00 ; 0 - 628: 90 40 sbci r25, 0x00 ; 0 - 62a: e1 f7 brne .-8 ; 0x624 - 62c: 00 c0 rjmp .+0 ; 0x62e - 62e: 00 00 nop + 556: 88 e0 ldi r24, 0x08 ; 8 + 558: 92 e8 ldi r25, 0x82 ; 130 + 55a: 18 df rcall .-464 ; 0x38c + 55c: 2f ef ldi r18, 0xFF ; 255 + 55e: 80 e7 ldi r24, 0x70 ; 112 + 560: 92 e0 ldi r25, 0x02 ; 2 + 562: 21 50 subi r18, 0x01 ; 1 + 564: 80 40 sbci r24, 0x00 ; 0 + 566: 90 40 sbci r25, 0x00 ; 0 + 568: e1 f7 brne .-8 ; 0x562 + 56a: 00 c0 rjmp .+0 ; 0x56c + 56c: 00 00 nop _delay_ms(100); - 630: df 91 pop r29 - 632: cf 91 pop r28 - 634: 1f 91 pop r17 - 636: 08 95 ret + 56e: df 91 pop r29 + 570: cf 91 pop r28 + 572: 1f 91 pop r17 + 574: 08 95 ret -00000638 <__udivmodsi4>: - 638: a1 e2 ldi r26, 0x21 ; 33 - 63a: 1a 2e mov r1, r26 - 63c: aa 1b sub r26, r26 - 63e: bb 1b sub r27, r27 - 640: fd 01 movw r30, r26 - 642: 0d c0 rjmp .+26 ; 0x65e <__udivmodsi4_ep> +00000576 <__udivmodsi4>: + 576: a1 e2 ldi r26, 0x21 ; 33 + 578: 1a 2e mov r1, r26 + 57a: aa 1b sub r26, r26 + 57c: bb 1b sub r27, r27 + 57e: fd 01 movw r30, r26 + 580: 0d c0 rjmp .+26 ; 0x59c <__udivmodsi4_ep> -00000644 <__udivmodsi4_loop>: - 644: aa 1f adc r26, r26 - 646: bb 1f adc r27, r27 - 648: ee 1f adc r30, r30 - 64a: ff 1f adc r31, r31 - 64c: a2 17 cp r26, r18 - 64e: b3 07 cpc r27, r19 - 650: e4 07 cpc r30, r20 - 652: f5 07 cpc r31, r21 - 654: 20 f0 brcs .+8 ; 0x65e <__udivmodsi4_ep> - 656: a2 1b sub r26, r18 - 658: b3 0b sbc r27, r19 - 65a: e4 0b sbc r30, r20 - 65c: f5 0b sbc r31, r21 +00000582 <__udivmodsi4_loop>: + 582: aa 1f adc r26, r26 + 584: bb 1f adc r27, r27 + 586: ee 1f adc r30, r30 + 588: ff 1f adc r31, r31 + 58a: a2 17 cp r26, r18 + 58c: b3 07 cpc r27, r19 + 58e: e4 07 cpc r30, r20 + 590: f5 07 cpc r31, r21 + 592: 20 f0 brcs .+8 ; 0x59c <__udivmodsi4_ep> + 594: a2 1b sub r26, r18 + 596: b3 0b sbc r27, r19 + 598: e4 0b sbc r30, r20 + 59a: f5 0b sbc r31, r21 -0000065e <__udivmodsi4_ep>: - 65e: 66 1f adc r22, r22 - 660: 77 1f adc r23, r23 - 662: 88 1f adc r24, r24 - 664: 99 1f adc r25, r25 - 666: 1a 94 dec r1 - 668: 69 f7 brne .-38 ; 0x644 <__udivmodsi4_loop> - 66a: 60 95 com r22 - 66c: 70 95 com r23 - 66e: 80 95 com r24 - 670: 90 95 com r25 - 672: 9b 01 movw r18, r22 - 674: ac 01 movw r20, r24 - 676: bd 01 movw r22, r26 - 678: cf 01 movw r24, r30 - 67a: 08 95 ret +0000059c <__udivmodsi4_ep>: + 59c: 66 1f adc r22, r22 + 59e: 77 1f adc r23, r23 + 5a0: 88 1f adc r24, r24 + 5a2: 99 1f adc r25, r25 + 5a4: 1a 94 dec r1 + 5a6: 69 f7 brne .-38 ; 0x582 <__udivmodsi4_loop> + 5a8: 60 95 com r22 + 5aa: 70 95 com r23 + 5ac: 80 95 com r24 + 5ae: 90 95 com r25 + 5b0: 9b 01 movw r18, r22 + 5b2: ac 01 movw r20, r24 + 5b4: bd 01 movw r22, r26 + 5b6: cf 01 movw r24, r30 + 5b8: 08 95 ret -0000067c <__divmodsi4>: - 67c: 05 2e mov r0, r21 - 67e: 97 fb bst r25, 7 - 680: 16 f4 brtc .+4 ; 0x686 <__divmodsi4+0xa> - 682: 00 94 com r0 - 684: 07 d0 rcall .+14 ; 0x694 <__divmodsi4_neg1> - 686: 57 fd sbrc r21, 7 - 688: 0d d0 rcall .+26 ; 0x6a4 <__divmodsi4_neg2> - 68a: 0e 94 1c 03 call 0x638 ; 0x638 <__udivmodsi4> - 68e: 07 fc sbrc r0, 7 - 690: 09 d0 rcall .+18 ; 0x6a4 <__divmodsi4_neg2> - 692: 7e f4 brtc .+30 ; 0x6b2 <__divmodsi4_exit> +000005ba <__divmodsi4>: + 5ba: 05 2e mov r0, r21 + 5bc: 97 fb bst r25, 7 + 5be: 16 f4 brtc .+4 ; 0x5c4 <__divmodsi4+0xa> + 5c0: 00 94 com r0 + 5c2: 06 d0 rcall .+12 ; 0x5d0 <__divmodsi4_neg1> + 5c4: 57 fd sbrc r21, 7 + 5c6: 0c d0 rcall .+24 ; 0x5e0 <__divmodsi4_neg2> + 5c8: d6 df rcall .-84 ; 0x576 <__udivmodsi4> + 5ca: 07 fc sbrc r0, 7 + 5cc: 09 d0 rcall .+18 ; 0x5e0 <__divmodsi4_neg2> + 5ce: 7e f4 brtc .+30 ; 0x5ee <__divmodsi4_exit> -00000694 <__divmodsi4_neg1>: - 694: 90 95 com r25 - 696: 80 95 com r24 - 698: 70 95 com r23 - 69a: 61 95 neg r22 - 69c: 7f 4f sbci r23, 0xFF ; 255 - 69e: 8f 4f sbci r24, 0xFF ; 255 - 6a0: 9f 4f sbci r25, 0xFF ; 255 - 6a2: 08 95 ret +000005d0 <__divmodsi4_neg1>: + 5d0: 90 95 com r25 + 5d2: 80 95 com r24 + 5d4: 70 95 com r23 + 5d6: 61 95 neg r22 + 5d8: 7f 4f sbci r23, 0xFF ; 255 + 5da: 8f 4f sbci r24, 0xFF ; 255 + 5dc: 9f 4f sbci r25, 0xFF ; 255 + 5de: 08 95 ret -000006a4 <__divmodsi4_neg2>: - 6a4: 50 95 com r21 - 6a6: 40 95 com r20 - 6a8: 30 95 com r19 - 6aa: 21 95 neg r18 - 6ac: 3f 4f sbci r19, 0xFF ; 255 - 6ae: 4f 4f sbci r20, 0xFF ; 255 - 6b0: 5f 4f sbci r21, 0xFF ; 255 +000005e0 <__divmodsi4_neg2>: + 5e0: 50 95 com r21 + 5e2: 40 95 com r20 + 5e4: 30 95 com r19 + 5e6: 21 95 neg r18 + 5e8: 3f 4f sbci r19, 0xFF ; 255 + 5ea: 4f 4f sbci r20, 0xFF ; 255 + 5ec: 5f 4f sbci r21, 0xFF ; 255 -000006b2 <__divmodsi4_exit>: - 6b2: 08 95 ret +000005ee <__divmodsi4_exit>: + 5ee: 08 95 ret -000006b4 <_exit>: - 6b4: f8 94 cli +000005f0 <_exit>: + 5f0: f8 94 cli -000006b6 <__stop_program>: - 6b6: ff cf rjmp .-2 ; 0x6b6 <__stop_program> +000005f2 <__stop_program>: + 5f2: ff cf rjmp .-2 ; 0x5f2 <__stop_program> diff --git a/V5B/Reciver/Reciver/Debug/Reciver.map b/V5B/Reciver/Reciver/Debug/Reciver.map index 7f15f61..ca0b574 100644 --- a/V5B/Reciver/Reciver/Debug/Reciver.map +++ b/V5B/Reciver/Reciver/Debug/Reciver.map @@ -1,92 +1,92 @@ Archive member included because of file (symbol) -c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_udivmodsi4.o) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) rf12.o (__udivmodsi4) -c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_divmodsi4.o) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_divmodsi4.o) rf12.o (__divmodsi4) -c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_exit.o) - 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/avr5/crtm168a.o (exit) -c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_copy_data.o) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_exit.o) + 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/avr25/tiny-stack/crttn24a.o (exit) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_copy_data.o) Reciver.o (__do_copy_data) -c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_clear_bss.o) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_clear_bss.o) Reciver.o (__do_clear_bss) Discarded input sections - .bss 0x00000000 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/avr5/crtm168a.o + .bss 0x00000000 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/avr25/tiny-stack/crttn24a.o .text 0x00000000 0x0 Reciver.o .text 0x00000000 0x0 rf12.o .bss 0x00000000 0x0 rf12.o .text.rf12_txdata - 0x00000000 0x80 rf12.o + 0x00000000 0x62 rf12.o .text.rf12_rxdata - 0x00000000 0x50 rf12.o - .text 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) - .bss 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) + 0x00000000 0x44 rf12.o + .text 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) + .bss 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) .text.libgcc.mul - 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) - .text.libgcc 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) + .text.libgcc 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) .text.libgcc.prologue - 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) .text.libgcc.builtins - 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) .text.libgcc.fmul - 0x00000000 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/avr5\libgcc.a(_udivmodsi4.o) - .text 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) - .bss 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) + .text 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) + .bss 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) .text.libgcc.mul - 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) - .text.libgcc 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) + .text.libgcc 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) .text.libgcc.prologue - 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) .text.libgcc.builtins - 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) .text.libgcc.fmul - 0x00000000 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/avr5\libgcc.a(_divmodsi4.o) - .text 0x00000000 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/avr5\libgcc.a(_exit.o) - .bss 0x00000000 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/avr5\libgcc.a(_exit.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) + .text 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) + .bss 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) .text.libgcc.mul - 0x00000000 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/avr5\libgcc.a(_exit.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) .text.libgcc.div - 0x00000000 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/avr5\libgcc.a(_exit.o) - .text.libgcc 0x00000000 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/avr5\libgcc.a(_exit.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) + .text.libgcc 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) .text.libgcc.prologue - 0x00000000 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/avr5\libgcc.a(_exit.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) .text.libgcc.builtins - 0x00000000 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/avr5\libgcc.a(_exit.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) .text.libgcc.fmul - 0x00000000 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/avr5\libgcc.a(_exit.o) - .text 0x00000000 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/avr5\libgcc.a(_copy_data.o) - .bss 0x00000000 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/avr5\libgcc.a(_copy_data.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_exit.o) + .text 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) + .bss 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) .text.libgcc.mul - 0x00000000 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/avr5\libgcc.a(_copy_data.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) .text.libgcc.div - 0x00000000 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/avr5\libgcc.a(_copy_data.o) - .text.libgcc 0x00000000 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/avr5\libgcc.a(_copy_data.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) + .text.libgcc 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) .text.libgcc.prologue - 0x00000000 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/avr5\libgcc.a(_copy_data.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) .text.libgcc.builtins - 0x00000000 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/avr5\libgcc.a(_copy_data.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) .text.libgcc.fmul - 0x00000000 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/avr5\libgcc.a(_copy_data.o) - .text 0x00000000 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/avr5\libgcc.a(_clear_bss.o) - .bss 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_copy_data.o) + .text 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) + .bss 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) .text.libgcc.mul - 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) .text.libgcc.div - 0x00000000 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/avr5\libgcc.a(_clear_bss.o) - .text.libgcc 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) + .text.libgcc 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) .text.libgcc.prologue - 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) .text.libgcc.builtins - 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) .text.libgcc.fmul - 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + 0x00000000 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) Memory Configuration Name Origin Length Attributes -text 0x00000000 0x00020000 xr +text 0x00000000 0x00002000 xr data 0x00800060 0x0000ffa0 rw !x eeprom 0x00810000 0x00010000 rw !x fuse 0x00820000 0x00000400 rw !x @@ -97,16 +97,15 @@ user_signatures 0x00850000 0x00000400 rw !x Linker script and memory map -Address of section .data set to 0x800100 -LOAD 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/avr5/crtm168a.o +LOAD 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/avr25/tiny-stack/crttn24a.o LOAD Reciver.o LOAD rf12.o START GROUP -LOAD 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/avr5\libm.a +LOAD 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/avr25/tiny-stack\libm.a END GROUP -LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a -LOAD 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/avr5\libc.a -LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a +LOAD 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/avr25/tiny-stack\libc.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a .hash *(.hash) @@ -198,48 +197,48 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .rela.plt *(.rela.plt) -.text 0x00000000 0x6b8 +.text 0x00000000 0x5f4 *(.vectors) - .vectors 0x00000000 0x68 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/avr5/crtm168a.o + .vectors 0x00000000 0x22 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/avr25/tiny-stack/crttn24a.o 0x00000000 __vector_default 0x00000000 __vectors *(.vectors) *(.progmem.gcc*) *(.progmem*) - 0x00000068 . = ALIGN (0x2) - 0x00000068 __trampolines_start = . + 0x00000022 . = ALIGN (0x2) + 0x00000022 __trampolines_start = . *(.trampolines) - .trampolines 0x00000068 0x0 linker stubs + .trampolines 0x00000022 0x0 linker stubs *(.trampolines*) - 0x00000068 __trampolines_end = . + 0x00000022 __trampolines_end = . *(.jumptables) *(.jumptables*) *(.lowtext) *(.lowtext*) - 0x00000068 __ctors_start = . + 0x00000022 __ctors_start = . *(.ctors) - 0x00000068 __ctors_end = . - 0x00000068 __dtors_start = . + 0x00000022 __ctors_end = . + 0x00000022 __dtors_start = . *(.dtors) - 0x00000068 __dtors_end = . + 0x00000022 __dtors_end = . SORT(*)(.ctors) SORT(*)(.dtors) *(.init0) - .init0 0x00000068 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/avr5/crtm168a.o - 0x00000068 __init + .init0 0x00000022 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/avr25/tiny-stack/crttn24a.o + 0x00000022 __init *(.init0) *(.init1) *(.init1) *(.init2) - .init2 0x00000068 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/../../../../avr/lib/avr5/crtm168a.o + .init2 0x00000022 0x8 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/avr25/tiny-stack/crttn24a.o *(.init2) *(.init3) *(.init3) *(.init4) - .init4 0x00000074 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_copy_data.o) - 0x00000074 __do_copy_data - .init4 0x0000008a 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_clear_bss.o) - 0x0000008a __do_clear_bss + .init4 0x0000002a 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_copy_data.o) + 0x0000002a __do_copy_data + .init4 0x00000040 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_clear_bss.o) + 0x00000040 __do_clear_bss *(.init4) *(.init5) *(.init5) @@ -250,98 +249,89 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 *(.init8) *(.init8) *(.init9) - .init9 0x0000009a 0x8 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/avr5/crtm168a.o + .init9 0x00000050 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/../../../../avr/lib/avr25/tiny-stack/crttn24a.o *(.init9) *(.text) - .text 0x000000a2 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/../../../../avr/lib/avr5/crtm168a.o - 0x000000a2 __vector_22 - 0x000000a2 __vector_1 - 0x000000a2 __vector_24 - 0x000000a2 __vector_12 - 0x000000a2 __bad_interrupt - 0x000000a2 __vector_6 - 0x000000a2 __vector_3 - 0x000000a2 __vector_23 - 0x000000a2 __vector_25 - 0x000000a2 __vector_11 - 0x000000a2 __vector_13 - 0x000000a2 __vector_17 - 0x000000a2 __vector_19 - 0x000000a2 __vector_7 - 0x000000a2 __vector_5 - 0x000000a2 __vector_4 - 0x000000a2 __vector_9 - 0x000000a2 __vector_2 - 0x000000a2 __vector_21 - 0x000000a2 __vector_15 - 0x000000a2 __vector_8 - 0x000000a2 __vector_14 - 0x000000a2 __vector_10 - 0x000000a2 __vector_18 - 0x000000a2 __vector_20 - 0x000000a6 . = ALIGN (0x2) + .text 0x00000054 0x2 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/avr25/tiny-stack/crttn24a.o + 0x00000054 __vector_1 + 0x00000054 __vector_12 + 0x00000054 __bad_interrupt + 0x00000054 __vector_6 + 0x00000054 __vector_3 + 0x00000054 __vector_13 + 0x00000054 __vector_7 + 0x00000054 __vector_5 + 0x00000054 __vector_4 + 0x00000054 __vector_9 + 0x00000054 __vector_2 + 0x00000054 __vector_15 + 0x00000054 __vector_8 + 0x00000054 __vector_14 + 0x00000054 __vector_10 + 0x00000054 __vector_16 + 0x00000056 . = ALIGN (0x2) *(.text.*) - .text.turn 0x000000a6 0x92 Reciver.o - 0x000000a6 turn - .text.poll 0x00000138 0xa0 Reciver.o - 0x00000138 poll - .text.recive 0x000001d8 0xba Reciver.o - 0x000001d8 recive + .text.turn 0x00000056 0x96 Reciver.o + 0x00000056 turn + .text.poll 0x000000ec 0x94 Reciver.o + 0x000000ec poll + .text.recive 0x00000180 0xa0 Reciver.o + 0x00000180 recive .text.init_timer - 0x00000292 0x4e Reciver.o - 0x00000292 init_timer - .text.__vector_16 - 0x000002e0 0xf2 Reciver.o - 0x000002e0 __vector_16 - .text.main 0x000003d2 0x38 Reciver.o - 0x000003d2 main + 0x00000220 0x4c Reciver.o + 0x00000220 init_timer + .text.__vector_11 + 0x0000026c 0xf2 Reciver.o + 0x0000026c __vector_11 + .text.main 0x0000035e 0x2e Reciver.o + 0x0000035e main .text.rf12_trans - 0x0000040a 0x32 rf12.o - 0x0000040a rf12_trans + 0x0000038c 0x32 rf12.o + 0x0000038c rf12_trans .text.rf12_init - 0x0000043c 0x54 rf12.o - 0x0000043c rf12_init + 0x000003be 0x46 rf12.o + 0x000003be rf12_init .text.rf12_setbandwidth - 0x00000490 0x2e rf12.o - 0x00000490 rf12_setbandwidth + 0x00000404 0x38 rf12.o + 0x00000404 rf12_setbandwidth .text.rf12_setfreq - 0x000004be 0x20 rf12.o - 0x000004be rf12_setfreq + 0x0000043c 0x1e rf12.o + 0x0000043c rf12_setfreq .text.rf12_setbaud - 0x000004de 0x4e rf12.o - 0x000004de rf12_setbaud + 0x0000045a 0x46 rf12.o + 0x0000045a rf12_setbaud .text.rf12_setpower - 0x0000052c 0x1a rf12.o - 0x0000052c rf12_setpower + 0x000004a0 0x1e rf12.o + 0x000004a0 rf12_setpower .text.rf12_ready - 0x00000546 0x8 rf12.o - 0x00000546 rf12_ready + 0x000004be 0x8 rf12.o + 0x000004be rf12_ready .text.rf12_beginasyncrx - 0x0000054e 0x1a rf12.o - 0x0000054e rf12_beginasyncrx + 0x000004c6 0x14 rf12.o + 0x000004c6 rf12_beginasyncrx .text.rf12_hasdata - 0x00000568 0x10 rf12.o - 0x00000568 rf12_hasdata + 0x000004da 0xa rf12.o + 0x000004da rf12_hasdata .text.rf12_rxbyte - 0x00000578 0xa rf12.o - 0x00000578 rf12_rxbyte + 0x000004e4 0x8 rf12.o + 0x000004e4 rf12_rxbyte .text.rf12_endasyncrx - 0x00000582 0xa rf12.o - 0x00000582 rf12_endasyncrx + 0x000004ec 0x8 rf12.o + 0x000004ec rf12_endasyncrx .text.rf12_txpacket - 0x0000058c 0xac rf12.o - 0x0000058c rf12_txpacket + 0x000004f4 0x82 rf12.o + 0x000004f4 rf12_txpacket .text.libgcc.div - 0x00000638 0x44 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_udivmodsi4.o) - 0x00000638 __udivmodsi4 + 0x00000576 0x44 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) + 0x00000576 __udivmodsi4 .text.libgcc.div - 0x0000067c 0x38 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_divmodsi4.o) - 0x0000067c __divmodsi4 - 0x000006b4 . = ALIGN (0x2) + 0x000005ba 0x36 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr25/tiny-stack\libgcc.a(_divmodsi4.o) + 0x000005ba __divmodsi4 + 0x000005f0 . = ALIGN (0x2) *(.fini9) - .fini9 0x000006b4 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/avr5\libgcc.a(_exit.o) - 0x000006b4 _exit - 0x000006b4 exit + .fini9 0x000005f0 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/avr25/tiny-stack\libgcc.a(_exit.o) + 0x000005f0 _exit + 0x000005f0 exit *(.fini9) *(.fini8) *(.fini8) @@ -360,48 +350,48 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 *(.fini1) *(.fini1) *(.fini0) - .fini0 0x000006b4 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/avr5\libgcc.a(_exit.o) + .fini0 0x000005f0 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/avr25/tiny-stack\libgcc.a(_exit.o) *(.fini0) - 0x000006b8 _etext = . + 0x000005f4 _etext = . -.data 0x00800100 0x4 load address 0x000006b8 - 0x00800100 PROVIDE (__data_start, .) +.data 0x00800060 0x4 load address 0x000005f4 + 0x00800060 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/avr5/crtm168a.o - .data 0x00800100 0x4 Reciver.o - 0x00800100 servopos - 0x00800102 status - .data 0x00800104 0x0 rf12.o - .data 0x00800104 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/avr5\libgcc.a(_udivmodsi4.o) - .data 0x00800104 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/avr5\libgcc.a(_divmodsi4.o) - .data 0x00800104 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/avr5\libgcc.a(_exit.o) - .data 0x00800104 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/avr5\libgcc.a(_copy_data.o) - .data 0x00800104 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/avr5\libgcc.a(_clear_bss.o) + .data 0x00800060 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/avr25/tiny-stack/crttn24a.o + .data 0x00800060 0x4 Reciver.o + 0x00800060 servopos + 0x00800062 status + .data 0x00800064 0x0 rf12.o + .data 0x00800064 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/avr25/tiny-stack\libgcc.a(_udivmodsi4.o) + .data 0x00800064 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/avr25/tiny-stack\libgcc.a(_divmodsi4.o) + .data 0x00800064 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/avr25/tiny-stack\libgcc.a(_exit.o) + .data 0x00800064 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/avr25/tiny-stack\libgcc.a(_copy_data.o) + .data 0x00800064 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/avr25/tiny-stack\libgcc.a(_clear_bss.o) *(.data*) *(.rodata) *(.rodata*) *(.gnu.linkonce.d*) - 0x00800104 . = ALIGN (0x2) - 0x00800104 _edata = . - 0x00800104 PROVIDE (__data_end, .) + 0x00800064 . = ALIGN (0x2) + 0x00800064 _edata = . + 0x00800064 PROVIDE (__data_end, .) -.bss 0x00800104 0x2 - 0x00800104 PROVIDE (__bss_start, .) +.bss 0x00800064 0x2 + 0x00800064 PROVIDE (__bss_start, .) *(.bss) - .bss 0x00800104 0x2 Reciver.o - 0x00800104 pwm_led + .bss 0x00800064 0x2 Reciver.o + 0x00800064 pwm_led *(.bss*) *(COMMON) - 0x00800106 PROVIDE (__bss_end, .) - 0x000006b8 __data_load_start = LOADADDR (.data) - 0x000006bc __data_load_end = (__data_load_start + SIZEOF (.data)) + 0x00800066 PROVIDE (__bss_end, .) + 0x000005f4 __data_load_start = LOADADDR (.data) + 0x000005f8 __data_load_end = (__data_load_start + SIZEOF (.data)) -.noinit 0x00800106 0x0 - 0x00800106 PROVIDE (__noinit_start, .) +.noinit 0x00800066 0x0 + 0x00800066 PROVIDE (__noinit_start, .) *(.noinit*) - 0x00800106 PROVIDE (__noinit_end, .) - 0x00800106 _end = . - 0x00800106 PROVIDE (__heap_start, .) + 0x00800066 PROVIDE (__noinit_end, .) + 0x00800066 _end = . + 0x00800066 PROVIDE (__heap_start, .) .eeprom 0x00810000 0x0 *(.eeprom*) @@ -422,13 +412,13 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .user_signatures *(.user_signatures*) -.stab 0x00000000 0x6cc +.stab 0x00000000 0x6b4 *(.stab) - .stab 0x00000000 0x6cc 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/avr5/crtm168a.o + .stab 0x00000000 0x6b4 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/avr25/tiny-stack/crttn24a.o .stabstr 0x00000000 0x82 *(.stabstr) - .stabstr 0x00000000 0x82 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/avr5/crtm168a.o + .stabstr 0x00000000 0x82 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/avr25/tiny-stack/crttn24a.o .stab.excl *(.stab.excl) @@ -470,10 +460,10 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .debug_pubnames *(.debug_pubnames) -.debug_info 0x00000000 0x1023 +.debug_info 0x00000000 0x1026 *(.debug_info) - .debug_info 0x00000000 0x79d Reciver.o - .debug_info 0x0000079d 0x886 rf12.o + .debug_info 0x00000000 0x7a0 Reciver.o + .debug_info 0x000007a0 0x886 rf12.o *(.gnu.linkonce.wi.*) .debug_abbrev 0x00000000 0x40a @@ -481,10 +471,10 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .debug_abbrev 0x00000000 0x1fc Reciver.o .debug_abbrev 0x000001fc 0x20e rf12.o -.debug_line 0x00000000 0x56c +.debug_line 0x00000000 0x56e *(.debug_line) - .debug_line 0x00000000 0x29d Reciver.o - .debug_line 0x0000029d 0x2cf rf12.o + .debug_line 0x00000000 0x29f Reciver.o + .debug_line 0x0000029f 0x2cf rf12.o .debug_frame 0x00000000 0x1c8 *(.debug_frame) diff --git a/V5B/Reciver/Reciver/Debug/Reciver.srec b/V5B/Reciver/Reciver/Debug/Reciver.srec index 2469326..b6f786d 100644 --- a/V5B/Reciver/Reciver/Debug/Reciver.srec +++ b/V5B/Reciver/Reciver/Debug/Reciver.srec @@ -1,111 +1,99 @@ S00F0000526563697665722E7372656345 -S11300000C9434000C9451000C9451000C94510045 -S11300100C9451000C9451000C9451000C94510018 -S11300200C9451000C9451000C9451000C94510008 -S11300300C9451000C9451000C9451000C945100F8 -S11300400C9470010C9451000C9451000C945100C8 -S11300500C9451000C9451000C9451000C945100D8 -S11300600C9451000C94510011241FBECFEFD4E026 -S1130070DEBFCDBF11E0A0E0B1E0E8EBF6E002C0E6 -S113008005900D92A430B107D9F721E0A4E0B1E0C6 -S113009001C01D92A630B207E1F70E94E9010C9459 -S11300A05A030C9400008091020190910301069779 -S11300B009F441C086E090E090930301809302012B -S11300C088E290E090930101809300018FE39CE922 -S11300D00197F1F700C00000409102015091030123 -S11300E06AE081E00E94C6029FEF23EC89E0915010 -S11300F020408040E1F700C0000084E190E090934C -S11301000101809300019FEF22E587E09150204098 -S11301108040E1F700C0000084EB90E0909301017F -S1130120809300019FEF26E181E1915020408040BF -S1130130E1F700C000000895229880910201909197 -S11301400301039741F41A9B06C00E94C1020E9456 -S113015053000E94A702809102019091030102972B -S113016059F41A9B09C00E94C10248E06AE081E088 -S11301700E94C6020E94A7024B992DC080910201E1 -S113018090910301029739F586E090E09093030182 -S1130190809302012FEF81E19AE721508040904043 -S11301A0E1F700C000002FEF81E19AE72150804081 -S11301B09040E1F700C000002FEF81E19AE7215061 -S11301C080409040E1F700C0000083E090E090930D -S11301D00301809302010895CF930E94A70202C0F5 -S11301E00E949C000E94B4028111FACF0E94BC02BA -S11301F0882341F08A3031F0803F09F048C002C0C2 -S11302000E949C000E94B4028111FACF0E94BC0299 -S1130210C82F02C00E949C000E94B4028111FACF30 -S1130220C130A9F50E94BC02843049F018F4813031 -S1130230D9F41DC0853051F08730B1F40EC082E08E -S113024090E0909303018093020111C083E090E059 -S113025090930301809302010AC00E94C1020E948C -S113026053000E94A70213C00E94C10210C00E9442 -S1130270C1028FE39CE90197F1F700C000004091AF -S11302800201509103016AE081E00E94C602CF910D -S1130290089514BC85E085BD88E586BD81E0809322 -S11302A06E00209A289A8FEA94E00197F1F700C033 -S11302B0000080910001909101011816190674F450 -S11302C080E090E025E12A95F1F700000196209165 -S11302D000013091010182179307A4F3289808952F -S11302E01F920F920FB60F9211242F933F938F9367 -S11302F09F9388E586BD8091020190910301029746 -S113030079F48091040190910501C39794F19BB114 -S113031080E489278BB9109205011092040129C049 -S11303208091020190910301039779F48091040173 -S1130330909105010697ECF09BB180E489278BB975 -S1130340109205011092040114C080910201909151 -S11303500301069771F480910401909105010297BD -S113036044F09BB180E489278BB910920501109267 -S11303700401809104019091050101969093050177 -S113038080930401209A289A8FEA94E00197F1F768 -S113039000C0000080910001909101011816190617 -S11303A074F480E090E025E12A95F1F700000196CD -S11303B0209100013091010182179307A4F328983A -S11303C09F918F913F912F910F900FBE0F901F908F -S11303D018950E941E0280E296E00E945F0247E0A8 -S11303E060E081E00E94480280E895E20E946F028A -S11303F066E080E00E9496020E944901569A539852 -S11304005B9A78940E94EC00FDCF449840E120E090 -S113041030E0992314F4409A01C04098220F331F0E -S113042033992160419A880F991F00C000004198B8 -S1130430415079F7449A822F932F089587B18361AD -S113044087B9449A2FEF80E792E021508040904092 -S1130450E1F700C0000080EE90EC0E94050287EDF9 -S113046090E80E9405028BEA92EC0E94050281E862 -S11304709AEC0E94050280E090EE0E94050280E062 -S113048098EC0E94050287EF94EC0E9405020895FF -S1130490477050E05469637070E0660F771F660F11 -S11304A0771F660F771F20E2829FC00111249927CE -S11304B0862B972B842B952B0E940502089580365A -S11304C0910538F080342FE0920728F08FE39FE005 -S11304D002C080E690E0906A0E9405020895873980 -S11304E022E0920710F1883125E1920780F49C0103 -S11304F040E050E060E678EA80E090E00E943E034D -S1130500C90101978068966C0E94050208959C01B8 -S113051040E050E06CEF72E485E090E00E941C0340 -S1130520C9010197966C0E9405020895877090E0B6 -S1130530986920E1629FB00111247727862B972BBD -S11305400E94050208954498339BFECF089588ECD9 -S113055092E80E94050281E89AEC0E94050283E871 -S11305609AEC0E9405020895449886B183FB88277B -S113057080F991E08927089580E090EB0E940502BC -S1130580089588E092E80E94050208951F93CF938E -S1130590DF93182FD62FC42F88E392E80E94050218 -S11305A00E94A3028AEA98EB0E9405020E94A30219 -S11305B08AEA98EB0E9405020E94A3028AEA98EB59 -S11305C00E9405020E94A3028DE298EB0E9405029C -S11305D00E94A30284ED98EB0E9405020E94A302EC -S11305E0812F90E0986B0E9405020E94A3028D2F38 -S11305F090E0986B0E9405020E94A3028C2F90E069 -S1130600986B0E9405020E94A30280E098EB0E946E -S113061005020E94A30288E092E80E9405022FEFDF -S113062080E792E0215080409040E1F700C0000054 -S1130630DF91CF911F910895A1E21A2EAA1BBB1B33 -S1130640FD010DC0AA1FBB1FEE1FFF1FA217B3079A -S1130650E407F50720F0A21BB30BE40BF50B661FB0 -S1130660771F881F991F1A9469F760957095809574 -S113067090959B01AC01BD01CF010895052E97FB18 -S113068016F4009407D057FD0DD00E941C0307FCFC -S113069009D07EF490958095709561957F4F8F4F2A -S11306A09F4F089550954095309521953F4F4F4F5A -S10B06B05F4F0895F894FFCF99 -S10706B8B400020084 +S113000010C028C027C026C025C024C023C022C0D9 +S113001021C020C01FC02AC11DC01CC01BC01AC0E3 +S113002019C011241FBECFEDCDBF10E0A0E6B0E093 +S1130030E4EFF5E002C005900D92A436B107D9F7BC +S113004020E0A4E6B0E001C01D92A636B207E1F7B5 +S113005086D1CEC2D5CF809162009091630006977D +S113006009F443C086E090E09093630080936200BB +S113007088E290E090936100809360002FE788E32A +S113008091E0215080409040E1F700C00000409191 +S113009062005091630068E281E02CD22FEF83EC80 +S11300A099E0215080409040E1F700C0000084E1D5 +S11300B090E090936100809360002FEF82E597E0D9 +S11300C0215080409040E1F700C0000084EB90E0B4 +S11300D090936100809360002FEF86E191E12150BD +S11300E080409040E1F700C000000895BA988091E4 +S11300F0620090916300039729F4B29B03C0F6D188 +S1130100AADFE1D18091620090916300029741F4EB +S1130110B29B06C0EBD148E068E281E0EBD1D3D1D9 +S1130120CC992DC08091620090916300029739F5BB +S113013086E090E090936300809362002FEF81E16A +S11301409AE7215080409040E1F700C000002FEF73 +S113015081E19AE7215080409040E1F700C000001F +S11301602FEF81E19AE7215080409040E1F700C0F1 +S1130170000083E090E09093630080936200089510 +S1130180CF93A1D101C0B2DFA8D18111FCCFAAD1F4 +S1130190882339F0883229F0803F09F03FC001C03C +S11301A0A5DF9BD18111FCCF9DD1C82F01C09EDF5B +S11301B094D18111FCCFC13089F594D1843049F0B8 +S11301C018F48130C1F419C0853051F0873099F4A6 +S11301D00EC082E090E090936300809362000DC0B3 +S11301E083E090E0909363008093620006C07ED128 +S11301F032DF69D113C07AD111C078D12FE788E3F7 +S113020091E0215080409040E1F700C0000040910F +S113021062005091630068E281E06CD1CF9108954F +S113022010BE85E083BF88E582BF81E089BFB89AAC +S1130230C09A8FEA94E00197F1F700C00000809122 +S11302406000909161001816190674F480E090E043 +S113025025E12A95F1F70000019620916000309184 +S1130260610082179307A4F3C09808951F920F9218 +S11302700FB60F9211242F933F938F939F9388E58A +S113028082BF8091620090916300029779F480911B +S1130290640090916500C39794F198B382E0892734 +S11302A088BB109265001092640029C0809162009E +S11302B090916300039779F48091640090916500B4 +S11302C00697ECF098B382E0892788BB109265000A +S11302D01092640014C080916200909163000697AC +S11302E071F48091640090916500029744F098B392 +S11302F082E0892788BB1092650010926400809187 +S11303006400909165000196909365008093640069 +S1130310B89AC09A8FEA94E00197F1F700C0000000 +S113032080916000909161001816190674F480E0C1 +S113033090E025E12A95F1F70000019620916000F4 +S11303403091610082179307A4F3C0989F918F9115 +S11303503F912F910F900FBE0F901F9018952FD0A3 +S113036080E296E06BD047E060E081E04BD080E82B +S113037095E273D066E080E093D052DFB99AD498C6 +S1130380DC9AD69ADE987894FBDEFECFD99840E1C9 +S113039020E030E0992314F4DB9A01C0DB98220FAB +S11303A0331FC8992160DA9A880F991F00C0000092 +S11303B0DA98415079F7D99A822F932F08958AB306 +S11303C08E608ABBD99A2FEF80E792E0215080405B +S11303D09040E1F700C0000080EE90ECD7DF87ED9D +S11303E090E8D4DF8BEA92ECD1DF81E89AECCEDF9F +S11303F080E090EECBDF80E098ECC8DF87EF94ECF0 +S1130400C5DF0895477050E054696370262F30E0CB +S1130410220F331F220F331F220F331F90E0880F48 +S1130420991F82959295907F9827807F9827992786 +S1130430822B932B842B952BA9DF0895803691056D +S113044038F080342FE0920728F08FE39FE002C059 +S113045080E690E0906A9ADF0895873922E0920757 +S1130460F0F0883125E1920770F49C0140E050E0FF +S113047060E678EA80E090E0A0D0C9010197806846 +S1130480966C84DF08959C0140E050E06CEF72E4C8 +S113049085E090E070D0C9010197966C77DF0895EC +S11304A0877090E0986970E062957295707F762706 +S11304B0607F76277727862B972B68DF0895D99856 +S11304C0C89BFECF089588EC92E860DF81E89AEC3F +S11304D05DDF83E89AEC5ADF0895D99889B3809553 +S11304E08170089580E090EB51DF089588E092E8F0 +S11304F04DDF08951F93CF93DF93182FD62FC42F6A +S113050088E392E843DFDBDF8AEA98EB3FDFD7DF5B +S11305108AEA98EB3BDFD3DF8AEA98EB37DFCFDF59 +S11305208DE298EB33DFCBDF84ED98EB2FDFC7DF71 +S1130530812F90E0986B2ADFC2DF8D2F90E0986BBB +S113054025DFBDDF8C2F90E0986B20DFB8DF80E0E3 +S113055098EB1CDFB4DF88E092E818DF2FEF80E728 +S113056092E0215080409040E1F700C00000DF910C +S1130570CF911F910895A1E21A2EAA1BBB1BFD0166 +S11305800DC0AA1FBB1FEE1FFF1FA217B307E4076E +S1130590F50720F0A21BB30BE40BF50B661F771FC6 +S11305A0881F991F1A9469F76095709580959095A6 +S11305B09B01AC01BD01CF010895052E97FB16F4F4 +S11305C0009406D057FD0CD0D6DF07FC09D07EF48A +S11305D090958095709561957F4F8F4F9F4F0895AB +S11305E050954095309521953F4F4F4F5F4F08955B +S10705F0F894FFCFA9 +S10705F4B400020049 S9030000FC diff --git a/V5B/Reciver/Reciver/Debug/rf12.d b/V5B/Reciver/Reciver/Debug/rf12.d index 166bdbc..d57cdb9 100644 --- a/V5B/Reciver/Reciver/Debug/rf12.d +++ b/V5B/Reciver/Reciver/Debug/rf12.d @@ -4,9 +4,7 @@ rf12.d rf12.o: .././rf12.c \ 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 \ 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/stdint.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/stdint.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/iom168a.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/iom168.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/iomx8.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/iotn24a.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/portpins.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/common.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 \ @@ -27,11 +25,7 @@ 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/stdint.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/iom168a.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/iom168.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/iomx8.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/iotn24a.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/portpins.h: diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6.atsln b/V5B/Zeitschaltung_V6/Zeitschaltung_V6.atsln new file mode 100644 index 0000000..94f33c0 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6.atsln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Atmel Studio Solution File, Format Version 11.00 +Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "Zeitschaltung_V6", "Zeitschaltung_V6\Zeitschaltung_V6.cppproj", "{EC267909-C732-4CEF-B754-BD8CE5EBD85C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|AVR = Debug|AVR + Release|AVR = Release|AVR + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EC267909-C732-4CEF-B754-BD8CE5EBD85C}.Debug|AVR.ActiveCfg = Debug|AVR + {EC267909-C732-4CEF-B754-BD8CE5EBD85C}.Debug|AVR.Build.0 = Debug|AVR + {EC267909-C732-4CEF-B754-BD8CE5EBD85C}.Release|AVR.ActiveCfg = Release|AVR + {EC267909-C732-4CEF-B754-BD8CE5EBD85C}.Release|AVR.Build.0 = Release|AVR + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6.atsuo b/V5B/Zeitschaltung_V6/Zeitschaltung_V6.atsuo new file mode 100644 index 0000000..7e0c214 Binary files /dev/null and b/V5B/Zeitschaltung_V6/Zeitschaltung_V6.atsuo differ diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile new file mode 100644 index 0000000..a50b8f4 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile @@ -0,0 +1,129 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +SHELL := cmd.exe +RM := rm -rf + +USER_OBJS := + +LIBS := +PROJ := + +O_SRCS := +C_SRCS := +S_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +PREPROCESSING_SRCS := +OBJS := +OBJS_AS_ARGS := +C_DEPS := +C_DEPS_AS_ARGS := +EXECUTABLES := +OUTPUT_FILE_PATH := +OUTPUT_FILE_PATH_AS_ARGS := +AVR_APP_PATH :=$$$AVR_APP_PATH$$$ +QUOTE := " +ADDITIONAL_DEPENDENCIES:= +OUTPUT_FILE_DEP:= +LIB_DEP:= + +# Every subdirectory with source files must be described here +SUBDIRS := \ +../io \ +../io/hardware \ +../comunication + + +# Add inputs and outputs from these tool invocations to the build variables +C_SRCS += \ +../Zeitschaltung_V6.cpp + + +PREPROCESSING_SRCS += + + +ASM_SRCS += + + +OBJS += \ +Zeitschaltung_V6.o + + +OBJS_AS_ARGS += \ +Zeitschaltung_V6.o + + +C_DEPS += \ +Zeitschaltung_V6.d + + +C_DEPS_AS_ARGS += \ +Zeitschaltung_V6.d + + +OUTPUT_FILE_PATH +=Zeitschaltung_V6.elf + +OUTPUT_FILE_PATH_AS_ARGS +=Zeitschaltung_V6.elf + +ADDITIONAL_DEPENDENCIES:= + +OUTPUT_FILE_DEP:= ./makedep.mk + +LIB_DEP+= + +# AVR32/GNU C Compiler + + + +./%.o: .././%.cpp + @echo Building file: $< + @echo Invoking: AVR8/GNU C++ Compiler : + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-g++.exe$(QUOTE) -funsigned-char -funsigned-bitfields -DDEBUG -Os -ffunction-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega168a -c -std=c++11 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" + @echo Finished building: $< + + + +# AVR32/GNU Preprocessing Assembler + + + +# AVR32/GNU Assembler + + + + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +endif + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) + +$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) + @echo Building target: $@ + @echo Invoking: AVR8/GNU Linker : + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-g++.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="Zeitschaltung_V6.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega168a + @echo Finished building target: $@ + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "Zeitschaltung_V6.elf" "Zeitschaltung_V6.hex" + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "Zeitschaltung_V6.elf" "Zeitschaltung_V6.eep" || exit 0 + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "Zeitschaltung_V6.elf" > "Zeitschaltung_V6.lss" + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "Zeitschaltung_V6.elf" "Zeitschaltung_V6.srec" + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-size.exe" "Zeitschaltung_V6.elf" + + + + + + +# Other Targets +clean: + -$(RM) $(OBJS_AS_ARGS)$(C_DEPS_AS_ARGS) $(EXECUTABLES) + rm -rf "Zeitschaltung_V6.elf" "Zeitschaltung_V6.a" "Zeitschaltung_V6.hex" "Zeitschaltung_V6.lss" "Zeitschaltung_V6.eep" "Zeitschaltung_V6.map" "Zeitschaltung_V6.srec" + \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.eep b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf new file mode 100644 index 0000000..66cfc84 Binary files /dev/null and b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf differ diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex new file mode 100644 index 0000000..20d8e98 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex @@ -0,0 +1,106 @@ +:100000000C9435000C945D000C945D000C945D0024 +:100010000C945D000C945D000C945D000C945D00EC +:100020000C945D000C945D000C945D000C945D00DC +:100030000C945D000C945D000C945D000C945D00CC +:100040000C9421010C945D000C945D000C945D00F7 +:100050000C945D000C945D000C945D000C945D00AC +:100060000C945D000C945D00270311241FBECFEF9C +:10007000D4E0DEBFCDBF11E0A0E0B1E0E6E6F6E0FF +:1000800002C005900D92A231B107D9F721E0A2E19B +:10009000B1E001C01D92AA31B207E1F710E0CAE653 +:1000A000D0E004C02297FE010E942D03C836D1077C +:1000B000C9F70E9409020C9431030C940000219AA4 +:1000C00008953C9A0895282F98E080E027FF02C009 +:1000D000409A01C04098389A880F33998160419ABC +:1000E000399A220F00C000004198399A915071F757 +:1000F000089580FF02C05E9A01C05E98569A81FF03 +:1001000002C05F9A01C05F98579A0895CF93DF931A +:10011000EC018A818630C9F186E08A831D82299AA2 +:100120000E945F008FE19EE40197F1F700C000009C +:100130008EE1EFE0F7E23197F1F700C00000815067 +:10014000C1F7FFEF23EC89E0F15020408040E1F758 +:1001500000C0000089E68D839FEFE2E5F7E0915053 +:10016000E040F040E1F700C0000082ED8D832FEF0A +:1001700086E191E1215080409040E1F700C000000D +:100180002998DF91CF910C945F00DF91CF91089572 +:10019000262FDC01ED91FC910484F585E02D4EE1E4 +:1001A00061E00994CF93DF93EC018A818330D9F425 +:1001B0004A9919C0E881F9810680F781E02DCE01C6 +:1001C0000995E881F9810190F081E02DCE01099532 +:1001D00066E0CE010E94C800E881F9810480F581C3 +:1001E000E02DCE0109958A818230A1F44A9912C08E +:1001F000E881F9810680F781E02DCE01099568E05C +:10020000CE010E94C800E881F9810480F581E02DCB +:10021000CE0109954B9912C08A81823079F486E02B +:100220008A832FEF3CE281E391E02150304080400F +:100230009040D9F700C0000083E08A83DF91CF911E +:1002400008951F920F920FB60F9211242F933F9390 +:100250004F935F936F937F938F939F93AF93BF93CE +:10026000EF93FF9380911401823011F481E00BC071 +:1002700080911401833011F482E005C08091140153 +:10028000863019F483E00E94790084E686BD2A9ABC +:10029000229A8FEF94E00197F1F700C0000080E010 +:1002A00090E005C025E12A95F1F700000196209124 +:1002B000170130E082179307A8F32A98229AFF913A +:1002C000EF91BF91AF919F918F917F916F915F91CE +:1002D0004F913F912F910F900FBE0F901F90189547 +:1002E000CF92DF92EF92FF920F931F93CF93DF9302 +:1002F00000D01F92CDB7DEB78C01DC01ED91FC91EF +:100300000480F581E02D0995EE24E394F12CEC0EA8 +:10031000FD1E6E01B4E0CB0ED11C05C00280F3813E +:10032000E02DC8010995D801ED91FC910084F1857B +:10033000E02DC8010995D801ED91FC918111EECF16 +:100340000284F385E02DC8010995F70181937F01AF +:10035000EC15FD0541F7D801ED91FC910680F78180 +:10036000E02DC80109958981882329F08E3119F083 +:10037000803F09F042C08A81813009F03EC08B8104 +:10038000843049F018F48130C1F518C0853039F057 +:10039000873099F509C082E0F80182830FC083E0BD +:1003A000D80112968C930AC0D801ED91FC9101906E +:1003B000F081E02DC801099566E011C0EFE1FEE48F +:1003C0003197F1F700C000008EE1AFE0B7E211977E +:1003D000F1F700C000008150C1F7F8016281C80147 +:1003E0000F900F900F90DF91CF911F910F91FF9081 +:1003F000EF90DF90CF900C94C8000F900F900F906B +:10040000DF91CF911F910F91FF90EF90DF90CF90F0 +:10041000089582E191E00E947001FBCF4498089515 +:100420000E940E020E946100339BFECF0895EF925E +:10043000FF921F93CF93DF9300D0CDB7DEB7182F75 +:100440009A830E940E020E9461008A810E946300CA +:10045000F82EE12C812F0E9463009701282BC901FF +:10046000449A8A8399830E9461008A8199810F90BE +:100470000F90DF91CF911F91FF90EF900895CF9350 +:10048000DF93EC0184E091E09983888353985B9833 +:100490005B9A52985A985A9A1D820E945F00299836 +:1004A0000E945F00229A14BC85E085BD84E686BD6B +:1004B00017BC18BC81E080936E007894579A569AC6 +:1004C00080E00E9479004098389A4198399A449A7D +:1004D0000E9461003B9843982FEF80E792E0215003 +:1004E00080409040E1F700C0000080EE90EC0E9458 +:1004F000170287ED90E80E9417028BEA92EC0E94A7 +:10050000170281E89AEC0E94170280E090EE0E94A8 +:10051000170280E098EC0E94170287EF94EC0E948B +:10052000170280E296EA0E94170287E294E90E948D +:10053000170282E296EC0E94170280E698E90E9478 +:10054000170282E00E94790082E08A83DF91CF91D6 +:10055000089588EC92E80E94170281E89AEC0E94C4 +:10056000170283E89AEC0C94170288E092E80C9446 +:10057000170280E090EB0E9417020895CF93DF935B +:1005800000D01F92CDB7DEB788E392E82B834A8371 +:1005900069830E9417020E9410028AEA98EB0E9467 +:1005A00017020E9410028AEA98EB0E9417020E942A +:1005B00010028AEA98EB0E9417020E9410028DE254 +:1005C00098EB0E9417020E94100284ED98EB0E94A3 +:1005D00017020E9410026981862F90E0986B0E949A +:1005E00017020E9410024A81842F90E0986B0E94AB +:1005F00017020E9410022B81822F90E0986B0E94BC +:1006000017020E94100280E098EB0E9417020E94DD +:10061000100288E092E80E9417022FEF80E792E034 +:10062000215080409040E1F700C000000F900F90F3 +:100630000F90DF91CF9108950E940E020E946100F9 +:1006400086B183FB882780F991E08927089582E1AC +:1006500091E00C943F02EE0FFF1F0590F491E02D06 +:060660000994F894FFCF9D +:10066600000000008600D200A902B5021C03B902F0 +:02067600BE02C2 +:00000001FF diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss new file mode 100644 index 0000000..18b9c04 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss @@ -0,0 +1,1424 @@ + +Zeitschaltung_V6.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .data 00000012 00800100 00000666 000006fa 2**0 + CONTENTS, ALLOC, LOAD, DATA + 1 .text 00000666 00000000 00000000 00000094 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 2 .bss 00000008 00800112 00800112 0000070c 2**0 + ALLOC + 3 .stab 000006cc 00000000 00000000 0000070c 2**2 + CONTENTS, READONLY, DEBUGGING + 4 .stabstr 00000082 00000000 00000000 00000dd8 2**0 + CONTENTS, READONLY, DEBUGGING + 5 .comment 0000002f 00000000 00000000 00000e5a 2**0 + CONTENTS, READONLY + 6 .debug_aranges 000000b8 00000000 00000000 00000e89 2**0 + CONTENTS, READONLY, DEBUGGING + 7 .debug_info 00003c2d 00000000 00000000 00000f41 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_abbrev 000005f5 00000000 00000000 00004b6e 2**0 + CONTENTS, READONLY, DEBUGGING + 9 .debug_line 00000582 00000000 00000000 00005163 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_frame 00000220 00000000 00000000 000056e8 2**2 + CONTENTS, READONLY, DEBUGGING + 11 .debug_str 000026d3 00000000 00000000 00005908 2**0 + CONTENTS, READONLY, DEBUGGING + 12 .debug_loc 00000c25 00000000 00000000 00007fdb 2**0 + CONTENTS, READONLY, DEBUGGING + 13 .debug_ranges 000000c0 00000000 00000000 00008c00 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 0c 94 35 00 jmp 0x6a ; 0x6a <__ctors_end> + 4: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt> + 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 21 01 jmp 0x242 ; 0x242 <__vector_16> + 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>: + 68: 27 03 mulsu r18, r23 + +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 + 7c: e6 e6 ldi r30, 0x66 ; 102 + 7e: f6 e0 ldi r31, 0x06 ; 6 + 80: 02 c0 rjmp .+4 ; 0x86 <__do_copy_data+0x10> + 82: 05 90 lpm r0, Z+ + 84: 0d 92 st X+, r0 + 86: a2 31 cpi r26, 0x12 ; 18 + 88: b1 07 cpc r27, r17 + 8a: d9 f7 brne .-10 ; 0x82 <__do_copy_data+0xc> + +0000008c <__do_clear_bss>: + 8c: 21 e0 ldi r18, 0x01 ; 1 + 8e: a2 e1 ldi r26, 0x12 ; 18 + 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>: + 96: aa 31 cpi r26, 0x1A ; 26 + 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 + a8: 0e 94 2d 03 call 0x65a ; 0x65a <__tablejump__> + ac: c8 36 cpi r28, 0x68 ; 104 + ae: d1 07 cpc r29, r17 + b0: c9 f7 brne .-14 ; 0xa4 <__do_global_ctors+0x8> + b2: 0e 94 09 02 call 0x412 ; 0x412
+ b6: 0c 94 31 03 jmp 0x662 ; 0x662 <_exit> + +000000ba <__bad_interrupt>: + ba: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> + +000000be <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.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; } + be: 21 9a sbi 0x04, 1 ; 4 + c0: 08 95 ret + +000000c2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22>: + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + c2: 3c 9a sbi 0x07, 4 ; 7 + c4: 08 95 ret + +000000c6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29>: + } + void init_spi() { + SPCR = (1< +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + d0: 40 9a sbi 0x08, 0 ; 8 + d2: 01 c0 rjmp .+2 ; 0xd6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29+0x10> + d4: 40 98 cbi 0x08, 0 ; 8 + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + d6: 38 9a sbi 0x07, 0 ; 7 + mosi::make_high(); + } + else { + mosi::make_low(); + } + datain <<= 1; + d8: 88 0f add r24, r24 + if(miso::read()) { + da: 33 99 sbic 0x06, 3 ; 6 + datain |= 1; + dc: 81 60 ori r24, 0x01 ; 1 +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + de: 41 9a sbi 0x08, 1 ; 8 + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + e0: 39 9a sbi 0x07, 1 ; 7 + } + sck::make_high(); + data<<=1; + e2: 22 0f add r18, r18 + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + e4: 00 c0 rjmp .+0 ; 0xe6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29+0x20> + e6: 00 00 nop +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + e8: 41 98 cbi 0x08, 1 ; 8 + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + ea: 39 9a sbi 0x07, 1 ; 7 + ec: 91 50 subi r25, 0x01 ; 1 + SPCR = (1< + data<<=1; + _delay_us(0.3); + sck::make_low(); + } + return datain; + } + f0: 08 95 ret + +000000f2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6>: + public: + Led() { + init(); + } + void color(uint8_t mask) { + (mask & (1<<0)) ? green::make_high() : green::make_low(); + f2: 80 ff sbrs r24, 0 + f4: 02 c0 rjmp .+4 ; 0xfa <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0x8> +namespace avrlib { + + struct portd + { + static uint8_t port() { return PORTD; } + static void port(uint8_t v) { PORTD = v; } + f6: 5e 9a sbi 0x0b, 6 ; 11 + f8: 01 c0 rjmp .+2 ; 0xfc <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0xa> + fa: 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; } + fc: 56 9a sbi 0x0a, 6 ; 10 + (mask & (1<<1)) ? red::make_high() : red::make_low(); + fe: 81 ff sbrs r24, 1 + 100: 02 c0 rjmp .+4 ; 0x106 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0x14> +namespace avrlib { + + struct portd + { + static uint8_t port() { return PORTD; } + static void port(uint8_t v) { PORTD = v; } + 102: 5f 9a sbi 0x0b, 7 ; 11 + 104: 01 c0 rjmp .+2 ; 0x108 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0x16> + 106: 5f 98 cbi 0x0b, 7 ; 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; } + 108: 57 9a sbi 0x0a, 7 ; 10 + 10a: 08 95 ret + +0000010c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv>: + void init() + { + led.color(led.RED); + this->status = this->SLEEP; + } + void hook_turn() + 10c: cf 93 push r28 + 10e: df 93 push r29 + 110: ec 01 movw r28, r24 + { + if(this->status == this->RUN){ + 112: 8a 81 ldd r24, Y+2 ; 0x02 + 114: 86 30 cpi r24, 0x06 ; 6 + 116: c9 f1 breq .+114 ; 0x18a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x7e> + return; + } + this->status = this->RUN; + 118: 86 e0 ldi r24, 0x06 ; 6 + 11a: 8a 83 std Y+2, r24 ; 0x02 + public: + Servo() { + init(); + } + void turn(uint16_t mask) { + this->servopos = mask; + 11c: 1d 82 std Y+5, r1 ; 0x05 +namespace avrlib { + + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 11e: 29 9a sbi 0x05, 1 ; 5 + 120: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10> + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + 124: 8f e1 ldi r24, 0x1F ; 31 + 126: 9e e4 ldi r25, 0x4E ; 78 + 128: 01 97 sbiw r24, 0x01 ; 1 + 12a: f1 f7 brne .-4 ; 0x128 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x1c> + 12c: 00 c0 rjmp .+0 ; 0x12e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x22> + 12e: 00 00 nop + 130: 8e e1 ldi r24, 0x1E ; 30 + 132: ef e0 ldi r30, 0x0F ; 15 + 134: f7 e2 ldi r31, 0x27 ; 39 + 136: 31 97 sbiw r30, 0x01 ; 1 + 138: f1 f7 brne .-4 ; 0x136 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x2a> + 13a: 00 c0 rjmp .+0 ; 0x13c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x30> + 13c: 00 00 nop + 13e: 81 50 subi r24, 0x01 ; 1 + virtual uint8_t funk_get_byte() = 0; + virtual void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) = 0; + + void wait() { + _delay_ms(10); + for(uint8_t i=0;iDEVICE;i++) { + 140: c1 f7 brne .-16 ; 0x132 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x26> + 142: ff ef ldi r31, 0xFF ; 255 + 144: 23 ec ldi r18, 0xC3 ; 195 + 146: 89 e0 ldi r24, 0x09 ; 9 + 148: f1 50 subi r31, 0x01 ; 1 + 14a: 20 40 sbci r18, 0x00 ; 0 + 14c: 80 40 sbci r24, 0x00 ; 0 + 14e: e1 f7 brne .-8 ; 0x148 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x3c> + 150: 00 c0 rjmp .+0 ; 0x152 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x46> + 152: 00 00 nop + 154: 89 e6 ldi r24, 0x69 ; 105 + 156: 8d 83 std Y+5, r24 ; 0x05 + 158: 9f ef ldi r25, 0xFF ; 255 + 15a: e2 e5 ldi r30, 0x52 ; 82 + 15c: f7 e0 ldi r31, 0x07 ; 7 + 15e: 91 50 subi r25, 0x01 ; 1 + 160: e0 40 sbci r30, 0x00 ; 0 + 162: f0 40 sbci r31, 0x00 ; 0 + 164: e1 f7 brne .-8 ; 0x15e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x52> + 166: 00 c0 rjmp .+0 ; 0x168 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x5c> + 168: 00 00 nop + 16a: 82 ed ldi r24, 0xD2 ; 210 + 16c: 8d 83 std Y+5, r24 ; 0x05 + 16e: 2f ef ldi r18, 0xFF ; 255 + 170: 86 e1 ldi r24, 0x16 ; 22 + 172: 91 e1 ldi r25, 0x11 ; 17 + 174: 21 50 subi r18, 0x01 ; 1 + 176: 80 40 sbci r24, 0x00 ; 0 + 178: 90 40 sbci r25, 0x00 ; 0 + 17a: e1 f7 brne .-8 ; 0x174 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x68> + 17c: 00 c0 rjmp .+0 ; 0x17e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x72> + 17e: 00 00 nop + 180: 29 98 cbi 0x05, 1 ; 5 + servo.turn(servo.MIDDLE); + _delay_ms(300); + servo.turn(servo.RIGHT); + _delay_ms(700); + servo.off(); + } + 182: df 91 pop r29 + 184: cf 91 pop r28 + 186: 0c 94 5f 00 jmp 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10> + 18a: df 91 pop r29 + 18c: cf 91 pop r28 + 18e: 08 95 ret + +00000190 <_ZN4Snap11send_packetEh>: + data[i] = this->funk_get_byte(); + } + this->funk_end(); + } + + void send_packet(uint8_t data) { + 190: 26 2f mov r18, r22 + this->funk_send_packet(this->MASTER, this->DEVICE, data); + 192: dc 01 movw r26, r24 + 194: ed 91 ld r30, X+ + 196: fc 91 ld r31, X + 198: 04 84 ldd r0, Z+12 ; 0x0c + 19a: f5 85 ldd r31, Z+13 ; 0x0d + 19c: e0 2d mov r30, r0 + 19e: 4e e1 ldi r20, 0x1E ; 30 + 1a0: 61 e0 ldi r22, 0x01 ; 1 + 1a2: 09 94 ijmp + +000001a4 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv>: + + void hook_poll() + 1a4: cf 93 push r28 + 1a6: df 93 push r29 + 1a8: ec 01 movw r28, r24 + { + if(this->status == this->ACTIVE) { + 1aa: 8a 81 ldd r24, Y+2 ; 0x02 + 1ac: 83 30 cpi r24, 0x03 ; 3 + 1ae: d9 f4 brne .+54 ; 0x1e6 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x42> + if(mc.is_pressed()) { + 1b0: 4a 99 sbic 0x09, 2 ; 9 + 1b2: 19 c0 rjmp .+50 ; 0x1e6 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x42> + this->funk_end(); + 1b4: e8 81 ld r30, Y + 1b6: f9 81 ldd r31, Y+1 ; 0x01 + 1b8: 06 80 ldd r0, Z+6 ; 0x06 + 1ba: f7 81 ldd r31, Z+7 ; 0x07 + 1bc: e0 2d mov r30, r0 + 1be: ce 01 movw r24, r28 + 1c0: 09 95 icall + this->hook_turn(); + 1c2: e8 81 ld r30, Y + 1c4: f9 81 ldd r31, Y+1 ; 0x01 + 1c6: 01 90 ld r0, Z+ + 1c8: f0 81 ld r31, Z + 1ca: e0 2d mov r30, r0 + 1cc: ce 01 movw r24, r28 + 1ce: 09 95 icall + this->send_packet(this->RUN); + 1d0: 66 e0 ldi r22, 0x06 ; 6 + 1d2: ce 01 movw r24, r28 + 1d4: 0e 94 c8 00 call 0x190 ; 0x190 <_ZN4Snap11send_packetEh> + this->funk_begin(); + 1d8: e8 81 ld r30, Y + 1da: f9 81 ldd r31, Y+1 ; 0x01 + 1dc: 04 80 ldd r0, Z+4 ; 0x04 + 1de: f5 81 ldd r31, Z+5 ; 0x05 + 1e0: e0 2d mov r30, r0 + 1e2: ce 01 movw r24, r28 + 1e4: 09 95 icall + } + } + if(this->status == this->SLEEP) { + 1e6: 8a 81 ldd r24, Y+2 ; 0x02 + 1e8: 82 30 cpi r24, 0x02 ; 2 + 1ea: a1 f4 brne .+40 ; 0x214 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x70> + if(mc.is_pressed()) { + 1ec: 4a 99 sbic 0x09, 2 ; 9 + 1ee: 12 c0 rjmp .+36 ; 0x214 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x70> + this->funk_end(); + 1f0: e8 81 ld r30, Y + 1f2: f9 81 ldd r31, Y+1 ; 0x01 + 1f4: 06 80 ldd r0, Z+6 ; 0x06 + 1f6: f7 81 ldd r31, Z+7 ; 0x07 + 1f8: e0 2d mov r30, r0 + 1fa: ce 01 movw r24, r28 + 1fc: 09 95 icall + this->send_packet(this->DEDECT); + 1fe: 68 e0 ldi r22, 0x08 ; 8 + 200: ce 01 movw r24, r28 + 202: 0e 94 c8 00 call 0x190 ; 0x190 <_ZN4Snap11send_packetEh> + this->funk_begin(); + 206: e8 81 ld r30, Y + 208: f9 81 ldd r31, Y+1 ; 0x01 + 20a: 04 80 ldd r0, Z+4 ; 0x04 + 20c: f5 81 ldd r31, Z+5 ; 0x05 + 20e: e0 2d mov r30, r0 + 210: ce 01 movw r24, r28 + 212: 09 95 icall + } + } + if(st.is_pressed()) { + 214: 4b 99 sbic 0x09, 3 ; 9 + 216: 12 c0 rjmp .+36 ; 0x23c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x98> + if(this->status == this->SLEEP) { + 218: 8a 81 ldd r24, Y+2 ; 0x02 + 21a: 82 30 cpi r24, 0x02 ; 2 + 21c: 79 f4 brne .+30 ; 0x23c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x98> + this->status = this->RUN; + 21e: 86 e0 ldi r24, 0x06 ; 6 + 220: 8a 83 std Y+2, r24 ; 0x02 + 222: 2f ef ldi r18, 0xFF ; 255 + 224: 3c e2 ldi r19, 0x2C ; 44 + 226: 81 e3 ldi r24, 0x31 ; 49 + 228: 91 e0 ldi r25, 0x01 ; 1 + 22a: 21 50 subi r18, 0x01 ; 1 + 22c: 30 40 sbci r19, 0x00 ; 0 + 22e: 80 40 sbci r24, 0x00 ; 0 + 230: 90 40 sbci r25, 0x00 ; 0 + 232: d9 f7 brne .-10 ; 0x22a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x86> + 234: 00 c0 rjmp .+0 ; 0x236 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x92> + 236: 00 00 nop + _delay_ms(15000); + this->status = this->ACTIVE; + 238: 83 e0 ldi r24, 0x03 ; 3 + 23a: 8a 83 std Y+2, r24 ; 0x02 + } + } + } + 23c: df 91 pop r29 + 23e: cf 91 pop r28 + 240: 08 95 ret + +00000242 <__vector_16>: + { + funk.worker(); + } +} + +ISR(TIMER0_OVF_vect) { + 242: 1f 92 push r1 + 244: 0f 92 push r0 + 246: 0f b6 in r0, 0x3f ; 63 + 248: 0f 92 push r0 + 24a: 11 24 eor r1, r1 + 24c: 2f 93 push r18 + 24e: 3f 93 push r19 + 250: 4f 93 push r20 + 252: 5f 93 push r21 + 254: 6f 93 push r22 + 256: 7f 93 push r23 + 258: 8f 93 push r24 + 25a: 9f 93 push r25 + 25c: af 93 push r26 + 25e: bf 93 push r27 + 260: ef 93 push r30 + 262: ff 93 push r31 + volatile uint8_t status; + Funk() { + this->init(); + } + void timer() { + if(this->status == this->SLEEP) { + 264: 80 91 14 01 lds r24, 0x0114 + 268: 82 30 cpi r24, 0x02 ; 2 + 26a: 11 f4 brne .+4 ; 0x270 <__vector_16+0x2e> + led.color(led.GREEN); + 26c: 81 e0 ldi r24, 0x01 ; 1 + 26e: 0b c0 rjmp .+22 ; 0x286 <__vector_16+0x44> + } else if(this->status == this->ACTIVE) { + 270: 80 91 14 01 lds r24, 0x0114 + 274: 83 30 cpi r24, 0x03 ; 3 + 276: 11 f4 brne .+4 ; 0x27c <__vector_16+0x3a> + led.color(led.RED); + 278: 82 e0 ldi r24, 0x02 ; 2 + 27a: 05 c0 rjmp .+10 ; 0x286 <__vector_16+0x44> + } else if(this->status == this->RUN) { + 27c: 80 91 14 01 lds r24, 0x0114 + 280: 86 30 cpi r24, 0x06 ; 6 + 282: 19 f4 brne .+6 ; 0x28a <__vector_16+0x48> + led.color(led.YELLOW); + 284: 83 e0 ldi r24, 0x03 ; 3 + 286: 0e 94 79 00 call 0xf2 ; 0xf2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6> + } + void off() { + servo_act::make_low(); + } + void timer() { + TCNT0 = 0x64; // Reinitialize Timer 0 value + 28a: 84 e6 ldi r24, 0x64 ; 100 + 28c: 86 bd out 0x26, r24 ; 38 + 28e: 2a 9a sbi 0x05, 2 ; 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; } + 290: 22 9a sbi 0x04, 2 ; 4 + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + 292: 8f ef ldi r24, 0xFF ; 255 + 294: 94 e0 ldi r25, 0x04 ; 4 + 296: 01 97 sbiw r24, 0x01 ; 1 + 298: f1 f7 brne .-4 ; 0x296 <__vector_16+0x54> + 29a: 00 c0 rjmp .+0 ; 0x29c <__vector_16+0x5a> + 29c: 00 00 nop + servo_io::make_high(); + _delay_us(s_left); + for(uint16_t i = 0; i < servopos; i++) { + 29e: 80 e0 ldi r24, 0x00 ; 0 + 2a0: 90 e0 ldi r25, 0x00 ; 0 + 2a2: 05 c0 rjmp .+10 ; 0x2ae <__vector_16+0x6c> + 2a4: 25 e1 ldi r18, 0x15 ; 21 + 2a6: 2a 95 dec r18 + 2a8: f1 f7 brne .-4 ; 0x2a6 <__vector_16+0x64> + 2aa: 00 00 nop + 2ac: 01 96 adiw r24, 0x01 ; 1 + 2ae: 20 91 17 01 lds r18, 0x0117 + 2b2: 30 e0 ldi r19, 0x00 ; 0 + 2b4: 82 17 cp r24, r18 + 2b6: 93 07 cpc r25, r19 + 2b8: a8 f3 brcs .-22 ; 0x2a4 <__vector_16+0x62> +namespace avrlib { + + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 2ba: 2a 98 cbi 0x05, 2 ; 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; } + 2bc: 22 9a sbi 0x04, 2 ; 4 + funk.timer(); + 2be: ff 91 pop r31 + 2c0: ef 91 pop r30 + 2c2: bf 91 pop r27 + 2c4: af 91 pop r26 + 2c6: 9f 91 pop r25 + 2c8: 8f 91 pop r24 + 2ca: 7f 91 pop r23 + 2cc: 6f 91 pop r22 + 2ce: 5f 91 pop r21 + 2d0: 4f 91 pop r20 + 2d2: 3f 91 pop r19 + 2d4: 2f 91 pop r18 + 2d6: 0f 90 pop r0 + 2d8: 0f be out 0x3f, r0 ; 63 + 2da: 0f 90 pop r0 + 2dc: 1f 90 pop r1 + 2de: 18 95 reti + +000002e0 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv>: + } + servo.timer(); + } + void worker() { + 2e0: cf 92 push r12 + 2e2: df 92 push r13 + 2e4: ef 92 push r14 + 2e6: ff 92 push r15 + 2e8: 0f 93 push r16 + 2ea: 1f 93 push r17 + 2ec: cf 93 push r28 + 2ee: df 93 push r29 + 2f0: 00 d0 rcall .+0 ; 0x2f2 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x12> + 2f2: 1f 92 push r1 + 2f4: cd b7 in r28, 0x3d ; 61 + 2f6: de b7 in r29, 0x3e ; 62 + 2f8: 8c 01 movw r16, r24 + for(uint8_t i=0;iDEVICE;i++) { + _delay_ms(5); + } + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + 2fa: dc 01 movw r26, r24 + 2fc: ed 91 ld r30, X+ + 2fe: fc 91 ld r31, X + 300: 04 80 ldd r0, Z+4 ; 0x04 + 302: f5 81 ldd r31, Z+5 ; 0x05 + 304: e0 2d mov r30, r0 + 306: 09 95 icall + 308: ee 24 eor r14, r14 + 30a: e3 94 inc r14 + 30c: f1 2c mov r15, r1 + 30e: ec 0e add r14, r28 + 310: fd 1e adc r15, r29 + 312: 6e 01 movw r12, r28 + 314: b4 e0 ldi r27, 0x04 ; 4 + 316: cb 0e add r12, r27 + 318: d1 1c adc r13, r1 + 31a: 05 c0 rjmp .+10 ; 0x326 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x46> + for (uint8_t i = 0; i < len; i++) + { + while(this->funk_has_data()) { + this->hook_poll(); + 31c: 02 80 ldd r0, Z+2 ; 0x02 + 31e: f3 81 ldd r31, Z+3 ; 0x03 + 320: e0 2d mov r30, r0 + 322: c8 01 movw r24, r16 + 324: 09 95 icall + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + for (uint8_t i = 0; i < len; i++) + { + while(this->funk_has_data()) { + 326: d8 01 movw r26, r16 + 328: ed 91 ld r30, X+ + 32a: fc 91 ld r31, X + 32c: 00 84 ldd r0, Z+8 ; 0x08 + 32e: f1 85 ldd r31, Z+9 ; 0x09 + 330: e0 2d mov r30, r0 + 332: c8 01 movw r24, r16 + 334: 09 95 icall + 336: d8 01 movw r26, r16 + 338: ed 91 ld r30, X+ + 33a: fc 91 ld r31, X + 33c: 81 11 cpse r24, r1 + 33e: ee cf rjmp .-36 ; 0x31c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x3c> + this->hook_poll(); + } + data[i] = this->funk_get_byte(); + 340: 02 84 ldd r0, Z+10 ; 0x0a + 342: f3 85 ldd r31, Z+11 ; 0x0b + 344: e0 2d mov r30, r0 + 346: c8 01 movw r24, r16 + 348: 09 95 icall + 34a: f7 01 movw r30, r14 + 34c: 81 93 st Z+, r24 + 34e: 7f 01 movw r14, r30 + _delay_ms(5); + } + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + for (uint8_t i = 0; i < len; i++) + 350: ec 15 cp r30, r12 + 352: fd 05 cpc r31, r13 + 354: 41 f7 brne .-48 ; 0x326 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x46> + while(this->funk_has_data()) { + this->hook_poll(); + } + data[i] = this->funk_get_byte(); + } + this->funk_end(); + 356: d8 01 movw r26, r16 + 358: ed 91 ld r30, X+ + 35a: fc 91 ld r31, X + 35c: 06 80 ldd r0, Z+6 ; 0x06 + 35e: f7 81 ldd r31, Z+7 ; 0x07 + 360: e0 2d mov r30, r0 + 362: c8 01 movw r24, r16 + 364: 09 95 icall + uint8_t data[3]; + this->get_packet(data, 3); + if(data[0] == ALL || data[0] == DEVICE || data[0] == GROUP) { + 366: 89 81 ldd r24, Y+1 ; 0x01 + 368: 88 23 and r24, r24 + 36a: 29 f0 breq .+10 ; 0x376 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x96> + 36c: 8e 31 cpi r24, 0x1E ; 30 + 36e: 19 f0 breq .+6 ; 0x376 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x96> + 370: 80 3f cpi r24, 0xF0 ; 240 + 372: 09 f0 breq .+2 ; 0x376 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x96> + 374: 42 c0 rjmp .+132 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + if(data[1] == this->MASTER) { + 376: 8a 81 ldd r24, Y+2 ; 0x02 + 378: 81 30 cpi r24, 0x01 ; 1 + 37a: 09 f0 breq .+2 ; 0x37e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x9e> + 37c: 3e c0 rjmp .+124 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + switch(data[2]) { + 37e: 8b 81 ldd r24, Y+3 ; 0x03 + 380: 84 30 cpi r24, 0x04 ; 4 + 382: 49 f0 breq .+18 ; 0x396 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xb6> + 384: 18 f4 brcc .+6 ; 0x38c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xac> + 386: 81 30 cpi r24, 0x01 ; 1 + 388: c1 f5 brne .+112 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + 38a: 18 c0 rjmp .+48 ; 0x3bc <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xdc> + 38c: 85 30 cpi r24, 0x05 ; 5 + 38e: 39 f0 breq .+14 ; 0x39e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xbe> + 390: 87 30 cpi r24, 0x07 ; 7 + 392: 99 f5 brne .+102 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + 394: 09 c0 rjmp .+18 ; 0x3a8 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xc8> + case this->PING: { + break; + } + case this->SETSLEEP: { + this->status = this->SLEEP; + 396: 82 e0 ldi r24, 0x02 ; 2 + 398: f8 01 movw r30, r16 + 39a: 82 83 std Z+2, r24 ; 0x02 + break; + 39c: 0f c0 rjmp .+30 ; 0x3bc <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xdc> + } + case this->SETACTIVE: { + this->status = this->ACTIVE; + 39e: 83 e0 ldi r24, 0x03 ; 3 + 3a0: d8 01 movw r26, r16 + 3a2: 12 96 adiw r26, 0x02 ; 2 + 3a4: 8c 93 st X, r24 + break; + 3a6: 0a c0 rjmp .+20 ; 0x3bc <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xdc> + } + case this->SETRUN: { + this->hook_turn(); + 3a8: d8 01 movw r26, r16 + 3aa: ed 91 ld r30, X+ + 3ac: fc 91 ld r31, X + 3ae: 01 90 ld r0, Z+ + 3b0: f0 81 ld r31, Z + 3b2: e0 2d mov r30, r0 + 3b4: c8 01 movw r24, r16 + 3b6: 09 95 icall + this->send_packet(this->RUN); + 3b8: 66 e0 ldi r22, 0x06 ; 6 + 3ba: 11 c0 rjmp .+34 ; 0x3de <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xfe> + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + 3bc: ef e1 ldi r30, 0x1F ; 31 + 3be: fe e4 ldi r31, 0x4E ; 78 + 3c0: 31 97 sbiw r30, 0x01 ; 1 + 3c2: f1 f7 brne .-4 ; 0x3c0 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xe0> + 3c4: 00 c0 rjmp .+0 ; 0x3c6 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xe6> + 3c6: 00 00 nop + 3c8: 8e e1 ldi r24, 0x1E ; 30 + 3ca: af e0 ldi r26, 0x0F ; 15 + 3cc: b7 e2 ldi r27, 0x27 ; 39 + 3ce: 11 97 sbiw r26, 0x01 ; 1 + 3d0: f1 f7 brne .-4 ; 0x3ce <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xee> + 3d2: 00 c0 rjmp .+0 ; 0x3d4 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xf4> + 3d4: 00 00 nop + 3d6: 81 50 subi r24, 0x01 ; 1 + virtual uint8_t funk_get_byte() = 0; + virtual void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) = 0; + + void wait() { + _delay_ms(10); + for(uint8_t i=0;iDEVICE;i++) { + 3d8: c1 f7 brne .-16 ; 0x3ca <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xea> + default: { + return; + } + } + this->wait(); + this->send_packet(this->status); + 3da: f8 01 movw r30, r16 + 3dc: 62 81 ldd r22, Z+2 ; 0x02 + 3de: c8 01 movw r24, r16 + return; + } + } + } + 3e0: 0f 90 pop r0 + 3e2: 0f 90 pop r0 + 3e4: 0f 90 pop r0 + 3e6: df 91 pop r29 + 3e8: cf 91 pop r28 + 3ea: 1f 91 pop r17 + 3ec: 0f 91 pop r16 + 3ee: ff 90 pop r15 + 3f0: ef 90 pop r14 + 3f2: df 90 pop r13 + 3f4: cf 90 pop r12 + default: { + return; + } + } + this->wait(); + this->send_packet(this->status); + 3f6: 0c 94 c8 00 jmp 0x190 ; 0x190 <_ZN4Snap11send_packetEh> + return; + } + } + } + 3fa: 0f 90 pop r0 + 3fc: 0f 90 pop r0 + 3fe: 0f 90 pop r0 + 400: df 91 pop r29 + 402: cf 91 pop r28 + 404: 1f 91 pop r17 + 406: 0f 91 pop r16 + 408: ff 90 pop r15 + 40a: ef 90 pop r14 + 40c: df 90 pop r13 + 40e: cf 90 pop r12 + 410: 08 95 ret + +00000412
: +funkclass funk; + +int main(void) { + while(1) + { + funk.worker(); + 412: 82 e1 ldi r24, 0x12 ; 18 + 414: 91 e0 ldi r25, 0x01 ; 1 + 416: 0e 94 70 01 call 0x2e0 ; 0x2e0 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv> + 41a: fb cf rjmp .-10 ; 0x412
+ +0000041c <_ZN6avrlib3pinINS_5portcELh4EE5clearEv>: +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + 41c: 44 98 cbi 0x08, 4 ; 8 + 41e: 08 95 ret + +00000420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42>: + + static bool output() { return (Port::dir() & (1< + 424: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + this->init(); + } + + void ready(void) { + s.CSOn(); + while(s.has_data()); // wait until FIFO ready + 428: 33 9b sbis 0x06, 3 ; 6 + 42a: fe cf rjmp .-4 ; 0x428 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42+0x8> + } + 42c: 08 95 ret + +0000042e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31>: + this->send(0x8208); // TX off + _delay_ms(100); + } + private: + Spi s; + uint16_t send(uint16_t wert) { + 42e: ef 92 push r14 + 430: ff 92 push r15 + 432: 1f 93 push r17 + 434: cf 93 push r28 + 436: df 93 push r29 + 438: 00 d0 rcall .+0 ; 0x43a <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31+0xc> + 43a: cd b7 in r28, 0x3d ; 61 + 43c: de b7 in r29, 0x3e ; 62 + 43e: 18 2f mov r17, r24 + 440: 9a 83 std Y+2, r25 ; 0x02 + 442: 0e 94 0e 02 call 0x41c ; 0x41c <_ZN6avrlib3pinINS_5portcELh4EE5clearEv> + 446: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + } + uint8_t send(uint8_t data) { + if(mode == 0) { + return this->send_hard(data); + } + return this->send_soft(data); + 44a: 8a 81 ldd r24, Y+2 ; 0x02 + 44c: 0e 94 63 00 call 0xc6 ; 0xc6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29> + s.CSOn(); + uint16_t werti = s.send((uint8_t)(wert >> 8)) << 8; + 450: f8 2e mov r15, r24 + 452: e1 2c mov r14, r1 + 454: 81 2f mov r24, r17 + 456: 0e 94 63 00 call 0xc6 ; 0xc6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29> + werti |= s.send((uint8_t)wert); + 45a: 97 01 movw r18, r14 + 45c: 28 2b or r18, r24 + 45e: c9 01 movw r24, r18 + 460: 44 9a sbi 0x08, 4 ; 8 + 462: 8a 83 std Y+2, r24 ; 0x02 + 464: 99 83 std Y+1, r25 ; 0x01 + 466: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + s.CSOff(); + return werti; + } + 46a: 8a 81 ldd r24, Y+2 ; 0x02 + 46c: 99 81 ldd r25, Y+1 ; 0x01 + 46e: 0f 90 pop r0 + 470: 0f 90 pop r0 + 472: df 91 pop r29 + 474: cf 91 pop r28 + 476: 1f 91 pop r17 + 478: ff 90 pop r15 + 47a: ef 90 pop r14 + 47c: 08 95 ret + +0000047e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev>: + +template +class Funk : public Snap { + public: + volatile uint8_t status; + Funk() { + 47e: cf 93 push r28 + 480: df 93 push r29 + 482: ec 01 movw r28, r24 + 484: 84 e0 ldi r24, 0x04 ; 4 + 486: 91 e0 ldi r25, 0x01 ; 1 + 488: 99 83 std Y+1, r25 ; 0x01 + 48a: 88 83 st Y, r24 + 48c: 53 98 cbi 0x0a, 3 ; 10 +namespace avrlib { + + struct portd + { + static uint8_t port() { return PORTD; } + static void port(uint8_t v) { PORTD = v; } + 48e: 5b 98 cbi 0x0b, 3 ; 11 + 490: 5b 9a sbi 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; } + 492: 52 98 cbi 0x0a, 2 ; 10 +namespace avrlib { + + struct portd + { + static uint8_t port() { return PORTD; } + static void port(uint8_t v) { PORTD = v; } + 494: 5a 98 cbi 0x0b, 2 ; 11 + 496: 5a 9a sbi 0x0b, 2 ; 11 + static const uint16_t MIDDLE = s_middle; + static const uint16_t RIGHT = s_right; + private: + uint8_t servopos; + void init() { + this->servopos = 0; + 498: 1d 82 std Y+5, r1 ; 0x05 + 49a: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10> +namespace avrlib { + + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 49e: 29 98 cbi 0x05, 1 ; 5 + 4a0: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.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; } + 4a4: 22 9a sbi 0x04, 2 ; 4 + // Clock value: 7,813 kHz + // Mode: Normal top=0xFF + // OC0A output: Disconnected + // OC0B output: Disconnected + // Timer Period: 19,968 ms + TCCR0A=(0<servopos = 0; + servo_act::make_output(); + servo_act::make_low(); + servo_io::make_output(); + this->init_timer(); + sei(); + 4ba: 78 94 sei + + 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; } + 4bc: 57 9a sbi 0x0a, 7 ; 10 + 4be: 56 9a sbi 0x0a, 6 ; 10 + static const uint8_t YELLOW = 3; + private: + void init() { + red::make_output(); + green::make_output(); + color(BLACK); + 4c0: 80 e0 ldi r24, 0x00 ; 0 + 4c2: 0e 94 79 00 call 0xf2 ; 0xf2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6> + 4c6: 40 98 cbi 0x08, 0 ; 8 + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + 4c8: 38 9a sbi 0x07, 0 ; 7 +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + 4ca: 41 98 cbi 0x08, 1 ; 8 + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + 4cc: 39 9a sbi 0x07, 1 ; 7 +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + 4ce: 44 9a sbi 0x08, 4 ; 8 + 4d0: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + 4d4: 3b 98 cbi 0x07, 3 ; 7 +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + 4d6: 43 98 cbi 0x08, 3 ; 8 + 4d8: 2f ef ldi r18, 0xFF ; 255 + 4da: 80 e7 ldi r24, 0x70 ; 112 + 4dc: 92 e0 ldi r25, 0x02 ; 2 + 4de: 21 50 subi r18, 0x01 ; 1 + 4e0: 80 40 sbci r24, 0x00 ; 0 + 4e2: 90 40 sbci r25, 0x00 ; 0 + 4e4: e1 f7 brne .-8 ; 0x4de <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev+0x60> + 4e6: 00 c0 rjmp .+0 ; 0x4e8 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev+0x6a> + 4e8: 00 00 nop + void init(void) { + _delay_ms(100); + + this->send(0xC0E0); // AVR CLK: 10MHz + 4ea: 80 ee ldi r24, 0xE0 ; 224 + 4ec: 90 ec ldi r25, 0xC0 ; 192 + 4ee: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0x80D7); // Enable FIFO + 4f2: 87 ed ldi r24, 0xD7 ; 215 + 4f4: 90 e8 ldi r25, 0x80 ; 128 + 4f6: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xC2AB); // Data Filter: internal + 4fa: 8b ea ldi r24, 0xAB ; 171 + 4fc: 92 ec ldi r25, 0xC2 ; 194 + 4fe: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xCA81); // Set FIFO mode + 502: 81 e8 ldi r24, 0x81 ; 129 + 504: 9a ec ldi r25, 0xCA ; 202 + 506: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xE000); // disable wakeuptimer + 50a: 80 e0 ldi r24, 0x00 ; 0 + 50c: 90 ee ldi r25, 0xE0 ; 224 + 50e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xC800); // disable low duty cycle + 512: 80 e0 ldi r24, 0x00 ; 0 + 514: 98 ec ldi r25, 0xC8 ; 200 + 516: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xC4F7); // AFC settings: autotuning: -10kHz...+7,5kHz + 51a: 87 ef ldi r24, 0xF7 ; 247 + 51c: 94 ec ldi r25, 0xC4 ; 196 + 51e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + if( freq < 96 ) { // 430,2400MHz + this->send( 0xA000 | 96 ); + } else if( freq > 3903 ) { // 439,7575MHz + this->send( 0xA000 | 3903 ); + } + this->send( 0xA000 | freq ); + 522: 80 e2 ldi r24, 0x20 ; 32 + 524: 96 ea ldi r25, 0xA6 ; 166 + 526: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->setbandwidth(); // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm + this->setbaud(); // 19200 baud + this->setpower(); // 1mW Ausgangsleistung, 120kHz Frequenzshift + } + void setbandwidth() { + this->send( 0x9400 | ( ( bandwidth & 7 ) << 5 ) | ( ( gain & 3 ) << 3 ) | ( drssi & 7 ) ); + 52a: 87 e2 ldi r24, 0x27 ; 39 + 52c: 94 e9 ldi r25, 0x94 ; 148 + 52e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + return; + } + if (baud < 5400) { // Baudrate= 344827,58621/(R+1)/(1+CS*7) + this->send(0xC680 | ( ( 43104 / baud ) - 1 ) ); + } else { + this->send(0xC600 | ( ( 344828UL / baud ) - 1 ) ); + 532: 82 e2 ldi r24, 0x22 ; 34 + 534: 96 ec ldi r25, 0xC6 ; 198 + 536: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + } + } + void setpower() { + this->send( 0x9800 | ( power & 7 ) | ( ( mod & 15 ) << 4 ) ); + 53a: 80 e6 ldi r24, 0x60 ; 96 + 53c: 98 e9 ldi r25, 0x98 ; 152 + 53e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + Servo servo; + Led led; + Rfm12 rfm12; + void init() + { + led.color(led.RED); + 542: 82 e0 ldi r24, 0x02 ; 2 + 544: 0e 94 79 00 call 0xf2 ; 0xf2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6> + this->status = this->SLEEP; + 548: 82 e0 ldi r24, 0x02 ; 2 + 54a: 8a 83 std Y+2, r24 ; 0x02 +class Funk : public Snap { + public: + volatile uint8_t status; + Funk() { + this->init(); + } + 54c: df 91 pop r29 + 54e: cf 91 pop r28 + 550: 08 95 ret + +00000552 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE10funk_beginEv>: + s.CSOn(); + while(s.has_data()); // wait until FIFO ready + } + + void beginasyncrx() { + this->send(0x82C8); // RX on + 552: 88 ec ldi r24, 0xC8 ; 200 + 554: 92 e8 ldi r25, 0x82 ; 130 + 556: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xCA81); // set FIFO mode + 55a: 81 e8 ldi r24, 0x81 ; 129 + 55c: 9a ec ldi r25, 0xCA ; 202 + 55e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xCA83); // enable FIFO + 562: 83 e8 ldi r24, 0x83 ; 131 + 564: 9a ec ldi r25, 0xCA ; 202 + 566: 0c 94 17 02 jmp 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + +0000056a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE8funk_endEv>: + uint8_t rxbyte() { + return this->send(0xB000); + } + + void endasyncrx() { + this->send(0x8208); // RX off + 56a: 88 e0 ldi r24, 0x08 ; 8 + 56c: 92 e8 ldi r25, 0x82 ; 130 + 56e: 0c 94 17 02 jmp 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + +00000572 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_get_byteEv>: + s.CSOn(); + return s.has_data(); + } + + uint8_t rxbyte() { + return this->send(0xB000); + 572: 80 e0 ldi r24, 0x00 ; 0 + 574: 90 eb ldi r25, 0xB0 ; 176 + 576: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + uint8_t funk_has_data() { + return rfm12.hasdata(); + } + uint8_t funk_get_byte() { + return rfm12.rxbyte(); + } + 57a: 08 95 ret + +0000057c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh>: + void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) { + 57c: cf 93 push r28 + 57e: df 93 push r29 + 580: 00 d0 rcall .+0 ; 0x582 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh+0x6> + 582: 1f 92 push r1 + 584: cd b7 in r28, 0x3d ; 61 + 586: de b7 in r29, 0x3e ; 62 + } + this->send(0x8208); // RX off + } + + void txpacket(uint8_t addr, uint8_t from, uint8_t data) { + this->send(0x8238); // TX on + 588: 88 e3 ldi r24, 0x38 ; 56 + 58a: 92 e8 ldi r25, 0x82 ; 130 + 58c: 2b 83 std Y+3, r18 ; 0x03 + 58e: 4a 83 std Y+2, r20 ; 0x02 + 590: 69 83 std Y+1, r22 ; 0x01 + 592: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 596: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8AA); + 59a: 8a ea ldi r24, 0xAA ; 170 + 59c: 98 eb ldi r25, 0xB8 ; 184 + 59e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5a2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8AA); + 5a6: 8a ea ldi r24, 0xAA ; 170 + 5a8: 98 eb ldi r25, 0xB8 ; 184 + 5aa: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5ae: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8AA); + 5b2: 8a ea ldi r24, 0xAA ; 170 + 5b4: 98 eb ldi r25, 0xB8 ; 184 + 5b6: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5ba: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB82D); + 5be: 8d e2 ldi r24, 0x2D ; 45 + 5c0: 98 eb ldi r25, 0xB8 ; 184 + 5c2: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5c6: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8D4); + 5ca: 84 ed ldi r24, 0xD4 ; 212 + 5cc: 98 eb ldi r25, 0xB8 ; 184 + 5ce: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5d2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800|addr); + 5d6: 69 81 ldd r22, Y+1 ; 0x01 + 5d8: 86 2f mov r24, r22 + 5da: 90 e0 ldi r25, 0x00 ; 0 + 5dc: 98 6b ori r25, 0xB8 ; 184 + 5de: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5e2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800|from); + 5e6: 4a 81 ldd r20, Y+2 ; 0x02 + 5e8: 84 2f mov r24, r20 + 5ea: 90 e0 ldi r25, 0x00 ; 0 + 5ec: 98 6b ori r25, 0xB8 ; 184 + 5ee: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5f2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800|data); + 5f6: 2b 81 ldd r18, Y+3 ; 0x03 + 5f8: 82 2f mov r24, r18 + 5fa: 90 e0 ldi r25, 0x00 ; 0 + 5fc: 98 6b ori r25, 0xB8 ; 184 + 5fe: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 602: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800); + 606: 80 e0 ldi r24, 0x00 ; 0 + 608: 98 eb ldi r25, 0xB8 ; 184 + 60a: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 60e: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0x8208); // TX off + 612: 88 e0 ldi r24, 0x08 ; 8 + 614: 92 e8 ldi r25, 0x82 ; 130 + 616: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + 61a: 2f ef ldi r18, 0xFF ; 255 + 61c: 80 e7 ldi r24, 0x70 ; 112 + 61e: 92 e0 ldi r25, 0x02 ; 2 + 620: 21 50 subi r18, 0x01 ; 1 + 622: 80 40 sbci r24, 0x00 ; 0 + 624: 90 40 sbci r25, 0x00 ; 0 + 626: e1 f7 brne .-8 ; 0x620 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh+0xa4> + 628: 00 c0 rjmp .+0 ; 0x62a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh+0xae> + 62a: 00 00 nop + rfm12.txpacket(addr, from, data); + } + 62c: 0f 90 pop r0 + 62e: 0f 90 pop r0 + 630: 0f 90 pop r0 + 632: df 91 pop r29 + 634: cf 91 pop r28 + 636: 08 95 ret + +00000638 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_has_dataEv>: + 638: 0e 94 0e 02 call 0x41c ; 0x41c <_ZN6avrlib3pinINS_5portcELh4EE5clearEv> + 63c: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + + static uint8_t pin() { return PINC; } + 640: 86 b1 in r24, 0x06 ; 6 + } + uint8_t has_data() { + return !miso::read(); + 642: 83 fb bst r24, 3 + 644: 88 27 eor r24, r24 + 646: 80 f9 bld r24, 0 + void funk_end() { + rfm12.endasyncrx(); + } + uint8_t funk_has_data() { + return rfm12.hasdata(); + } + 648: 91 e0 ldi r25, 0x01 ; 1 + 64a: 89 27 eor r24, r25 + 64c: 08 95 ret + +0000064e <_GLOBAL__sub_I_funk>: + moveclass, //Bewegungsmelder + startclass, //Startknopf + servoclass, //Servo + ledclass //LED +> funkclass; +funkclass funk; + 64e: 82 e1 ldi r24, 0x12 ; 18 + 650: 91 e0 ldi r25, 0x01 ; 1 + 652: 0c 94 3f 02 jmp 0x47e ; 0x47e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev> + +00000656 <__tablejump2__>: + 656: ee 0f add r30, r30 + 658: ff 1f adc r31, r31 + +0000065a <__tablejump__>: + 65a: 05 90 lpm r0, Z+ + 65c: f4 91 lpm r31, Z + 65e: e0 2d mov r30, r0 + 660: 09 94 ijmp + +00000662 <_exit>: + 662: f8 94 cli + +00000664 <__stop_program>: + 664: ff cf rjmp .-2 ; 0x664 <__stop_program> diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map new file mode 100644 index 0000000..14f37b7 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map @@ -0,0 +1,526 @@ +Archive member included because of file (symbol) + +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_exit.o) + 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/avr5/crtm168a.o (exit) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_copy_data.o) + Zeitschaltung_V6.o (__do_copy_data) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_clear_bss.o) + Zeitschaltung_V6.o (__do_clear_bss) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_ctors.o) + Zeitschaltung_V6.o (__do_global_ctors) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_tablejump.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_ctors.o) (__tablejump__) + +Discarded input sections + + .bss 0x00000000 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/avr5/crtm168a.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .text 0x00000000 0x0 Zeitschaltung_V6.o + .rodata._ZTV4Snap + 0x00000000 0x12 Zeitschaltung_V6.o + .text 0x00000000 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/avr5\libgcc.a(_exit.o) + .bss 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .bss 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_copy_data.o) + .text 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .bss 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text 0x00000000 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/avr5\libgcc.a(_ctors.o) + .bss 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .bss 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + +Memory Configuration + +Name Origin Length Attributes +text 0x00000000 0x00020000 xr +data 0x00800060 0x0000ffa0 rw !x +eeprom 0x00810000 0x00010000 rw !x +fuse 0x00820000 0x00000400 rw !x +lock 0x00830000 0x00000400 rw !x +signature 0x00840000 0x00000400 rw !x +user_signatures 0x00850000 0x00000400 rw !x +*default* 0x00000000 0xffffffff + +Linker script and memory map + +Address of section .data set to 0x800100 +LOAD 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/avr5/crtm168a.o +LOAD Zeitschaltung_V6.o +START GROUP +LOAD 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/avr5\libm.a +END GROUP +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a +LOAD 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/avr5\libm.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a +LOAD 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/avr5\libc.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x00000000 0x666 + *(.vectors) + .vectors 0x00000000 0x68 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/avr5/crtm168a.o + 0x00000000 __vector_default + 0x00000000 __vectors + *(.vectors) + *(.progmem.gcc*) + *(.progmem*) + 0x00000068 . = ALIGN (0x2) + 0x00000068 __trampolines_start = . + *(.trampolines) + .trampolines 0x00000068 0x0 linker stubs + *(.trampolines*) + 0x00000068 __trampolines_end = . + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x00000068 __ctors_start = . + *(.ctors) + .ctors 0x00000068 0x2 Zeitschaltung_V6.o + 0x0000006a __ctors_end = . + 0x0000006a __dtors_start = . + *(.dtors) + 0x0000006a __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x0000006a 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/avr5/crtm168a.o + 0x0000006a __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x0000006a 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/../../../../avr/lib/avr5/crtm168a.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + .init4 0x00000076 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_copy_data.o) + 0x00000076 __do_copy_data + .init4 0x0000008c 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_clear_bss.o) + 0x0000008c __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + .init6 0x0000009c 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_ctors.o) + 0x0000009c __do_global_ctors + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x000000b2 0x8 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/avr5/crtm168a.o + *(.init9) + *(.text) + .text 0x000000ba 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/../../../../avr/lib/avr5/crtm168a.o + 0x000000ba __vector_22 + 0x000000ba __vector_1 + 0x000000ba __vector_24 + 0x000000ba __vector_12 + 0x000000ba __bad_interrupt + 0x000000ba __vector_6 + 0x000000ba __vector_3 + 0x000000ba __vector_23 + 0x000000ba __vector_25 + 0x000000ba __vector_11 + 0x000000ba __vector_13 + 0x000000ba __vector_17 + 0x000000ba __vector_19 + 0x000000ba __vector_7 + 0x000000ba __vector_5 + 0x000000ba __vector_4 + 0x000000ba __vector_9 + 0x000000ba __vector_2 + 0x000000ba __vector_21 + 0x000000ba __vector_15 + 0x000000ba __vector_8 + 0x000000ba __vector_14 + 0x000000ba __vector_10 + 0x000000ba __vector_18 + 0x000000ba __vector_20 + 0x000000be . = ALIGN (0x2) + *(.text.*) + .text._ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10 + 0x000000be 0x4 Zeitschaltung_V6.o + .text._ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22 + 0x000000c2 0x4 Zeitschaltung_V6.o + .text._ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29 + 0x000000c6 0x2c Zeitschaltung_V6.o + .text._ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6 + 0x000000f2 0x1a Zeitschaltung_V6.o + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv + 0x0000010c 0x84 Zeitschaltung_V6.o + 0x0000010c _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv + .text._ZN4Snap11send_packetEh + 0x00000190 0x14 Zeitschaltung_V6.o + 0x00000190 _ZN4Snap11send_packetEh + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv + 0x000001a4 0x9e Zeitschaltung_V6.o + 0x000001a4 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv + .text.__vector_16 + 0x00000242 0x9e Zeitschaltung_V6.o + 0x00000242 __vector_16 + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv + 0x000002e0 0x132 Zeitschaltung_V6.o + 0x000002e0 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv + .text.startup.main + 0x00000412 0xa Zeitschaltung_V6.o + 0x00000412 main + .text._ZN6avrlib3pinINS_5portcELh4EE5clearEv + 0x0000041c 0x4 Zeitschaltung_V6.o + 0x0000041c _ZN6avrlib3pinINS_5portcELh4EE5clearEv + .text._ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42 + 0x00000420 0xe Zeitschaltung_V6.o + .text._ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31 + 0x0000042e 0x50 Zeitschaltung_V6.o + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC2Ev + 0x0000047e 0xd4 Zeitschaltung_V6.o + 0x0000047e _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC2Ev + 0x0000047e _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE10funk_beginEv + 0x00000552 0x18 Zeitschaltung_V6.o + 0x00000552 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE10funk_beginEv + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE8funk_endEv + 0x0000056a 0x8 Zeitschaltung_V6.o + 0x0000056a _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE8funk_endEv + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_get_byteEv + 0x00000572 0xa Zeitschaltung_V6.o + 0x00000572 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_get_byteEv + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh + 0x0000057c 0xbc Zeitschaltung_V6.o + 0x0000057c _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_has_dataEv + 0x00000638 0x16 Zeitschaltung_V6.o + 0x00000638 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_has_dataEv + .text.startup._GLOBAL__sub_I_funk + 0x0000064e 0x8 Zeitschaltung_V6.o + .text.libgcc 0x00000656 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/avr5\libgcc.a(_tablejump.o) + 0x00000656 __tablejump2__ + 0x0000065a __tablejump__ + 0x00000662 . = ALIGN (0x2) + *(.fini9) + .fini9 0x00000662 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/avr5\libgcc.a(_exit.o) + 0x00000662 _exit + 0x00000662 exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x00000662 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/avr5\libgcc.a(_exit.o) + *(.fini0) + 0x00000666 _etext = . + +.data 0x00800100 0x12 load address 0x00000666 + 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/avr5/crtm168a.o + .data 0x00800100 0x0 Zeitschaltung_V6.o + .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/avr5\libgcc.a(_exit.o) + .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/avr5\libgcc.a(_copy_data.o) + .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/avr5\libgcc.a(_clear_bss.o) + .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/avr5\libgcc.a(_ctors.o) + .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/avr5\libgcc.a(_tablejump.o) + *(.data*) + *(.rodata) + *(.rodata*) + .rodata._ZTV4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE + 0x00800100 0x12 Zeitschaltung_V6.o + 0x00800100 _ZTV4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE + *(.gnu.linkonce.d*) + 0x00800112 . = ALIGN (0x2) + 0x00800112 _edata = . + 0x00800112 PROVIDE (__data_end, .) + +.bss 0x00800112 0x8 + 0x00800112 PROVIDE (__bss_start, .) + *(.bss) + .bss 0x00800112 0x8 Zeitschaltung_V6.o + 0x00800112 funk + *(.bss*) + *(COMMON) + 0x0080011a PROVIDE (__bss_end, .) + 0x00000666 __data_load_start = LOADADDR (.data) + 0x00000678 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x0080011a 0x0 + 0x0080011a PROVIDE (__noinit_start, .) + *(.noinit*) + 0x0080011a PROVIDE (__noinit_end, .) + 0x0080011a _end = . + 0x0080011a PROVIDE (__heap_start, .) + +.eeprom 0x00810000 0x0 + *(.eeprom*) + 0x00810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab 0x00000000 0x6cc + *(.stab) + .stab 0x00000000 0x6cc 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/avr5/crtm168a.o + +.stabstr 0x00000000 0x82 + *(.stabstr) + .stabstr 0x00000000 0x82 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/avr5/crtm168a.o + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x00000000 0x2f + *(.comment) + .comment 0x00000000 0x2f Zeitschaltung_V6.o + 0x30 (size before relaxing) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x00000000 0xb8 + *(.debug_aranges) + .debug_aranges + 0x00000000 0xb8 Zeitschaltung_V6.o + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x00000000 0x3c2d + *(.debug_info) + .debug_info 0x00000000 0x3c2d Zeitschaltung_V6.o + *(.gnu.linkonce.wi.*) + +.debug_abbrev 0x00000000 0x5f5 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x5f5 Zeitschaltung_V6.o + +.debug_line 0x00000000 0x582 + *(.debug_line) + .debug_line 0x00000000 0x582 Zeitschaltung_V6.o + +.debug_frame 0x00000000 0x220 + *(.debug_frame) + .debug_frame 0x00000000 0x220 Zeitschaltung_V6.o + +.debug_str 0x00000000 0x26d3 + *(.debug_str) + .debug_str 0x00000000 0x26d3 Zeitschaltung_V6.o + 0x2775 (size before relaxing) + +.debug_loc 0x00000000 0xc25 + *(.debug_loc) + .debug_loc 0x00000000 0xc25 Zeitschaltung_V6.o + +.debug_macinfo + *(.debug_macinfo) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges 0x00000000 0xc0 + *(.debug_ranges) + .debug_ranges 0x00000000 0xc0 Zeitschaltung_V6.o + +.debug_macro + *(.debug_macro) +OUTPUT(Zeitschaltung_V6.elf elf32-avr) +LOAD linker stubs diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec new file mode 100644 index 0000000..7ddae23 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec @@ -0,0 +1,107 @@ +S01800005A656974736368616C74756E675F56362E73726563BC +S11300000C9435000C945D000C945D000C945D0020 +S11300100C945D000C945D000C945D000C945D00E8 +S11300200C945D000C945D000C945D000C945D00D8 +S11300300C945D000C945D000C945D000C945D00C8 +S11300400C9421010C945D000C945D000C945D00F3 +S11300500C945D000C945D000C945D000C945D00A8 +S11300600C945D000C945D00270311241FBECFEF98 +S1130070D4E0DEBFCDBF11E0A0E0B1E0E6E6F6E0FB +S113008002C005900D92A231B107D9F721E0A2E197 +S1130090B1E001C01D92AA31B207E1F710E0CAE64F +S11300A0D0E004C02297FE010E942D03C836D10778 +S11300B0C9F70E9409020C9431030C940000219AA0 +S11300C008953C9A0895282F98E080E027FF02C005 +S11300D0409A01C04098389A880F33998160419AB8 +S11300E0399A220F00C000004198399A915071F753 +S11300F0089580FF02C05E9A01C05E98569A81FFFF +S113010002C05F9A01C05F98579A0895CF93DF9316 +S1130110EC018A818630C9F186E08A831D82299A9E +S11301200E945F008FE19EE40197F1F700C0000098 +S11301308EE1EFE0F7E23197F1F700C00000815063 +S1130140C1F7FFEF23EC89E0F15020408040E1F754 +S113015000C0000089E68D839FEFE2E5F7E091504F +S1130160E040F040E1F700C0000082ED8D832FEF06 +S113017086E191E1215080409040E1F700C0000009 +S11301802998DF91CF910C945F00DF91CF9108956E +S1130190262FDC01ED91FC910484F585E02D4EE1E0 +S11301A061E00994CF93DF93EC018A818330D9F421 +S11301B04A9919C0E881F9810680F781E02DCE01C2 +S11301C00995E881F9810190F081E02DCE0109952E +S11301D066E0CE010E94C800E881F9810480F581BF +S11301E0E02DCE0109958A818230A1F44A9912C08A +S11301F0E881F9810680F781E02DCE01099568E058 +S1130200CE010E94C800E881F9810480F581E02DC7 +S1130210CE0109954B9912C08A81823079F486E027 +S11302208A832FEF3CE281E391E02150304080400B +S11302309040D9F700C0000083E08A83DF91CF911A +S113024008951F920F920FB60F9211242F933F938C +S11302504F935F936F937F938F939F93AF93BF93CA +S1130260EF93FF9380911401823011F481E00BC06D +S113027080911401833011F482E005C0809114014F +S1130280863019F483E00E94790084E686BD2A9AB8 +S1130290229A8FEF94E00197F1F700C0000080E00C +S11302A090E005C025E12A95F1F700000196209120 +S11302B0170130E082179307A8F32A98229AFF9136 +S11302C0EF91BF91AF919F918F917F916F915F91CA +S11302D04F913F912F910F900FBE0F901F90189543 +S11302E0CF92DF92EF92FF920F931F93CF93DF93FE +S11302F000D01F92CDB7DEB78C01DC01ED91FC91EB +S11303000480F581E02D0995EE24E394F12CEC0EA4 +S1130310FD1E6E01B4E0CB0ED11C05C00280F3813A +S1130320E02DC8010995D801ED91FC910084F18577 +S1130330E02DC8010995D801ED91FC918111EECF12 +S11303400284F385E02DC8010995F70181937F01AB +S1130350EC15FD0541F7D801ED91FC910680F7817C +S1130360E02DC80109958981882329F08E3119F07F +S1130370803F09F042C08A81813009F03EC08B8100 +S1130380843049F018F48130C1F518C0853039F053 +S1130390873099F509C082E0F80182830FC083E0B9 +S11303A0D80112968C930AC0D801ED91FC9101906A +S11303B0F081E02DC801099566E011C0EFE1FEE48B +S11303C03197F1F700C000008EE1AFE0B7E211977A +S11303D0F1F700C000008150C1F7F8016281C80143 +S11303E00F900F900F90DF91CF911F910F91FF907D +S11303F0EF90DF90CF900C94C8000F900F900F9067 +S1130400DF91CF911F910F91FF90EF90DF90CF90EC +S1130410089582E191E00E947001FBCF4498089511 +S11304200E940E020E946100339BFECF0895EF925A +S1130430FF921F93CF93DF9300D0CDB7DEB7182F71 +S11304409A830E940E020E9461008A810E946300C6 +S1130450F82EE12C812F0E9463009701282BC901FB +S1130460449A8A8399830E9461008A8199810F90BA +S11304700F90DF91CF911F91FF90EF900895CF934C +S1130480DF93EC0184E091E09983888353985B982F +S11304905B9A52985A985A9A1D820E945F00299832 +S11304A00E945F00229A14BC85E085BD84E686BD67 +S11304B017BC18BC81E080936E007894579A569AC2 +S11304C080E00E9479004098389A4198399A449A79 +S11304D00E9461003B9843982FEF80E792E02150FF +S11304E080409040E1F700C0000080EE90EC0E9454 +S11304F0170287ED90E80E9417028BEA92EC0E94A3 +S1130500170281E89AEC0E94170280E090EE0E94A4 +S1130510170280E098EC0E94170287EF94EC0E9487 +S1130520170280E296EA0E94170287E294E90E9489 +S1130530170282E296EC0E94170280E698E90E9474 +S1130540170282E00E94790082E08A83DF91CF91D2 +S1130550089588EC92E80E94170281E89AEC0E94C0 +S1130560170283E89AEC0C94170288E092E80C9442 +S1130570170280E090EB0E9417020895CF93DF9357 +S113058000D01F92CDB7DEB788E392E82B834A836D +S113059069830E9417020E9410028AEA98EB0E9463 +S11305A017020E9410028AEA98EB0E9417020E9426 +S11305B010028AEA98EB0E9417020E9410028DE250 +S11305C098EB0E9417020E94100284ED98EB0E949F +S11305D017020E9410026981862F90E0986B0E9496 +S11305E017020E9410024A81842F90E0986B0E94A7 +S11305F017020E9410022B81822F90E0986B0E94B8 +S113060017020E94100280E098EB0E9417020E94D9 +S1130610100288E092E80E9417022FEF80E792E030 +S1130620215080409040E1F700C000000F900F90EF +S11306300F90DF91CF9108950E940E020E946100F5 +S113064086B183FB882780F991E08927089582E1A8 +S113065091E00C943F02EE0FFF1F0590F491E02D02 +S10906600994F894FFCF99 +S1130666000000008600D200A902B5021C03B902EC +S1050676BE02BE +S9030000FC diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/comunication/.gitignore b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/comunication/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/io/hardware/.gitignore b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/io/hardware/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/makedep.mk b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/makedep.mk new file mode 100644 index 0000000..a5d6ddc --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Debug/makedep.mk @@ -0,0 +1,6 @@ +################################################################################ +# Automatically-generated file. Do not edit or delete the file +################################################################################ + +Zeitschaltung_V6.cpp + diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/FastDelegate.h b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/FastDelegate.h new file mode 100644 index 0000000..d9136f8 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/FastDelegate.h @@ -0,0 +1,2036 @@ +// +// Efficient delegates in C++ that generate only two lines of asm code! +// Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp +// +// - Don Clugston, Mar 2004. +// Major contributions were made by Jody Hagins. +// +// +// Adapted for WinAVR by Lauri Kirikal, Mar 2007. +// +// History: +// 24-Apr-04 1.0 * Submitted to CodeProject. +// 28-Apr-04 1.1 * Prevent most unsafe uses of evil static function hack. +// * Improved syntax for horrible_cast (thanks Paul Bludov). +// * Tested on Metrowerks MWCC and Intel ICL (IA32) +// * Compiled, but not run, on Comeau C++ and Intel Itanium ICL. +// 27-Jun-04 1.2 * Now works on Borland C++ Builder 5.5 +// * Now works on /clr "managed C++" code on VC7, VC7.1 +// * Comeau C++ now compiles without warnings. +// * Prevent the virtual inheritance case from being used on +// VC6 and earlier, which generate incorrect code. +// * Improved warning and error messages. Non-standard hacks +// now have compile-time checks to make them safer. +// * implicit_cast used instead of static_cast in many cases. +// * If calling a const member function, a const class pointer can be used. +// * MakeDelegate() global helper function added to simplify pass-by-value. +// * Added fastdelegate.Clear() +// 16-Jul-04 1.2.1* Workaround for gcc bug (const member function pointers in templates) +// 30-Oct-04 1.3 * Support for (non-void) return values. +// * No more workarounds in client code! +// MSVC and Intel now use a clever hack invented by John Dlugosz: +// - The FASTDELEGATEDECLARE workaround is no longer necessary. +// - No more warning messages for VC6 +// * Less use of macros. Error messages should be more comprehensible. +// * Added include guards +// * Added FastDelegate::Empty() to test if invocation is safe (Thanks Neville Franks). +// * Now tested on VS 2005 Express Beta, PGI C++ +// 24-Dec-04 1.4 * Added DelegateMemento, to allow collections of disparate delegates. +// * <,>,<=,>= comparison operators to allow storage in ordered containers. +// * Substantial reduction of code size, especially the 'Closure' class. +// * Standardised all the compiler-specific workarounds. +// * MFP conversion now works for CodePlay (but not yet supported in the full code). +// * Now compiles without warnings on _any_ supported compiler, including BCC 5.5.1 +// * New syntax: FastDelegate< int (char *, double) >. +// 14-Feb-05 1.4.1* Now treats =0 as equivalent to .Clear(), ==0 as equivalent to .Empty(). (Thanks elfric). +// * Now tested on Intel ICL for AMD64, VS2005 Beta for AMD64 and Itanium. +// 30-Mar-05 1.5 * Safebool idiom: "if (dg)" is now equivalent to "if (!dg.Empty())" +// * Fully supported by CodePlay VectorC +// * Bugfix for Metrowerks: Empty() was buggy because a valid MFP can be 0 on MWCC! +// * More optimal assignment,== and != operators for static function pointers. + +/* + Minor Changes For AVR C++ Lib Compatibility + + STARTS ... +*/ +#ifndef __AVR_CPP_DELEGATE_H__ +#define __AVR_CPP_DELEGATE_H__ + +#if !(defined(EXCLUDE_FAST_DELEGATE) && defined(EXCLUDE_MULTI_DELEGATE) && defined(EXLUDE_DATA_DELEGATE)) + +#ifndef __cplusplus +#error "Delegate.h needs C++ compiler." +#else + +/* + Header file memory.h is missing in WinAVR. + Needed functions are defined in string.h + + Lauri Kirikal +*/ +#ifdef __AVR__ +#include +#else +#include // to allow <,> comparisons +#endif + +/* + ... ENDS + + Lauri Kirikal +*/ + +//////////////////////////////////////////////////////////////////////////////// +// Configuration options +// +//////////////////////////////////////////////////////////////////////////////// + +// Uncomment the following #define for optimally-sized delegates. +// In this case, the generated asm code is almost identical to the code you'd get +// if the compiler had native support for delegates. +// It will not work on systems where sizeof(dataptr) < sizeof(codeptr). +// Thus, it will not work for DOS compilers using the medium model. +// It will also probably fail on some DSP systems. +#define FASTDELEGATE_USESTATICFUNCTIONHACK + +// Uncomment the next line to allow function declarator syntax. +// It is automatically enabled for those compilers where it is known to work. +//#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX + +//////////////////////////////////////////////////////////////////////////////// +// Compiler identification for workarounds +// +//////////////////////////////////////////////////////////////////////////////// + +// Compiler identification. It's not easy to identify Visual C++ because +// many vendors fraudulently define Microsoft's identifiers. +#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__) +#define FASTDLGT_ISMSVC + +#if (_MSC_VER <1300) // Many workarounds are required for VC6. +#define FASTDLGT_VC6 +#pragma warning(disable:4786) // disable this ridiculous warning +#endif + +#endif + +// Does the compiler uses Microsoft's member function pointer structure? +// If so, it needs special treatment. +// Metrowerks CodeWarrior, Intel, and CodePlay fraudulently define Microsoft's +// identifier, _MSC_VER. We need to filter Metrowerks out. +#if defined(_MSC_VER) && !defined(__MWERKS__) +#define FASTDLGT_MICROSOFT_MFP + +#if !defined(__VECTOR_C) +// CodePlay doesn't have the __single/multi/virtual_inheritance keywords +#define FASTDLGT_HASINHERITANCE_KEYWORDS +#endif +#endif + +// Does it allow function declarator syntax? The following compilers are known to work: +#if defined(FASTDLGT_ISMSVC) && (_MSC_VER >=1310) // VC 7.1 +#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX +#endif + +// Gcc(2.95+), and versions of Digital Mars, Intel and Comeau in common use. +#if defined (__DMC__) || defined(__GNUC__) || defined(__ICL) || defined(__COMO__) +#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX +#endif + +// It works on Metrowerks MWCC 3.2.2. From boost.Config it should work on earlier ones too. +#if defined (__MWERKS__) +#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX +#endif + +#ifdef __GNUC__ // Workaround GCC bug #8271 + // At present, GCC doesn't recognize constness of MFPs in templates +#define FASTDELEGATE_GCC_BUG_8271 +#endif + + + +//////////////////////////////////////////////////////////////////////////////// +// General tricks used in this code +// +// (a) Error messages are generated by typdefing an array of negative size to +// generate compile-time errors. +// (b) Warning messages on MSVC are generated by declaring unused variables, and +// enabling the "variable XXX is never used" warning. +// (c) Unions are used in a few compiler-specific cases to perform illegal casts. +// (d) For Microsoft and Intel, when adjusting the 'this' pointer, it's cast to +// (char *) first to ensure that the correct number of *bytes* are added. +// +//////////////////////////////////////////////////////////////////////////////// +// Helper templates +// +//////////////////////////////////////////////////////////////////////////////// + +/* + namespace names modified: + fastdelegate -> CppDelegate + detail -> Internal + + Lauri Kirikal +*/ + +namespace CppDelegate { +namespace Internal { // we'll hide the implementation details in a nested namespace. + +// implicit_cast< > +// I believe this was originally going to be in the C++ standard but +// was left out by accident. It's even milder than static_cast. +// I use it instead of static_cast<> to emphasize that I'm not doing +// anything nasty. +// Usage is identical to static_cast<> +template +inline OutputClass implicit_cast(InputClass input){ + return input; +} + +// horrible_cast< > +// This is truly evil. It completely subverts C++'s type system, allowing you +// to cast from any class to any other class. Technically, using a union +// to perform the cast is undefined behaviour (even in C). But we can see if +// it is OK by checking that the union is the same size as each of its members. +// horrible_cast<> should only be used for compiler-specific workarounds. +// Usage is identical to reinterpret_cast<>. + +// This union is declared outside the horrible_cast because BCC 5.5.1 +// can't inline a function with a nested class, and gives a warning. +template +union horrible_union{ + OutputClass out; + InputClass in; +}; + +template +inline OutputClass horrible_cast(const InputClass input){ + horrible_union u; + // Cause a compile-time error if in, out and u are not the same size. + // If the compile fails here, it means the compiler has peculiar + // unions which would prevent the cast from working. + typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u) + && sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1]; + u.in = input; + return u.out; +} + +//////////////////////////////////////////////////////////////////////////////// +// Workarounds +// +//////////////////////////////////////////////////////////////////////////////// + +// Backwards compatibility: This macro used to be necessary in the virtual inheritance +// case for Intel and Microsoft. Now it just forward-declares the class. +#define FASTDELEGATEDECLARE(CLASSNAME) class CLASSNAME; + +// Prevent use of the static function hack with the DOS medium model. +#ifdef __MEDIUM__ +#undef FASTDELEGATE_USESTATICFUNCTIONHACK +#endif + +// DefaultVoid - a workaround for 'void' templates in VC6. +// +// (1) VC6 and earlier do not allow 'void' as a default template argument. +// (2) They also doesn't allow you to return 'void' from a function. +// +// Workaround for (1): Declare a dummy type 'DefaultVoid' which we use +// when we'd like to use 'void'. We convert it into 'void' and back +// using the templates DefaultVoidToVoid<> and VoidToDefaultVoid<>. +// Workaround for (2): On VC6, the code for calling a void function is +// identical to the code for calling a non-void function in which the +// return value is never used, provided the return value is returned +// in the EAX register, rather than on the stack. +// This is true for most fundamental types such as int, enum, void *. +// Const void * is the safest option since it doesn't participate +// in any automatic conversions. But on a 16-bit compiler it might +// cause extra code to be generated, so we disable it for all compilers +// except for VC6 (and VC5). +#ifdef FASTDLGT_VC6 +// VC6 workaround +typedef const void * DefaultVoid; +#else +// On any other compiler, just use a normal void. +typedef void DefaultVoid; +#endif + +// Translate from 'DefaultVoid' to 'void'. +// Everything else is unchanged +template +struct DefaultVoidToVoid { typedef T type; }; + +template <> +struct DefaultVoidToVoid { typedef void type; }; + +// Translate from 'void' into 'DefaultVoid' +// Everything else is unchanged +template +struct VoidToDefaultVoid { typedef T type; }; + +template <> +struct VoidToDefaultVoid { typedef DefaultVoid type; }; + + + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 1: +// +// Conversion of member function pointer to a standard form +// +//////////////////////////////////////////////////////////////////////////////// + +// GenericClass is a fake class, ONLY used to provide a type. +// It is vitally important that it is never defined, so that the compiler doesn't +// think it can optimize the invocation. For example, Borland generates simpler +// code if it knows the class only uses single inheritance. + +// Compilers using Microsoft's structure need to be treated as a special case. +#ifdef FASTDLGT_MICROSOFT_MFP + +#ifdef FASTDLGT_HASINHERITANCE_KEYWORDS + // For Microsoft and Intel, we want to ensure that it's the most efficient type of MFP + // (4 bytes), even when the /vmg option is used. Declaring an empty class + // would give 16 byte pointers in this case.... + class __single_inheritance GenericClass; +#endif + // ...but for Codeplay, an empty class *always* gives 4 byte pointers. + // If compiled with the /clr option ("managed C++"), the JIT compiler thinks + // it needs to load GenericClass before it can call any of its functions, + // (compiles OK but crashes at runtime!), so we need to declare an + // empty class to make it happy. + // Codeplay and VC4 can't cope with the unknown_inheritance case either. + class GenericClass {}; +#else + class GenericClass; +#endif + +// The size of a single inheritance member function pointer. +const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)()); + +// SimplifyMemFunc< >::Convert() +// +// A template function that converts an arbitrary member function pointer into the +// simplest possible form of member function pointer, using a supplied 'this' pointer. +// According to the standard, this can be done legally with reinterpret_cast<>. +// For (non-standard) compilers which use member function pointers which vary in size +// depending on the class, we need to use knowledge of the internal structure of a +// member function pointer, as used by the compiler. Template specialization is used +// to distinguish between the sizes. Because some compilers don't support partial +// template specialisation, I use full specialisation of a wrapper struct. + +// general case -- don't know how to convert it. Force a compile failure +template +struct SimplifyMemFunc { + template + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + // Unsupported member function type -- force a compile failure. + // (it's illegal to have a array with negative size). + typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100]; + return 0; + } +}; + +// For compilers where all member func ptrs are the same size, everything goes here. +// For non-standard compilers, only single_inheritance classes go here. +template <> +struct SimplifyMemFunc { + template + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { +#if defined __DMC__ + // Digital Mars doesn't allow you to cast between abitrary PMF's, + // even though the standard says you can. The 32-bit compiler lets you + // static_cast through an int, but the DOS compiler doesn't. + bound_func = horrible_cast(function_to_bind); +#else + bound_func = reinterpret_cast(function_to_bind); +#endif + return reinterpret_cast(pthis); + } +}; + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 1b: +// +// Workarounds for Microsoft and Intel +// +//////////////////////////////////////////////////////////////////////////////// + + +// Compilers with member function pointers which violate the standard (MSVC, Intel, Codeplay), +// need to be treated as a special case. +#ifdef FASTDLGT_MICROSOFT_MFP + +/* + ... ERASED for shorter compiling time ... + + Lauri Kirikal +*/ + +#error "MSVC, Intel, Codeplay compilers support erased from this file." + +#endif // MS/Intel hacks + +} // namespace Internal + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 2: +// +// Define the delegate storage, and cope with static functions +// +//////////////////////////////////////////////////////////////////////////////// + +// DelegateMemento -- an opaque structure which can hold an arbitary delegate. +// It knows nothing about the calling convention or number of arguments used by +// the function pointed to. +// It supplies comparison operators so that it can be stored in STL collections. +// It cannot be set to anything other than null, nor invoked directly: +// it must be converted to a specific delegate. + +// Implementation: +// There are two possible implementations: the Safe method and the Evil method. +// DelegateMemento - Safe version +// +// This implementation is standard-compliant, but a bit tricky. +// A static function pointer is stored inside the class. +// Here are the valid values: +// +-- Static pointer --+--pThis --+-- pMemFunc-+-- Meaning------+ +// | 0 | 0 | 0 | Empty | +// | !=0 |(dontcare)| Invoker | Static function| +// | 0 | !=0 | !=0* | Method call | +// +--------------------+----------+------------+----------------+ +// * For Metrowerks, this can be 0. (first virtual function in a +// single_inheritance class). +// When stored stored inside a specific delegate, the 'dontcare' entries are replaced +// with a reference to the delegate itself. This complicates the = and == operators +// for the delegate class. + +// DelegateMemento - Evil version +// +// For compilers where data pointers are at least as big as code pointers, it is +// possible to store the function pointer in the this pointer, using another +// horrible_cast. In this case the DelegateMemento implementation is simple: +// +--pThis --+-- pMemFunc-+-- Meaning---------------------+ +// | 0 | 0 | Empty | +// | !=0 | !=0* | Static function or method call| +// +----------+------------+-------------------------------+ +// * For Metrowerks, this can be 0. (first virtual function in a +// single_inheritance class). +// Note that the Sun C++ and MSVC documentation explicitly state that they +// support static_cast between void * and function pointers. + +/* + DelegateMemento moved from CppDelegate namespace to CppDelegate::Internal namespace + + Lauri Kirikal +*/ +namespace Internal +{ +class DelegateMemento { +protected: + // the data is protected, not private, because many + // compilers have problems with template friends. + typedef void (Internal::GenericClass::*GenericMemFuncType)(); // arbitrary MFP. + Internal::GenericClass *m_pthis; + GenericMemFuncType m_pFunction; + +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + typedef void (*GenericFuncPtr)(); // arbitrary code pointer + GenericFuncPtr m_pStaticFunction; +#endif + +public: +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + DelegateMemento() : m_pthis(0), m_pFunction(0), m_pStaticFunction(0) {}; + void Clear() { + m_pthis=0; m_pFunction=0; m_pStaticFunction=0; + } +#else + DelegateMemento() : m_pthis(0), m_pFunction(0) {}; + void Clear() { m_pthis=0; m_pFunction=0; } +#endif +public: +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + inline bool IsEqual (const DelegateMemento &x) const{ + // We have to cope with the static function pointers as a special case + if (m_pFunction!=x.m_pFunction) return false; + // the static function ptrs must either both be equal, or both be 0. + if (m_pStaticFunction!=x.m_pStaticFunction) return false; + if (m_pStaticFunction!=0) return m_pthis==x.m_pthis; + else return true; + } +#else // Evil Method + inline bool IsEqual (const DelegateMemento &x) const{ + return m_pthis==x.m_pthis && m_pFunction==x.m_pFunction; + } +#endif + // Provide a strict weak ordering for DelegateMementos. + inline bool IsLess(const DelegateMemento &right) const { + // deal with static function pointers first +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0) + return m_pStaticFunction < right.m_pStaticFunction; +#endif + if (m_pthis !=right.m_pthis) return m_pthis < right.m_pthis; + // There are no ordering operators for member function pointers, + // but we can fake one by comparing each byte. The resulting ordering is + // arbitrary (and compiler-dependent), but it permits storage in ordered STL containers. + return memcmp(&m_pFunction, &right.m_pFunction, sizeof(m_pFunction)) < 0; + + } + // BUGFIX (Mar 2005): + // We can't just compare m_pFunction because on Metrowerks, + // m_pFunction can be zero even if the delegate is not empty! + inline bool operator ! () const // Is it bound to anything? + { return m_pthis==0 && m_pFunction==0; } + inline bool Empty() const // Is it bound to anything? + { return m_pthis==0 && m_pFunction==0; } +public: + DelegateMemento & operator = (const DelegateMemento &right) { + SetMementoFrom(right); + return *this; + } + inline bool operator <(const DelegateMemento &right) { + return IsLess(right); + } + inline bool operator >(const DelegateMemento &right) { + return right.IsLess(*this); + } + DelegateMemento (const DelegateMemento &right) : + m_pthis(right.m_pthis), m_pFunction(right.m_pFunction) +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + , m_pStaticFunction (right.m_pStaticFunction) +#endif + {} +protected: + void SetMementoFrom(const DelegateMemento &right) { + m_pFunction = right.m_pFunction; + m_pthis = right.m_pthis; +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = right.m_pStaticFunction; +#endif + } +}; +} // namespace Internal + +// ClosurePtr<> +// +// A private wrapper class that adds function signatures to DelegateMemento. +// It's the class that does most of the actual work. +// The signatures are specified by: +// GenericMemFunc: must be a type of GenericClass member function pointer. +// StaticFuncPtr: must be a type of function pointer with the same signature +// as GenericMemFunc. +// UnvoidStaticFuncPtr: is the same as StaticFuncPtr, except on VC6 +// where it never returns void (returns DefaultVoid instead). + +// An outer class, FastDelegateN<>, handles the invoking and creates the +// necessary typedefs. +// This class does everything else. + +namespace Internal { + +template < class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr> +class ClosurePtr : public DelegateMemento { +public: + // These functions are for setting the delegate to a member function. + + // Here's the clever bit: we convert an arbitrary member function into a + // standard form. XMemFunc should be a member function of class X, but I can't + // enforce that here. It needs to be enforced by the wrapper class. + template < class X, class XMemFunc > + inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) { + m_pthis = SimplifyMemFunc< sizeof(function_to_bind) > + ::Convert(pthis, function_to_bind, m_pFunction); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } + // For const member functions, we only need a const class pointer. + // Since we know that the member function is const, it's safe to + // remove the const qualifier from the 'this' pointer with a const_cast. + // VC6 has problems if we just overload 'bindmemfunc', so we give it a different name. + template < class X, class XMemFunc> + inline void bindconstmemfunc(const X *pthis, XMemFunc function_to_bind) { + m_pthis= SimplifyMemFunc< sizeof(function_to_bind) > + ::Convert(const_cast(pthis), function_to_bind, m_pFunction); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } +#ifdef FASTDELEGATE_GCC_BUG_8271 // At present, GCC doesn't recognize constness of MFPs in templates + template < class X, class XMemFunc> + inline void bindmemfunc(const X *pthis, XMemFunc function_to_bind) { + bindconstmemfunc(pthis, function_to_bind); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } +#endif + // These functions are required for invoking the stored function + inline GenericClass *GetClosureThis() const { return m_pthis; } + inline GenericMemFunc GetClosureMemPtr() const { return reinterpret_cast(m_pFunction); } + +// There are a few ways of dealing with static function pointers. +// There's a standard-compliant, but tricky method. +// There's also a straightforward hack, that won't work on DOS compilers using the +// medium memory model. It's so evil that I can't recommend it, but I've +// implemented it anyway because it produces very nice asm code. + +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + +// ClosurePtr<> - Safe version +// +// This implementation is standard-compliant, but a bit tricky. +// I store the function pointer inside the class, and the delegate then +// points to itself. Whenever the delegate is copied, these self-references +// must be transformed, and this complicates the = and == operators. +public: + // The next two functions are for operator ==, =, and the copy constructor. + // We may need to convert the m_pthis pointers, so that + // they remain as self-references. + template< class DerivedClass > + inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &x) { + SetMementoFrom(x); + if (m_pStaticFunction!=0) { + // transform self references... + m_pthis=reinterpret_cast(pParent); + } + } + // For static functions, the 'static_function_invoker' class in the parent + // will be called. The parent then needs to call GetStaticFunction() to find out + // the actual function to invoke. + template < class DerivedClass, class ParentInvokerSig > + inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker, + StaticFuncPtr function_to_bind ) { + if (function_to_bind==0) { // cope with assignment to 0 + m_pFunction=0; + } else { + bindmemfunc(pParent, static_function_invoker); + } + m_pStaticFunction=reinterpret_cast(function_to_bind); + } + inline UnvoidStaticFuncPtr GetStaticFunction() const { + return reinterpret_cast(m_pStaticFunction); + } +#else + +// ClosurePtr<> - Evil version +// +// For compilers where data pointers are at least as big as code pointers, it is +// possible to store the function pointer in the this pointer, using another +// horrible_cast. Invocation isn't any faster, but it saves 4 bytes, and +// speeds up comparison and assignment. If C++ provided direct language support +// for delegates, they would produce asm code that was almost identical to this. +// Note that the Sun C++ and MSVC documentation explicitly state that they +// support static_cast between void * and function pointers. + + template + inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) { + SetMementoFrom(right); + } + // For static functions, the 'static_function_invoker' class in the parent + // will be called. The parent then needs to call GetStaticFunction() to find out + // the actual function to invoke. + // ******** EVIL, EVIL CODE! ******* + template + inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker, + StaticFuncPtr function_to_bind) { + if (function_to_bind==0) { // cope with assignment to 0 + m_pFunction=0; + } else { + // We'll be ignoring the 'this' pointer, but we need to make sure we pass + // a valid value to bindmemfunc(). + bindmemfunc(pParent, static_function_invoker); + } + + // WARNING! Evil hack. We store the function in the 'this' pointer! + // Ensure that there's a compilation failure if function pointers + // and data pointers have different sizes. + // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK. + typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1]; + m_pthis = horrible_cast(function_to_bind); + // MSVC, SunC++ and DMC accept the following (non-standard) code: + // m_pthis = static_cast(static_cast(function_to_bind)); + // BCC32, Comeau and DMC accept this method. MSVC7.1 needs __int64 instead of long + // m_pthis = reinterpret_cast(reinterpret_cast(function_to_bind)); + } + // ******** EVIL, EVIL CODE! ******* + // This function will be called with an invalid 'this' pointer!! + // We're just returning the 'this' pointer, converted into + // a function pointer! + inline UnvoidStaticFuncPtr GetStaticFunction() const { + // Ensure that there's a compilation failure if function pointers + // and data pointers have different sizes. + // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK. + typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1]; + return horrible_cast(this); + } +#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + + // Does the closure contain this static function? + inline bool IsEqualToStaticFuncPtr(StaticFuncPtr funcptr){ + if (funcptr==0) return Empty(); + // For the Evil method, if it doesn't actually contain a static function, this will return an arbitrary + // value that is not equal to any valid function pointer. + else return funcptr==reinterpret_cast(GetStaticFunction()); + } +}; + + +} // namespace Internal + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 3: +// +// Wrapper classes to ensure type safety +// +//////////////////////////////////////////////////////////////////////////////// + + +// Once we have the member function conversion templates, it's easy to make the +// wrapper classes. So that they will work with as many compilers as possible, +// the classes are of the form +// FastDelegate3 +// They can cope with any combination of parameters. The max number of parameters +// allowed is 8, but it is trivial to increase this limit. +// Note that we need to treat const member functions seperately. +// All this class does is to enforce type safety, and invoke the delegate with +// the correct list of parameters. + +// Because of the weird rule about the class of derived member function pointers, +// you sometimes need to apply a downcast to the 'this' pointer. +// This is the reason for the use of "implicit_cast(pthis)" in the code below. +// If CDerivedClass is derived from CBaseClass, but doesn't override SimpleVirtualFunction, +// without this trick you'd need to write: +// MyDelegate(static_cast(&d), &CDerivedClass::SimpleVirtualFunction); +// but with the trick you can write +// MyDelegate(&d, &CDerivedClass::SimpleVirtualFunction); + +// RetType is the type the compiler uses in compiling the template. For VC6, +// it cannot be void. DesiredRetType is the real type which is returned from +// all of the functions. It can be void. + +// Implicit conversion to "bool" is achieved using the safe_bool idiom, +// using member data pointers (MDP). This allows "if (dg)..." syntax +// Because some compilers (eg codeplay) don't have a unique value for a zero +// MDP, an extra padding member is added to the SafeBool struct. +// Some compilers (eg VC6) won't implicitly convert from 0 to an MDP, so +// in that case the static function constructor is not made explicit; this +// allows "if (dg==0) ..." to compile. + + +/* + Member function names modified: + bind -> Bind + empty -> IsEmpty + clear -> Clear + + Functions GetMemento and SetMemento: public -> protected + + Lauri Kirikal +*/ + +// N=0 +template +class FastDelegate0 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(); + typedef RetType (*UnvoidStaticFunctionPtr)(); + typedef RetType (Internal::GenericClass::*GenericMemFn)(); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate0 type; + + // Construction and comparison functions + FastDelegate0() { Clear(); } + FastDelegate0(const FastDelegate0 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate0 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate0 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate0 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate0 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate0 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate0(Y *pthis, DesiredRetType (X::* function_to_bind)() ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)()) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate0(const Y *pthis, DesiredRetType (X::* function_to_bind)() const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)() const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate0(DesiredRetType (*function_to_bind)() ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)() ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)()) { + m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType Invoke() const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(); } + inline RetType operator() () const { + return Invoke(); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear(); } +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } +private: // Invoker for static functions + RetType InvokeStaticFunction() const { + return (*(m_Closure.GetStaticFunction()))(); } +}; + +// N=1 +template +class FastDelegate1 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate1 type; + + // Construction and comparison functions + FastDelegate1() { Clear(); } + FastDelegate1(const FastDelegate1 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate1 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate1 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate1 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate1 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate1 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate1(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate1(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate1(DesiredRetType (*function_to_bind)(Param1 p1) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1)) { + m_Closure.bindstaticfunc(this, &FastDelegate1::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType Invoke(Param1 p1) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1); } + inline RetType operator() (Param1 p1) const { + return Invoke(p1); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear(); } +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1) const { + return (*(m_Closure.GetStaticFunction()))(p1); } +}; + +//N=2 +template +class FastDelegate2 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate2 type; + + // Construction and comparison functions + FastDelegate2() { Clear(); } + FastDelegate2(const FastDelegate2 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate2 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate2 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate2 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate2 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate2 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate2(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate2(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) { + m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2); } +}; + +//N=3 +template +class FastDelegate3 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate3 type; + + // Construction and comparison functions + FastDelegate3() { Clear(); } + FastDelegate3(const FastDelegate3 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate3 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate3 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate3 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate3 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate3 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate3(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate3(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate3(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) { + m_Closure.bindstaticfunc(this, &FastDelegate3::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3); } +}; + +//N=4 +template +class FastDelegate4 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate4 type; + + // Construction and comparison functions + FastDelegate4() { Clear(); } + FastDelegate4(const FastDelegate4 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate4 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate4 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate4 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate4 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate4 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate4(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate4(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate4(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) { + m_Closure.bindstaticfunc(this, &FastDelegate4::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4); } +}; + +//N=5 +template +class FastDelegate5 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate5 type; + + // Construction and comparison functions + FastDelegate5() { Clear(); } + FastDelegate5(const FastDelegate5 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate5 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate5 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate5 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate5 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate5 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate5(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate5(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate5(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) { + m_Closure.bindstaticfunc(this, &FastDelegate5::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5); } +}; + +//N=6 +template +class FastDelegate6 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate6 type; + + // Construction and comparison functions + FastDelegate6() { Clear(); } + FastDelegate6(const FastDelegate6 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate6 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate6 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate6 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate6 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate6 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate6(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate6(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate6(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) { + m_Closure.bindstaticfunc(this, &FastDelegate6::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6); } +}; + +//N=7 +template +class FastDelegate7 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate7 type; + + // Construction and comparison functions + FastDelegate7() { Clear(); } + FastDelegate7(const FastDelegate7 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate7 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate7 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate7 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate7 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate7 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate7(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate7(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate7(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) { + m_Closure.bindstaticfunc(this, &FastDelegate7::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7); } +}; + +//N=8 +template +class FastDelegate8 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate8 type; + + // Construction and comparison functions + FastDelegate8() { Clear(); } + FastDelegate8(const FastDelegate8 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate8 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate8 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate8 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate8 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate8 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate8(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate8(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate8(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) { + m_Closure.bindstaticfunc(this, &FastDelegate8::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8); } +}; + +/* + ... part 4, part 5 ERASED ... + + And now on only AVR-specific code with GPL license + + Lauri Kirikal + */ + +/**********************************************************************************************************************\ + + C++ library for Atmel AVR microcontrollers + Copyright (C) 2007 Lauri Kirikal, Mikk Leini, MTÜ TTÜ Robotiklubi + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + See http://creativecommons.org/licenses/GPL/2.0/ + + MTÜ TTÜ Robotiklubi http://www.robotiklubi.ee robotiklubi@gmail.com + Lauri Kirikal laurikirikal@gmail.com + Mikk Leini mikk.leini@gmail.com + +\**********************************************************************************************************************/ + +#ifndef EXCLUDE_FAST_DELEGATE + typedef FastDelegate0 FastDelegate; +#endif + +#if !defined(EXCLUDE_DATA_DELEGATE) || !defined(EXCLUDE_MULTI_DELEGATE) + + namespace Internal + { + template bool AddFastDelegate(Delegate &delegate, FastDelegate &addable) + { + + if (!delegate.me) + { + delegate.me = addable; + } + else + { + if (delegate.next == NULL) + { + delegate.next = new Delegate(addable); + if (delegate.next == NULL) return false; + } + else + { + return delegate.next->Add(addable); + } + } + + return true; + + } // AddFastDelegate + + template bool AddFunction(Delegate &delegate, Function function) + { + if (!delegate.me) + { + delegate.me.Bind(function); + } + else + { + if (delegate.next == NULL) + { + delegate.next = new Delegate(function); + if (delegate.next == NULL) return false; + } + else + { + return delegate.next->Add(function); + } + } + + return true; + + } // AddFunction + + template + bool AddMemberFunction(Delegate &delegate, Object *object, MemberFunction function) + { + if (!delegate.me) + { + delegate.me.Bind(object, function); + } + else + { + if (delegate.next == NULL) + { + delegate.next = new Delegate(object, function); + if (delegate.next == NULL) return false; + } + else + { + return delegate.next->Add(object, function); + } + } + + return true; + + } // AddMemberFunction + + template bool RemoveAll(Delegate &delegate, FastDelegate &removable) + { + if (removable == delegate.me) + { + if (delegate.next == NULL) + { + delegate.me.Clear(); + } + else + { + Delegate *cutOut, *cutOutNext = delegate.next; + + while (cutOutNext->me == removable) + { + cutOut = cutOutNext; + cutOutNext = cutOut->next; + + delete cutOut; + + if (cutOutNext == NULL) + { + delegate.next = NULL; + delegate.me.Clear(); + return true; + } + } + + delegate.me = cutOutNext->me; + delegate.next = cutOutNext->next; + + delete cutOutNext; + + if (delegate.next != NULL) + delegate.next->RemoveAll(removable); + + } + } + else + { + if (delegate.next == NULL) + return false; + else + return delegate.next->RemoveAll(removable); + } + + return true; + + } // RemoveAll + + template bool Remove(Delegate &delegate, FastDelegate &removable) + { + if (removable == delegate.me) + { + if (delegate.next == NULL) + { + delegate.me.Clear(); + } + else + { + Delegate *cutOut = delegate.next; + + delegate.me = cutOut->me; + delegate.next = cutOut->next; + + delete cutOut; + } + } + else + { + if (delegate.next == NULL) + return false; + else + return delegate.next->Remove(removable); + } + + return true; + + } // Remove + + template void Clear(Delegate &delegate) + { + if (delegate.next != NULL) + { + delegate.next->Clear(); + delete delegate.next; + delegate.next = NULL; + } + delegate.me.Clear(); + + } // Clear + + } // namespace Internal + +#endif // if !defined(EXCLUDE_DATA_DELEGATE) || !defined(EXCLUDE_MULTI_DELEGATE) + +#ifndef EXCLUDE_DATA_DELEGATE + + template class DelegateController; + + template class DataDelegate + { + public: + + typedef void (*Function)(Controller &); + typedef FastDelegate1 FastDelegate; + + private: + + friend class DelegateController; + template friend bool Internal::AddFastDelegate(Delegate &delegate, FastDelegate &addable); + template friend bool Internal::AddFunction(Delegate &delegate, Function function); + template friend bool Internal::AddMemberFunction(Delegate &delegate, Object *object, MemberFunction function); + template friend bool Internal::RemoveAll(Delegate &delegate, FastDelegate &removable); + template friend bool Internal::Remove(Delegate &delegate, FastDelegate &removable); + template friend void Internal::Clear(Delegate &delegate); + + DataDelegate * next; + FastDelegate me; + + DataDelegate() : next(NULL), me() {} + DataDelegate(Function function) : next(NULL), me(function) {} + DataDelegate(const FastDelegate &_me) : next(NULL), me(_me) {} + template DataDelegate(X *object, void (Y::* function)(Controller &) ) : next(NULL), me(object, function) {} + template DataDelegate(const X *object, void (Y::* function)(Controller &) const) : next(NULL), me(object, function) {} + + void Invoke(Controller &controller) const + { + if (!me.IsEmpty() ) + { + me(controller); + if (next != NULL) next->Invoke(controller); + } + + } // OPERATOR () + + inline void operator() (Controller &controller) const { Invoke(controller); } + + public: + + inline bool Add(FastDelegate &addable) + { + return Internal::AddFastDelegate, FastDelegate>(*this, addable); + + } // Add 1 + + inline bool Add(Function function) + { + return Internal::AddFunction, Function>(*this, function); + + } // Add 2 + + template inline bool Add(X *object, void (Y::* function)(Controller &) ) + { + return Internal::AddMemberFunction, X, void (Y::*)(Controller &)>(*this, object, function); + + } // Add 3 + + template inline bool Add(const X *object, void (Y::* function)(Controller &) const) + { + return Internal::AddMemberFunction, const X, void (Y::*)(Controller &) const>(*this, object, function); + + } // Add 4 + + inline bool RemoveAll(FastDelegate &removable) + { + return Internal::RemoveAll, Function>(*this, removable); + + } // RemoveAll 1 + + inline bool RemoveAll(Function function) + { + FastDelegate removable(function); + + return RemoveAll(removable); + + } // RemoveAll 2 + + template inline bool RemoveAll(X *object, void (Y::* function)(Controller &) ) + { + FastDelegate removable(object, function); + + return RemoveAll(removable); + + } // RemoveAll 3 + + template inline bool RemoveAll(const X *object, void (Y::* function)(Controller &) const) + { + FastDelegate removable(object, function); + + return RemoveAll(removable); + + } // RemoveAll 4 + + inline bool Remove(FastDelegate &removable) + { + return Internal::Remove, FastDelegate>(*this, removable); + + } // Remove 1 + + inline bool Remove(Function function) + { + FastDelegate removable(function); + + return Remove(removable); + + } // Remove 2 + + template inline bool Remove(X *object, void (Y::* function)(Controller &) ) + { + FastDelegate removable(object, function); + + return Remove(removable); + + } // Remove 3 + + template inline bool Remove(const X *object, void (Y::* function)(Controller &) const) + { + FastDelegate removable(object, function); + + return Remove(removable); + + } // Remove 4 + + inline void Clear() { Internal::Clear >(*this); } + inline bool IsEmpty() { return !me; } + inline bool operator ! () { return IsEmpty(); } + inline bool operator += (Function function) { return Add(function); } + inline bool operator += (FastDelegate &addable) { return Add(addable); } + inline bool operator -= (Function function) { return Remove(function); } + inline bool operator -= (FastDelegate &removable) { return Remove(removable); } + + ~DataDelegate() { Clear(); } + + }; // class DataDelegate + + + template class DelegateController + { + protected: + + virtual bool Before() = 0; + virtual void After() {}; + + private: + + DataDelegate dataDelegate; + + public: + + DelegateController() : dataDelegate() {} + DataDelegate &Delegate() { return dataDelegate; } + + void Invoke() + { + if (Before() ) + { + dataDelegate(*((Derived *)this)); + After(); + } + + } // operator () + + inline void operator() () { Invoke(); } + virtual ~DelegateController() {} + + }; // class DelegateController + +#endif // ifndef EXCLUDE_DATA_DELEGATE + +#ifndef EXCLUDE_MULTI_DELEGATE + + class MultiDelegate + { + public: + + typedef void (*Function)(void); + typedef FastDelegate0<> FastDelegate; + + private: + + MultiDelegate * next; + FastDelegate me; + + template friend bool Internal::AddFastDelegate(Delegate &delegate, FastDelegate &addable); + template friend bool Internal::AddFunction(Delegate &delegate, Function function); + template friend bool Internal::AddMemberFunction(Delegate &delegate, Object *object, MemberFunction function); + template friend bool Internal::RemoveAll(Delegate &delegate, FastDelegate &removable); + template friend bool Internal::Remove(Delegate &delegate, FastDelegate &removable); + template friend void Internal::Clear(Delegate &delegate); + + public: + + MultiDelegate() : next(NULL), me() {} + MultiDelegate(Function function) : next(NULL), me(function) {} + MultiDelegate(const FastDelegate &_me) : next(NULL), me(_me) {} + template MultiDelegate(X *object, void (Y::* function)() ) : next(NULL), me(object, function) {} + template MultiDelegate(const X *object, void (Y::* function)() const) : next(NULL), me(object, function) {} + + void Invoke() const + { + if (!me.IsEmpty() ) + { + me(); + if (next != NULL) next->Invoke(); + } + + } // OPERATOR () + + inline bool Add(FastDelegate &addable) + { + return Internal::AddFastDelegate(*this, addable); + + } // Add 1 + + inline bool Add(Function function) + { + return Internal::AddFunction(*this, function); + + } // Add 2 + + template inline bool Add(X *object, void (Y::* function)() ) + { + return Internal::AddMemberFunction(*this, object, function); + + } // Add 3 + + template inline bool Add(const X *object, void (Y::* function)() const) + { + return Internal::AddMemberFunction(*this, object, function); + + } // Add 4 + + inline bool RemoveAll(FastDelegate &removable) + { + return Internal::RemoveAll(*this, removable); + + } // RemoveAll 1 + + inline bool RemoveAll(Function function) + { + FastDelegate removable(function); + + return RemoveAll(removable); + + } // RemoveAll 2 + + template inline bool RemoveAll(X *object, void (Y::* function)() ) + { + FastDelegate removable(object, function); + + return RemoveAll(removable); + + } // RemoveAll 3 + + template inline bool RemoveAll(const X *object, void (Y::* function)() const) + { + return RemoveAll(object, (void (Y::*)(void))function); + + } // RemoveAll 4 + + inline bool Remove(FastDelegate &removable) + { + return Internal::Remove(*this, removable); + + } // Remove 1 + + inline bool Remove(Function function) + { + FastDelegate removable(function); + + return Remove(removable); + + } // Remove 2 + + template inline bool Remove(X *object, void (Y::* function)() ) + { + FastDelegate removable(object, function); + + return Remove(removable); + + } // Remove 3 + + template inline bool Remove(const X *object, void (Y::* function)() const) + { + return Remove(object, (void (Y::*)(void))function); + + } // Remove 4 + + inline void Clear() { Internal::Clear(*this); } + inline bool IsEmpty() const { return !me; } + inline void operator() () const { Invoke(); } + inline bool operator ! () const { return IsEmpty(); } + inline bool operator += (Function function) { return Add(function); } + inline bool operator += (FastDelegate &addable) { return Add(addable); } + inline bool operator -= (Function function) { return Remove(function); } + inline bool operator -= (FastDelegate &removable) { return Remove(removable); } + ~MultiDelegate() { Clear(); } + + }; // class MultiDelegate + +#endif // ifndef EXCLUDE_MULTI_DELEGATE + + // clean up after ourselves... +#undef FASTDLGT_RETTYPE + +} // namespace CppDelegate + +#endif // ifdef __cplusplus +#endif // if !(defined(EXCLUDE_FAST_DELEGATE) && defined(EXCLUDE_MULTI_DELEGATE) && defined(EXLUDE_DATA_DELEGATE)) +#endif // ifndef __AVR_CPP_DELEGATE_H__ + diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Makefile b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Makefile new file mode 100644 index 0000000..ef08fe1 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Makefile @@ -0,0 +1,128 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +SHELL := cmd.exe +RM := rm -rf + +USER_OBJS := + +LIBS := +PROJ := + +O_SRCS := +C_SRCS := +S_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +PREPROCESSING_SRCS := +OBJS := +OBJS_AS_ARGS := +C_DEPS := +C_DEPS_AS_ARGS := +EXECUTABLES := +OUTPUT_FILE_PATH := +OUTPUT_FILE_PATH_AS_ARGS := +AVR_APP_PATH :=$$$AVR_APP_PATH$$$ +QUOTE := " +ADDITIONAL_DEPENDENCIES:= +OUTPUT_FILE_DEP:= +LIB_DEP:= + +# Every subdirectory with source files must be described here +SUBDIRS := \ +../io \ +../io/hardware + + +# Add inputs and outputs from these tool invocations to the build variables +C_SRCS += \ +../Zeitschaltung_V6.cpp + + +PREPROCESSING_SRCS += + + +ASM_SRCS += + + +OBJS += \ +Zeitschaltung_V6.o + + +OBJS_AS_ARGS += \ +Zeitschaltung_V6.o + + +C_DEPS += \ +Zeitschaltung_V6.d + + +C_DEPS_AS_ARGS += \ +Zeitschaltung_V6.d + + +OUTPUT_FILE_PATH +=Zeitschaltung_V6.elf + +OUTPUT_FILE_PATH_AS_ARGS +=Zeitschaltung_V6.elf + +ADDITIONAL_DEPENDENCIES:= + +OUTPUT_FILE_DEP:= ./makedep.mk + +LIB_DEP+= + +# AVR32/GNU C Compiler + + + +./%.o: .././%.cpp + @echo Building file: $< + @echo Invoking: AVR8/GNU C++ Compiler : + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-g++.exe$(QUOTE) -funsigned-char -funsigned-bitfields -DNDEBUG -Os -ffunction-sections -fpack-struct -fshort-enums -Wall -Wundef -Werror -pedantic -pedantic-errors -mmcu=atmega168a -c -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" + @echo Finished building: $< + + + +# AVR32/GNU Preprocessing Assembler + + + +# AVR32/GNU Assembler + + + + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +endif + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) + +$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) + @echo Building target: $@ + @echo Invoking: AVR8/GNU Linker : + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-g++.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="Zeitschaltung_V6.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega168a + @echo Finished building target: $@ + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "Zeitschaltung_V6.elf" "Zeitschaltung_V6.hex" + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "Zeitschaltung_V6.elf" "Zeitschaltung_V6.eep" || exit 0 + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "Zeitschaltung_V6.elf" > "Zeitschaltung_V6.lss" + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "Zeitschaltung_V6.elf" "Zeitschaltung_V6.srec" + "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-size.exe" "Zeitschaltung_V6.elf" + + + + + + +# Other Targets +clean: + -$(RM) $(OBJS_AS_ARGS)$(C_DEPS_AS_ARGS) $(EXECUTABLES) + rm -rf "Zeitschaltung_V6.elf" "Zeitschaltung_V6.a" "Zeitschaltung_V6.hex" "Zeitschaltung_V6.lss" "Zeitschaltung_V6.eep" "Zeitschaltung_V6.map" "Zeitschaltung_V6.srec" + \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/rf12.d b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.d similarity index 91% rename from V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/rf12.d rename to V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.d index 43ad676..542ec52 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/rf12.d +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.d @@ -1,4 +1,5 @@ -rf12.d rf12.o: .././rf12.c \ +Zeitschaltung_V6.d Zeitschaltung_V6.o: .././Zeitschaltung_V6.cpp \ + .././config.h .././peripheral.h .././io/hardware/portd.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 \ @@ -12,11 +13,18 @@ rf12.d rf12.o: .././rf12.c \ 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 \ - .././rf12.h .././global.h .././config.h \ + .././io/hardware/portc.hpp .././io/Led.hpp .././io/hardware/pin.hpp \ + .././io/Spi.hpp .././io/../config.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 +.././config.h: + +.././peripheral.h: + +.././io/hardware/portd.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: @@ -43,11 +51,15 @@ 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: -.././rf12.h: +.././io/hardware/portc.hpp: -.././global.h: +.././io/Led.hpp: -.././config.h: +.././io/hardware/pin.hpp: + +.././io/Spi.hpp: + +.././io/../config.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: diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.eep b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.eep new file mode 100644 index 0000000..1996e8f --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.elf b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.elf new file mode 100644 index 0000000..c667fdf Binary files /dev/null and b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.elf differ diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.hex b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.hex new file mode 100644 index 0000000..4ae8c95 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.hex @@ -0,0 +1,22 @@ +:100000000C9435000C9452000C9452000C94520045 +:100010000C9452000C9452000C9452000C94520018 +:100020000C9452000C9452000C9452000C94520008 +:100030000C9452000C9452000C9452000C945200F8 +:100040000C9452000C9452000C9452000C945200E8 +:100050000C9452000C9452000C9452000C945200D8 +:100060000C9452000C945200950011241FBECFEF47 +:10007000D4E0DEBFCDBF21E0A0E0B1E001C01D9221 +:10008000A030B207E1F710E0CAE6D0E004C0229742 +:10009000FE010E949D00C836D107C9F70E9460008A +:1000A0000C94A1000C9400005E98569A08955E9AF4 +:1000B000569A08955F98579A08955F9A579A0895A7 +:1000C0000E9457000E945A002FEF84E39CE02150C9 +:1000D00080409040E1F700C000000E9457000E945D +:1000E0005D002FEF84E39CE0215080409040E1F7D9 +:1000F00000C000000E9454000E945D002FEF84E3C6 +:100100009CE0215080409040E1F700C000000E9438 +:1001100054000E945A002FEF84E39CE0215080405D +:100120009040E1F700C00000CBCF579A569A0E944A +:1001300054000C945A00EE0FFF1F0590F491E02D2F +:060140000994F894FFCFC2 +:00000001FF diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.lss b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.lss new file mode 100644 index 0000000..1d44f46 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.lss @@ -0,0 +1,176 @@ + +Zeitschaltung_V6.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .data 00000000 00800100 00000146 000001ba 2**0 + CONTENTS, ALLOC, LOAD, DATA + 1 .text 00000146 00000000 00000000 00000074 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 2 .stab 000006cc 00000000 00000000 000001bc 2**2 + CONTENTS, READONLY, DEBUGGING + 3 .stabstr 00000082 00000000 00000000 00000888 2**0 + CONTENTS, READONLY, DEBUGGING + 4 .comment 0000002f 00000000 00000000 0000090a 2**0 + CONTENTS, READONLY + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 0c 94 35 00 jmp 0x6a ; 0x6a <__ctors_end> + 4: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 8: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + c: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 10: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 14: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 18: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 1c: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 20: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 24: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 28: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 2c: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 30: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 34: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 38: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 3c: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 40: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 44: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 48: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 4c: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 50: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 54: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 58: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 5c: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 60: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + 64: 0c 94 52 00 jmp 0xa4 ; 0xa4 <__bad_interrupt> + +00000068 <__ctors_start>: + 68: 95 00 .word 0x0095 ; ???? + +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_clear_bss>: + 76: 21 e0 ldi r18, 0x01 ; 1 + 78: a0 e0 ldi r26, 0x00 ; 0 + 7a: b1 e0 ldi r27, 0x01 ; 1 + 7c: 01 c0 rjmp .+2 ; 0x80 <.do_clear_bss_start> + +0000007e <.do_clear_bss_loop>: + 7e: 1d 92 st X+, r1 + +00000080 <.do_clear_bss_start>: + 80: a0 30 cpi r26, 0x00 ; 0 + 82: b2 07 cpc r27, r18 + 84: e1 f7 brne .-8 ; 0x7e <.do_clear_bss_loop> + +00000086 <__do_global_ctors>: + 86: 10 e0 ldi r17, 0x00 ; 0 + 88: ca e6 ldi r28, 0x6A ; 106 + 8a: d0 e0 ldi r29, 0x00 ; 0 + 8c: 04 c0 rjmp .+8 ; 0x96 <__do_global_ctors+0x10> + 8e: 22 97 sbiw r28, 0x02 ; 2 + 90: fe 01 movw r30, r28 + 92: 0e 94 9d 00 call 0x13a ; 0x13a <__tablejump__> + 96: c8 36 cpi r28, 0x68 ; 104 + 98: d1 07 cpc r29, r17 + 9a: c9 f7 brne .-14 ; 0x8e <__do_global_ctors+0x8> + 9c: 0e 94 60 00 call 0xc0 ; 0xc0
+ a0: 0c 94 a1 00 jmp 0x142 ; 0x142 <_exit> + +000000a4 <__bad_interrupt>: + a4: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> + +000000a8 <_ZN6avrlib3pinINS_5portdELh6EE8make_lowEv>: + a8: 5e 98 cbi 0x0b, 6 ; 11 + aa: 56 9a sbi 0x0a, 6 ; 10 + ac: 08 95 ret + +000000ae <_ZN6avrlib3pinINS_5portdELh6EE9make_highEv>: + ae: 5e 9a sbi 0x0b, 6 ; 11 + b0: 56 9a sbi 0x0a, 6 ; 10 + b2: 08 95 ret + +000000b4 <_ZN6avrlib3pinINS_5portdELh7EE8make_lowEv>: + b4: 5f 98 cbi 0x0b, 7 ; 11 + b6: 57 9a sbi 0x0a, 7 ; 10 + b8: 08 95 ret + +000000ba <_ZN6avrlib3pinINS_5portdELh7EE9make_highEv>: + ba: 5f 9a sbi 0x0b, 7 ; 11 + bc: 57 9a sbi 0x0a, 7 ; 10 + be: 08 95 ret + +000000c0
: + c0: 0e 94 57 00 call 0xae ; 0xae <_ZN6avrlib3pinINS_5portdELh6EE9make_highEv> + c4: 0e 94 5a 00 call 0xb4 ; 0xb4 <_ZN6avrlib3pinINS_5portdELh7EE8make_lowEv> + c8: 2f ef ldi r18, 0xFF ; 255 + ca: 84 e3 ldi r24, 0x34 ; 52 + cc: 9c e0 ldi r25, 0x0C ; 12 + ce: 21 50 subi r18, 0x01 ; 1 + d0: 80 40 sbci r24, 0x00 ; 0 + d2: 90 40 sbci r25, 0x00 ; 0 + d4: e1 f7 brne .-8 ; 0xce + d6: 00 c0 rjmp .+0 ; 0xd8 + d8: 00 00 nop + da: 0e 94 57 00 call 0xae ; 0xae <_ZN6avrlib3pinINS_5portdELh6EE9make_highEv> + de: 0e 94 5d 00 call 0xba ; 0xba <_ZN6avrlib3pinINS_5portdELh7EE9make_highEv> + e2: 2f ef ldi r18, 0xFF ; 255 + e4: 84 e3 ldi r24, 0x34 ; 52 + e6: 9c e0 ldi r25, 0x0C ; 12 + e8: 21 50 subi r18, 0x01 ; 1 + ea: 80 40 sbci r24, 0x00 ; 0 + ec: 90 40 sbci r25, 0x00 ; 0 + ee: e1 f7 brne .-8 ; 0xe8 + f0: 00 c0 rjmp .+0 ; 0xf2 + f2: 00 00 nop + f4: 0e 94 54 00 call 0xa8 ; 0xa8 <_ZN6avrlib3pinINS_5portdELh6EE8make_lowEv> + f8: 0e 94 5d 00 call 0xba ; 0xba <_ZN6avrlib3pinINS_5portdELh7EE9make_highEv> + fc: 2f ef ldi r18, 0xFF ; 255 + fe: 84 e3 ldi r24, 0x34 ; 52 + 100: 9c e0 ldi r25, 0x0C ; 12 + 102: 21 50 subi r18, 0x01 ; 1 + 104: 80 40 sbci r24, 0x00 ; 0 + 106: 90 40 sbci r25, 0x00 ; 0 + 108: e1 f7 brne .-8 ; 0x102 + 10a: 00 c0 rjmp .+0 ; 0x10c + 10c: 00 00 nop + 10e: 0e 94 54 00 call 0xa8 ; 0xa8 <_ZN6avrlib3pinINS_5portdELh6EE8make_lowEv> + 112: 0e 94 5a 00 call 0xb4 ; 0xb4 <_ZN6avrlib3pinINS_5portdELh7EE8make_lowEv> + 116: 2f ef ldi r18, 0xFF ; 255 + 118: 84 e3 ldi r24, 0x34 ; 52 + 11a: 9c e0 ldi r25, 0x0C ; 12 + 11c: 21 50 subi r18, 0x01 ; 1 + 11e: 80 40 sbci r24, 0x00 ; 0 + 120: 90 40 sbci r25, 0x00 ; 0 + 122: e1 f7 brne .-8 ; 0x11c + 124: 00 c0 rjmp .+0 ; 0x126 + 126: 00 00 nop + 128: cb cf rjmp .-106 ; 0xc0
+ +0000012a <_GLOBAL__sub_I_l>: + 12a: 57 9a sbi 0x0a, 7 ; 10 + 12c: 56 9a sbi 0x0a, 6 ; 10 + 12e: 0e 94 54 00 call 0xa8 ; 0xa8 <_ZN6avrlib3pinINS_5portdELh6EE8make_lowEv> + 132: 0c 94 5a 00 jmp 0xb4 ; 0xb4 <_ZN6avrlib3pinINS_5portdELh7EE8make_lowEv> + +00000136 <__tablejump2__>: + 136: ee 0f add r30, r30 + 138: ff 1f adc r31, r31 + +0000013a <__tablejump__>: + 13a: 05 90 lpm r0, Z+ + 13c: f4 91 lpm r31, Z + 13e: e0 2d mov r30, r0 + 140: 09 94 ijmp + +00000142 <_exit>: + 142: f8 94 cli + +00000144 <__stop_program>: + 144: ff cf rjmp .-2 ; 0x144 <__stop_program> diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.map b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.map new file mode 100644 index 0000000..655b789 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.map @@ -0,0 +1,447 @@ +Archive member included because of file (symbol) + +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_exit.o) + 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/avr5/crtm168a.o (exit) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_clear_bss.o) + Zeitschaltung_V6.o (__do_clear_bss) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_ctors.o) + Zeitschaltung_V6.o (__do_global_ctors) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_tablejump.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_ctors.o) (__tablejump__) + +Discarded input sections + + .bss 0x00000000 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/avr5/crtm168a.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .text 0x00000000 0x0 Zeitschaltung_V6.o + .bss 0x00000000 0x1 Zeitschaltung_V6.o + .text 0x00000000 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/avr5\libgcc.a(_exit.o) + .bss 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_exit.o) + .text 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .bss 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_clear_bss.o) + .text 0x00000000 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/avr5\libgcc.a(_ctors.o) + .bss 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_ctors.o) + .text 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .bss 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.mul + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.div + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.prologue + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.builtins + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + .text.libgcc.fmul + 0x00000000 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/avr5\libgcc.a(_tablejump.o) + +Memory Configuration + +Name Origin Length Attributes +text 0x00000000 0x00020000 xr +data 0x00800060 0x0000ffa0 rw !x +eeprom 0x00810000 0x00010000 rw !x +fuse 0x00820000 0x00000400 rw !x +lock 0x00830000 0x00000400 rw !x +signature 0x00840000 0x00000400 rw !x +user_signatures 0x00850000 0x00000400 rw !x +*default* 0x00000000 0xffffffff + +Linker script and memory map + +Address of section .data set to 0x800100 +LOAD 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/avr5/crtm168a.o +LOAD Zeitschaltung_V6.o +START GROUP +LOAD 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/avr5\libm.a +END GROUP +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a +LOAD 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/avr5\libm.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a +LOAD 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/avr5\libc.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x00000000 0x146 + *(.vectors) + .vectors 0x00000000 0x68 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/avr5/crtm168a.o + 0x00000000 __vector_default + 0x00000000 __vectors + *(.vectors) + *(.progmem.gcc*) + *(.progmem*) + 0x00000068 . = ALIGN (0x2) + 0x00000068 __trampolines_start = . + *(.trampolines) + .trampolines 0x00000068 0x0 linker stubs + *(.trampolines*) + 0x00000068 __trampolines_end = . + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x00000068 __ctors_start = . + *(.ctors) + .ctors 0x00000068 0x2 Zeitschaltung_V6.o + 0x0000006a __ctors_end = . + 0x0000006a __dtors_start = . + *(.dtors) + 0x0000006a __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x0000006a 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/avr5/crtm168a.o + 0x0000006a __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x0000006a 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/../../../../avr/lib/avr5/crtm168a.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + .init4 0x00000076 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_clear_bss.o) + 0x00000076 __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + .init6 0x00000086 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr5\libgcc.a(_ctors.o) + 0x00000086 __do_global_ctors + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x0000009c 0x8 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/avr5/crtm168a.o + *(.init9) + *(.text) + .text 0x000000a4 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/../../../../avr/lib/avr5/crtm168a.o + 0x000000a4 __vector_22 + 0x000000a4 __vector_1 + 0x000000a4 __vector_24 + 0x000000a4 __vector_12 + 0x000000a4 __bad_interrupt + 0x000000a4 __vector_6 + 0x000000a4 __vector_3 + 0x000000a4 __vector_23 + 0x000000a4 __vector_25 + 0x000000a4 __vector_11 + 0x000000a4 __vector_13 + 0x000000a4 __vector_17 + 0x000000a4 __vector_19 + 0x000000a4 __vector_7 + 0x000000a4 __vector_5 + 0x000000a4 __vector_4 + 0x000000a4 __vector_9 + 0x000000a4 __vector_2 + 0x000000a4 __vector_21 + 0x000000a4 __vector_15 + 0x000000a4 __vector_8 + 0x000000a4 __vector_14 + 0x000000a4 __vector_10 + 0x000000a4 __vector_16 + 0x000000a4 __vector_18 + 0x000000a4 __vector_20 + 0x000000a8 . = ALIGN (0x2) + *(.text.*) + .text._ZN6avrlib3pinINS_5portdELh6EE8make_lowEv + 0x000000a8 0x6 Zeitschaltung_V6.o + 0x000000a8 _ZN6avrlib3pinINS_5portdELh6EE8make_lowEv + .text._ZN6avrlib3pinINS_5portdELh6EE9make_highEv + 0x000000ae 0x6 Zeitschaltung_V6.o + 0x000000ae _ZN6avrlib3pinINS_5portdELh6EE9make_highEv + .text._ZN6avrlib3pinINS_5portdELh7EE8make_lowEv + 0x000000b4 0x6 Zeitschaltung_V6.o + 0x000000b4 _ZN6avrlib3pinINS_5portdELh7EE8make_lowEv + .text._ZN6avrlib3pinINS_5portdELh7EE9make_highEv + 0x000000ba 0x6 Zeitschaltung_V6.o + 0x000000ba _ZN6avrlib3pinINS_5portdELh7EE9make_highEv + .text.startup.main + 0x000000c0 0x6a Zeitschaltung_V6.o + 0x000000c0 main + .text.startup._GLOBAL__sub_I_l + 0x0000012a 0xc Zeitschaltung_V6.o + .text.libgcc 0x00000136 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/avr5\libgcc.a(_tablejump.o) + 0x00000136 __tablejump2__ + 0x0000013a __tablejump__ + 0x00000142 . = ALIGN (0x2) + *(.fini9) + .fini9 0x00000142 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/avr5\libgcc.a(_exit.o) + 0x00000142 _exit + 0x00000142 exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x00000142 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/avr5\libgcc.a(_exit.o) + *(.fini0) + 0x00000146 _etext = . + +.data 0x00800100 0x0 load address 0x00000146 + 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/avr5/crtm168a.o + .data 0x00800100 0x0 Zeitschaltung_V6.o + .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/avr5\libgcc.a(_exit.o) + .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/avr5\libgcc.a(_clear_bss.o) + .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/avr5\libgcc.a(_ctors.o) + .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/avr5\libgcc.a(_tablejump.o) + *(.data*) + *(.rodata) + *(.rodata*) + *(.gnu.linkonce.d*) + 0x00800100 . = ALIGN (0x2) + 0x00800100 _edata = . + 0x00800100 PROVIDE (__data_end, .) + +.bss 0x00800100 0x0 + 0x00800100 PROVIDE (__bss_start, .) + *(.bss) + *(.bss*) + *(COMMON) + 0x00800100 PROVIDE (__bss_end, .) + 0x00000146 __data_load_start = LOADADDR (.data) + 0x00000146 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x00800100 0x0 + 0x00800100 PROVIDE (__noinit_start, .) + *(.noinit*) + 0x00800100 PROVIDE (__noinit_end, .) + 0x00800100 _end = . + 0x00800100 PROVIDE (__heap_start, .) + +.eeprom 0x00810000 0x0 + *(.eeprom*) + 0x00810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab 0x00000000 0x6cc + *(.stab) + .stab 0x00000000 0x6cc 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/avr5/crtm168a.o + +.stabstr 0x00000000 0x82 + *(.stabstr) + .stabstr 0x00000000 0x82 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/avr5/crtm168a.o + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x00000000 0x2f + *(.comment) + .comment 0x00000000 0x2f Zeitschaltung_V6.o + 0x30 (size before relaxing) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges + *(.debug_aranges) + +.debug_pubnames + *(.debug_pubnames) + +.debug_info + *(.debug_info) + *(.gnu.linkonce.wi.*) + +.debug_abbrev + *(.debug_abbrev) + +.debug_line + *(.debug_line) + +.debug_frame + *(.debug_frame) + +.debug_str + *(.debug_str) + +.debug_loc + *(.debug_loc) + +.debug_macinfo + *(.debug_macinfo) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges + *(.debug_ranges) + +.debug_macro + *(.debug_macro) +OUTPUT(Zeitschaltung_V6.elf elf32-avr) +LOAD linker stubs diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.srec b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.srec new file mode 100644 index 0000000..23b0f12 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/Zeitschaltung_V6.srec @@ -0,0 +1,23 @@ +S01800005A656974736368616C74756E675F56362E73726563BC +S11300000C9435000C9452000C9452000C94520041 +S11300100C9452000C9452000C9452000C94520014 +S11300200C9452000C9452000C9452000C94520004 +S11300300C9452000C9452000C9452000C945200F4 +S11300400C9452000C9452000C9452000C945200E4 +S11300500C9452000C9452000C9452000C945200D4 +S11300600C9452000C945200950011241FBECFEF43 +S1130070D4E0DEBFCDBF21E0A0E0B1E001C01D921D +S1130080A030B207E1F710E0CAE6D0E004C022973E +S1130090FE010E949D00C836D107C9F70E94600086 +S11300A00C94A1000C9400005E98569A08955E9AF0 +S11300B0569A08955F98579A08955F9A579A0895A3 +S11300C00E9457000E945A002FEF84E39CE02150C5 +S11300D080409040E1F700C000000E9457000E9459 +S11300E05D002FEF84E39CE0215080409040E1F7D5 +S11300F000C000000E9454000E945D002FEF84E3C2 +S11301009CE0215080409040E1F700C000000E9434 +S113011054000E945A002FEF84E39CE02150804059 +S11301209040E1F700C00000CBCF579A569A0E9446 +S113013054000C945A00EE0FFF1F0590F491E02D2B +S10901400994F894FFCFBE +S9030000FC diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/io/hardware/.gitignore b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/io/hardware/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/makedep.mk b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/makedep.mk new file mode 100644 index 0000000..a5d6ddc --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Release/makedep.mk @@ -0,0 +1,6 @@ +################################################################################ +# Automatically-generated file. Do not edit or delete the file +################################################################################ + +Zeitschaltung_V6.cpp + diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp new file mode 100644 index 0000000..c02524d --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp @@ -0,0 +1,28 @@ +/* + * Zeitschaltung_V6.cpp + * + * Created: 06.05.2014 23:18:58 + * Author: netz + */ +#include "peripheral.h" +#include "comunication/funk.hpp" + +typedef Funk< + rfm12class, //Rfm12 Funk Hardware + moveclass, //Bewegungsmelder + startclass, //Startknopf + servoclass, //Servo + ledclass //LED +> funkclass; +funkclass funk; + +int main(void) { + while(1) + { + funk.worker(); + } +} + +ISR(TIMER0_OVF_vect) { + funk.timer(); +} \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj new file mode 100644 index 0000000..3282f3b --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj @@ -0,0 +1,213 @@ + + + + 2.0 + 6.1 + com.Atmel.AVRGCC8.CPP + {ec267909-c732-4cef-b754-bd8ce5ebd85c} + ATtiny24A + none + Executable + CPP + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + Zeitschaltung_V6 + Zeitschaltung_V6 + Zeitschaltung_V6 + Native + true + false + + + 0 + true + 0x20000000 + true + + 0 + + + + + + + + + + + + ISP + + + + com.atmel.avrdbg.tool.ispmk2 + AVRISP mkII + 0000000000000 + + 127.0.0.1 + 59286 + False + + + ISP + + 249000 + 1000000 + 150000 + false + false + 0 + 0 + 0 + 0 + + + + + com.atmel.avrdbg.tool.simulator + Simulator + + + + 127.0.0.1 + 50091 + False + + + + + + + True + True + True + True + True + True + + + NDEBUG + + + Optimize for size (-Os) + True + True + True + True + True + + + NDEBUG + + + Optimize for size (-Os) + True + True + True + True + True + True + True + + + libm + + + <segmentname>=<address>, for example .boot=0xff + + + Zeitschaltung_V6 + .elf + Executable + + + + + True + True + True + True + True + True + + + DEBUG + + + Optimize (-O1) + True + True + Default (-g2) + True + True + True + + + DEBUG + + + Optimize for size (-Os) + True + True + Default (-g2) + True + -std=c++11 + + + libm + + + <segmentname>=<address>, for example .boot=0xff + Default (-Wa,-g) + + + + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + + + + + + + \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/comunication/Snap.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/comunication/Snap.hpp new file mode 100644 index 0000000..bdb0f83 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/comunication/Snap.hpp @@ -0,0 +1,64 @@ +/* + * Snap.hpp + * + * Created: 10.05.2014 13:28:04 + * Author: netz + */ + + +#ifndef SNAP_H_ +#define SNAP_H_ + +class Snap { + public: + static const uint8_t DEVICE = 30; + + static const uint8_t ALL = 0; + static const uint8_t GROUP = 240; + static const uint8_t MASTER = 1; + + static const uint8_t PING = 1; + static const uint8_t SLEEP = 2; + static const uint8_t ACTIVE = 3; + static const uint8_t SETSLEEP = 4; + static const uint8_t SETACTIVE = 5; + static const uint8_t RUN = 6; + static const uint8_t SETRUN = 7; + static const uint8_t DEDECT = 8; + static const uint8_t SETDEDECT = 9; + + protected: + virtual void hook_turn() = 0; + virtual void hook_poll() = 0; + virtual void funk_begin() = 0; + virtual void funk_end() = 0; + virtual uint8_t funk_has_data() = 0; + virtual uint8_t funk_get_byte() = 0; + virtual void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) = 0; + + void wait() { + _delay_ms(10); + for(uint8_t i=0;iDEVICE;i++) { + _delay_ms(5); + } + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + for (uint8_t i = 0; i < len; i++) + { + while(this->funk_has_data()) { + this->hook_poll(); + } + data[i] = this->funk_get_byte(); + } + this->funk_end(); + } + + void send_packet(uint8_t data) { + this->funk_send_packet(this->MASTER, this->DEVICE, data); + } +}; + + + +#endif /* SNAP_H_ */ \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/comunication/funk.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/comunication/funk.hpp new file mode 100644 index 0000000..2985c15 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/comunication/funk.hpp @@ -0,0 +1,133 @@ +/* + * funk.hpp + * + * Created: 10.05.2014 10:00:08 + * Author: netz + */ + +#ifndef FUNK_H_ +#define FUNK_H_ + +#include "Snap.hpp" + +template +class Funk : public Snap { + public: + volatile uint8_t status; + Funk() { + this->init(); + } + void timer() { + if(this->status == this->SLEEP) { + led.color(led.GREEN); + } else if(this->status == this->ACTIVE) { + led.color(led.RED); + } else if(this->status == this->RUN) { + led.color(led.YELLOW); + } + servo.timer(); + } + void worker() { + uint8_t data[3]; + this->get_packet(data, 3); + if(data[0] == ALL || data[0] == DEVICE || data[0] == GROUP) { + if(data[1] == this->MASTER) { + switch(data[2]) { + case this->PING: { + break; + } + case this->SETSLEEP: { + this->status = this->SLEEP; + break; + } + case this->SETACTIVE: { + this->status = this->ACTIVE; + break; + } + case this->SETRUN: { + this->hook_turn(); + this->send_packet(this->RUN); + return; + } + default: { + return; + } + } + this->wait(); + this->send_packet(this->status); + return; + } + } + } + private: + Input_Start st; + Input_Beweg mc; + Servo servo; + Led led; + Rfm12 rfm12; + void init() + { + led.color(led.RED); + this->status = this->SLEEP; + } + void hook_turn() + { + if(this->status == this->RUN){ + return; + } + this->status = this->RUN; + + servo.turn(servo.LEFT); + servo.on(); + this->wait(); + _delay_ms(400); + servo.turn(servo.MIDDLE); + _delay_ms(300); + servo.turn(servo.RIGHT); + _delay_ms(700); + servo.off(); + } + + void hook_poll() + { + if(this->status == this->ACTIVE) { + if(mc.is_pressed()) { + this->funk_end(); + this->hook_turn(); + this->send_packet(this->RUN); + this->funk_begin(); + } + } + if(this->status == this->SLEEP) { + if(mc.is_pressed()) { + this->funk_end(); + this->send_packet(this->DEDECT); + this->funk_begin(); + } + } + if(st.is_pressed()) { + if(this->status == this->SLEEP) { + this->status = this->RUN; + _delay_ms(15000); + this->status = this->ACTIVE; + } + } + } + void funk_begin() { + rfm12.beginasyncrx(); + } + void funk_end() { + rfm12.endasyncrx(); + } + uint8_t funk_has_data() { + return rfm12.hasdata(); + } + uint8_t funk_get_byte() { + return rfm12.rxbyte(); + } + void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) { + rfm12.txpacket(addr, from, data); + } +}; + +#endif /* FUNK_H_ */ \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Input.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Input.hpp new file mode 100644 index 0000000..2207bd2 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Input.hpp @@ -0,0 +1,33 @@ +/* + * Start.hpp + * + * Created: 08.05.2014 17:55:29 + * Author: netz + */ + + +#ifndef INPUT_H_ +#define INPUT_H_ + + +#include "hardware/pin.hpp" + +template +class Input { + public: + Input() { + init(); + } + uint8_t is_pressed() { + return (!input_in::read()); + } + private: + void init() { + input_in::make_input(); + input_in::pullup(); + } + const typedef avrlib::pin input_in; +}; + + +#endif /* INPUT_H_ */ \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp new file mode 100644 index 0000000..c36d11c --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp @@ -0,0 +1,38 @@ +/* + * Led.h + * + * Created: 03.11.2013 17:11:58 + * Author: BlubbFish + */ + +#ifndef LED_H_ +#define LED_H_ + +#include "hardware/pin.hpp" + +template +class Led { + public: + Led() { + init(); + } + void color(uint8_t mask) { + (mask & (1<<0)) ? green::make_high() : green::make_low(); + (mask & (1<<1)) ? red::make_high() : red::make_low(); + } + static const uint8_t BLACK = 0; + static const uint8_t GREEN = 1; + static const uint8_t RED = 2; + static const uint8_t YELLOW = 3; + private: + void init() { + red::make_output(); + green::make_output(); + color(BLACK); + } + void uninit(); + const typedef avrlib::pin red; + const typedef avrlib::pin green; +}; + +#endif /* LED_H_ */ \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Servo.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Servo.hpp new file mode 100644 index 0000000..b6f6368 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Servo.hpp @@ -0,0 +1,77 @@ +/* + * Servo.hpp + * + * Created: 08.05.2014 13:06:12 + * Author: netz + */ + + +#ifndef SERVO_H_ +#define SERVO_H_ + +#include +#include +#include +#include "hardware/pin.hpp" + +template +class Servo { + public: + Servo() { + init(); + } + void turn(uint16_t mask) { + this->servopos = mask; + } + void on() { + servo_act::make_high(); + } + void off() { + servo_act::make_low(); + } + void timer() { + TCNT0 = 0x64; // Reinitialize Timer 0 value + servo_io::make_high(); + _delay_us(s_left); + for(uint16_t i = 0; i < servopos; i++) { + _delay_us(s_step); + } + servo_io::make_low(); + } + static const uint16_t LEFT = 0; + static const uint16_t MIDDLE = s_middle; + static const uint16_t RIGHT = s_right; + private: + uint8_t servopos; + void init() { + this->servopos = 0; + servo_act::make_output(); + servo_act::make_low(); + servo_io::make_output(); + this->init_timer(); + sei(); + } + void init_timer() { + // Timer/Counter 0 initialization + // Clock source: System Clock + // Clock value: 7,813 kHz + // Mode: Normal top=0xFF + // OC0A output: Disconnected + // OC0B output: Disconnected + // Timer Period: 19,968 ms + TCCR0A=(0< servo_io; + const typedef avrlib::pin servo_act; +}; + + +#endif /* SERVO_H_ */ \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp new file mode 100644 index 0000000..0dafd0c --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp @@ -0,0 +1,86 @@ +/* + * Spi.h + * + * Created: 06.11.2013 15:41:34 + * Author: netz + */ + + +#ifndef SPI_H_ +#define SPI_H_ + +#include +#include +#include "hardware/pin.hpp" + +template +class Spi { + public: + Spi() { + this->init(); + } + void CSOn() { + cs::make_low(); + } + void CSOff() { + cs::make_high(); + } + uint8_t send(uint8_t data) { + if(mode == 0) { + return this->send_hard(data); + } + return this->send_soft(data); + } + uint8_t has_data() { + return !miso::read(); + } + private: + const typedef avrlib::pin cs; + const typedef avrlib::pin miso; + const typedef avrlib::pin mosi; + const typedef avrlib::pin sck; + void init() { + this->init_port(); + if(mode == 0) { + this->init_spi(); + } + } + void init_port() { + mosi::make_low(); //output und low; + sck::make_low(); //output und low; + cs::make_high(); //output und low; + miso::make_input(); //input und low; + } + void init_spi() { + SPCR = (1< + +namespace avrlib { + + template + struct pin + { + static void set(bool value = true) + { + if (value) + Port::port(Port::port() | (1< + +namespace avrlib { + + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + + 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; } + }; + +} + +#endif diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/hardware/portc.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/hardware/portc.hpp new file mode 100644 index 0000000..017e95b --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/hardware/portc.hpp @@ -0,0 +1,22 @@ +#ifndef AVRLIB_PORTC_HPP +#define AVRLIB_PORTC_HPP + +#include + +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + }; + +} + +#endif diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/hardware/portd.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/hardware/portd.hpp new file mode 100644 index 0000000..e045ee5 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/hardware/portd.hpp @@ -0,0 +1,22 @@ +#ifndef AVRLIB_PORTD_HPP +#define AVRLIB_PORTD_HPP + +#include + +namespace avrlib { + + struct portd + { + static uint8_t port() { return PORTD; } + static void port(uint8_t v) { PORTD = v; } + + 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; } + }; + +} + +#endif diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/rf12.hpp b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp similarity index 72% rename from V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/rf12.hpp rename to V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp index 7ddd988..37ab8b1 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/rf12.hpp +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp @@ -1,29 +1,22 @@ /* - * rf12.hpp + * rfm12.hpp * - * Created: 24.03.2013 23:52:52 + * Created: 08.05.2014 00:06:49 * Author: netz - */ + */ -#ifndef RF12_H_ -#define RF12_H_ -#include -//#include "rf12.h" -#include +#ifndef RFM12_H_ +#define RFM12_H_ -#define RF12FREQ(freq) ((freq-430.0)/0.0025) // macro for calculating frequency value out of frequency in MHz - -#include "config.h" - -template -class Rf12 { +template +class Rfm12 { public: - Rf12() { + Rfm12() { this->init(); } - void ready(void) { + void ready(void) { s.CSOn(); while(s.has_data()); // wait until FIFO ready } @@ -33,12 +26,12 @@ class Rf12 { this->send(0xCA81); // set FIFO mode this->send(0xCA83); // enable FIFO } - + uint8_t hasdata() { s.CSOn(); return s.has_data(); } - + uint8_t rxbyte() { return this->send(0xB000); } @@ -47,62 +40,62 @@ class Rf12 { this->send(0x8208); // RX off } - void rf12_txdata(uint8_t *data, uint8_t number) { + void txdata(uint8_t *data, uint8_t number) { uint8_t i; this->send(0x8238); // TX on - rf12_ready(); + this->ready(); this->send(0xB8AA); - rf12_ready(); + this->ready(); this->send(0xB8AA); - rf12_ready(); + this->ready(); this->send(0xB8AA); - rf12_ready(); + this->ready(); this->send(0xB82D); - rf12_ready(); + this->ready(); this->send(0xB8D4); for (i=0; iready(); this->send(0xB800|(*data++)); } - rf12_ready(); + this->ready(); this->send(0x8208); // TX off } - void rf12_rxdata(uint8_t *data, uint8_t number) { + void rxdata(uint8_t *data, uint8_t number) { uint8_t i; this->send(0x82C8); // RX on this->send(0xCA81); // set FIFO mode this->send(0xCA83); // enable FIFO for (i=0; iready(); *data++=this->send(0xB000); } this->send(0x8208); // RX off } - void rf12_txpacket(uint8_t addr, uint8_t from, uint8_t data) { + void txpacket(uint8_t addr, uint8_t from, uint8_t data) { this->send(0x8238); // TX on - rf12_ready(); + this->ready(); this->send(0xB8AA); - rf12_ready(); + this->ready(); this->send(0xB8AA); - rf12_ready(); + this->ready(); this->send(0xB8AA); - rf12_ready(); + this->ready(); this->send(0xB82D); - rf12_ready(); + this->ready(); this->send(0xB8D4); - rf12_ready(); + this->ready(); this->send(0xB800|addr); - rf12_ready(); + this->ready(); this->send(0xB800|from); - rf12_ready(); + this->ready(); this->send(0xB800|data); - rf12_ready(); + this->ready(); this->send(0xB800); - rf12_ready(); + this->ready(); this->send(0x8208); // TX off _delay_ms(100); } @@ -135,6 +128,7 @@ class Rf12 { this->send( 0x9400 | ( ( bandwidth & 7 ) << 5 ) | ( ( gain & 3 ) << 3 ) | ( drssi & 7 ) ); } void setfreq() { + uint16_t freq = (uint16_t)(((float)(frequenz-430000)/1000)/0.0025); // macro for calculating frequency value out of frequency in kHz if( freq < 96 ) { // 430,2400MHz this->send( 0xA000 | 96 ); } else if( freq > 3903 ) { // 439,7575MHz @@ -155,7 +149,6 @@ class Rf12 { void setpower() { this->send( 0x9800 | ( power & 7 ) | ( ( mod & 15 ) << 4 ) ); } - }; -#endif /* RF12_H_ */ \ No newline at end of file +#endif /* RFM12_H_ */ \ No newline at end of file diff --git a/V5B/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h new file mode 100644 index 0000000..7504197 --- /dev/null +++ b/V5B/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h @@ -0,0 +1,69 @@ +/* + * peripheral.h + * + * Created: 07.05.2014 14:02:16 + * Author: netz + */ + + +#ifndef PERIPHERAL_H_ +#define PERIPHERAL_H_ + +#define F_CPU 8000000 + +#include "io/hardware/portb.hpp" +#include "io/hardware/portc.hpp" +#include "io/hardware/portd.hpp" + +#include "io/Led.hpp" +typedef Led< + avrlib::portd, //LED an PORTD + PIND7, //Rot + PIND6 //Grün +> ledclass; + +#include "io/Servo.hpp" +typedef Servo< //<640, 105, 210, 8> Blaue Servos + avrlib::portb, //Servo an PORTB + PINB2, //Datenpin des Servos + PINB1, //Mosfetpin des Servos + 640, //Links + 105, //Mitte + 210, //Rechts + 8 //Schrittweite +> servoclass; + +#include "io/Input.hpp" +typedef Input< + avrlib::portd, //Startknopf an PORTD + PIND3 //Pin an dem der Startknopf hängt +> startclass; + +typedef Input< + avrlib::portd, //Bewegungsmelder an PORTD + PIND2 //Pin an dem der Bewegungsmelder hängt +> moveclass; + +#include "io/Spi.hpp" +typedef Spi< // + avrlib::portc, //Funkmodul an PORTC + PINC4, //CS Pin (nSEL) + PINC3, //MISO Pin (SDO) + PINC0, //MOSI Pin (SDI) + PINC1, //SCK Pin + 1 //0 Hardware, 1 Software +> spiclass; + +#include "io/rfm12.hpp" +typedef Rfm12< + spiclass, //SPI Hardware + 1, //Bandwidth // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm + 0, //Gain + 7, //DRRSI + 433920,//(uint16_t)RF12FREQ(433.92), // Sende/Empfangsfrequenz auf 433,92MHz einstellen + 9600, //Baudrate // 9600 baud + 0, //Power // 1mW Ausgangsleistung, 120kHz Frequenzshift + 6 //Mod +> rfm12class; + +#endif /* PERIPHERAL_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6.atsuo b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6.atsuo index c13376e..5c875b4 100644 Binary files a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6.atsuo and b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6.atsuo differ diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile index d8f6564..a50b8f4 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Makefile @@ -33,7 +33,8 @@ LIB_DEP:= # Every subdirectory with source files must be described here SUBDIRS := \ ../io \ -../io/hardware +../io/hardware \ +../comunication # Add inputs and outputs from these tool invocations to the build variables @@ -80,7 +81,7 @@ LIB_DEP+= ./%.o: .././%.cpp @echo Building file: $< @echo Invoking: AVR8/GNU C++ Compiler : - $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-g++.exe$(QUOTE) -funsigned-char -funsigned-bitfields -DDEBUG -Os -ffunction-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega168a -c -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" + $(QUOTE)C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.876\avr8-gnu-toolchain\bin\avr-g++.exe$(QUOTE) -funsigned-char -funsigned-bitfields -DDEBUG -Os -ffunction-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega168a -c -std=c++11 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o"$@" "$<" @echo Finished building: $< diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.d b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.d index e6e4042..4bbe8fa 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.d +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.d @@ -1,5 +1,5 @@ Zeitschaltung_V6.d Zeitschaltung_V6.o: .././Zeitschaltung_V6.cpp \ - .././config.h .././peripheral.h .././io/hardware/portb.hpp \ + .././peripheral.h .././io/hardware/portb.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 \ @@ -19,10 +19,8 @@ Zeitschaltung_V6.d Zeitschaltung_V6.o: .././Zeitschaltung_V6.cpp \ 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 \ - .././io/Input.hpp .././io/Spi.hpp .././io/../config.h .././rf12.hpp \ - .././codes.h - -.././config.h: + .././io/Input.hpp .././io/Spi.hpp .././io/rfm12.hpp \ + .././comunication/funk.hpp .././comunication/Snap.hpp .././peripheral.h: @@ -76,8 +74,8 @@ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8- .././io/Spi.hpp: -.././io/../config.h: +.././io/rfm12.hpp: -.././rf12.hpp: +.././comunication/funk.hpp: -.././codes.h: +.././comunication/Snap.hpp: diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf index 334223e..66cfc84 100644 Binary files a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf and b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.elf differ diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex index f26dfd7..20d8e98 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.hex @@ -2,92 +2,105 @@ :100010000C945D000C945D000C945D000C945D00EC :100020000C945D000C945D000C945D000C945D00DC :100030000C945D000C945D000C945D000C945D00CC -:100040000C9484000C945D000C945D000C945D0095 +:100040000C9421010C945D000C945D000C945D00F7 :100050000C945D000C945D000C945D000C945D00AC -:100060000C945D000C945D00700211241FBECFEF54 -:10007000D4E0DEBFCDBF11E0A0E0B1E0E6EAF5E0FC -:1000800002C005900D92A230B107D9F721E0A2E09D -:10009000B1E001C01D92A730B207E1F710E0CAE657 -:1000A000D0E004C02297FE010E94CD02C836D107DD -:1000B000C9F70E946A020C94D1020C940000219AA4 -:1000C0000895282F98E080E027FF02C0409A01C0E1 -:1000D0004098389A880F33998160419A399A220F53 -:1000E00000C000004198399A915071F7089580FF3F -:1000F00002C05E9A01C05E98569A81FF02C05F9A64 -:1001000001C05F98579A08951F920F920FB60F92F1 -:1001100011242F933F934F935F936F937F938F930C -:100120009F93AF93BF93EF93FF93809100019091C2 -:100130000101029711F481E00FC0809100019091BC -:100140000101039711F482E007C0809100019091B2 -:100150000101069719F483E00E94770084E686BDCA -:100160002A9A229A8FEF94E00197F1F700C00000DD -:1001700080E090E005C025E12A95F1F700000196A6 -:100180002091050130E082179307A8F32A98229A5C -:10019000FF91EF91BF91AF919F918F917F916F915F -:1001A0005F914F913F912F910F900FBE0F901F9035 -:1001B000189544983C9A08950E94D900339BFECF2D -:1001C0000895EF92FF921F93CF93DF931F92CDB7C5 -:1001D000DEB7182F99830E94D90089810E9461009F -:1001E000F82EE12C812F0E946100449A3C9A9701DD -:1001F000282BC9010F90DF91CF911F91FF90EF90B5 -:10020000089588EC92E80E94E10081E89AEC0E944F -:10021000E10083E89AEC0C94E100CF93DF9300D0E7 -:100220001F92CDB7DEB788E392E82B834A836983B8 -:100230000E94E1000E94DC008AEA98EB0E94E10043 -:100240000E94DC008AEA98EB0E94E1000E94DC0038 -:100250008AEA98EB0E94E1000E94DC008DE298EBB4 -:100260000E94E1000E94DC0084ED98EB0E94E10016 -:100270000E94DC006981862F90E0986B0E94E1006B -:100280000E94DC004A81842F90E0986B0E94E1007C -:100290000E94DC002B81822F90E0986B0E94E1008D -:1002A0000E94DC0080E098EB0E94E1000E94DC00EC -:1002B00088E092E80E94E1002FEF80E792E0215071 -:1002C00080409040E1F700C000000F900F900F9029 -:1002D000DF91CF91089580910001909101010697DF -:1002E00009F442C086E090E0909301018093000100 -:1002F000299A0E945F00109205012FEF89EF90E08C -:10030000215080409040E1F700C0000020910001A2 -:10031000309101014EE161E082E091E00E940D0127 -:100320002FEF83EC99E0215080409040E1F700C02E -:10033000000089E6809305012FEF82E597E02150C8 -:1003400080409040E1F700C0000082ED80930501FD -:100350002FEF86E191E1215080409040E1F700C00D -:10036000000029980C945F000895809100019091FD -:100370000101039751F44A9908C088E092E80E946D -:10038000E1000E946B010E940101809100019091A7 -:100390000101029779F44A990DC088E092E80E9421 -:1003A000E10028E04EE161E082E091E00E940D0171 -:1003B0000E9401014B9921C080910001909101019F -:1003C0000297D9F483E00E94770086E090E0909352 -:1003D0000101809300012FEF81E19AE721508040D5 -:1003E0009040E1F700C0000083E090E090930101AD -:1003F0008093000180E00C9477000895CF930E94D1 -:10040000010102C00E94B5010E94D900339BFACFBE -:1004100080E090EB0E94E100882341F08E3131F0C2 -:10042000803F09F055C002C00E94B5010E94D9006A -:10043000339BFACF80E090EB0E94E100C82F02C00E -:100440000E94B5010E94D900339BFACFC13009F058 -:100450003FC080E090EB0E94E100843049F018F446 -:100460008130C9F41DC0853031F08730A1F40AC055 -:1004700082E090E002C083E090E0909301018093DD -:1004800000010EC088E092E80E94E1000E946B012A -:10049000CF910C94010188E092E8CF910C94E10097 -:1004A00088E092E80E94E1002FEF89EF90E0215070 -:1004B00080409040E1F700C00000209100013091A1 -:1004C00001014EE161E082E091E0CF910C940D01D9 -:1004D000CF91089582E00E9477000E94FE01FDCF37 -:1004E000579A569A80E00E947700109205010E9468 -:1004F0005F0029980E945F00229A14BC85E085BDA8 -:1005000084E686BD17BC18BC81E080936E007894A9 -:1005100053985B985B9A52985A985A9A4098389A8E -:100520004198399A449A3C9A3B9843982FEF80E738 -:1005300092E0215080409040E1F700C0000080EE42 -:1005400090EC0E94E10087ED90E80E94E1008BEAC8 -:1005500092EC0E94E10081E89AEC0E94E10080E0C8 -:1005600090EE0E94E10080E098EC0E94E10087EFAD -:1005700094EC0E94E10080E296EA0E94E10087E2AA -:1005800094E90E94E10082E296EC0E94E10080E69C -:1005900098E90C94E100EE0FFF1F0590F491E02D17 -:0605A0000994F894FFCF5E -:0205A600020051 +:100060000C945D000C945D00270311241FBECFEF9C +:10007000D4E0DEBFCDBF11E0A0E0B1E0E6E6F6E0FF +:1000800002C005900D92A231B107D9F721E0A2E19B +:10009000B1E001C01D92AA31B207E1F710E0CAE653 +:1000A000D0E004C02297FE010E942D03C836D1077C +:1000B000C9F70E9409020C9431030C940000219AA4 +:1000C00008953C9A0895282F98E080E027FF02C009 +:1000D000409A01C04098389A880F33998160419ABC +:1000E000399A220F00C000004198399A915071F757 +:1000F000089580FF02C05E9A01C05E98569A81FF03 +:1001000002C05F9A01C05F98579A0895CF93DF931A +:10011000EC018A818630C9F186E08A831D82299AA2 +:100120000E945F008FE19EE40197F1F700C000009C +:100130008EE1EFE0F7E23197F1F700C00000815067 +:10014000C1F7FFEF23EC89E0F15020408040E1F758 +:1001500000C0000089E68D839FEFE2E5F7E0915053 +:10016000E040F040E1F700C0000082ED8D832FEF0A +:1001700086E191E1215080409040E1F700C000000D +:100180002998DF91CF910C945F00DF91CF91089572 +:10019000262FDC01ED91FC910484F585E02D4EE1E4 +:1001A00061E00994CF93DF93EC018A818330D9F425 +:1001B0004A9919C0E881F9810680F781E02DCE01C6 +:1001C0000995E881F9810190F081E02DCE01099532 +:1001D00066E0CE010E94C800E881F9810480F581C3 +:1001E000E02DCE0109958A818230A1F44A9912C08E +:1001F000E881F9810680F781E02DCE01099568E05C +:10020000CE010E94C800E881F9810480F581E02DCB +:10021000CE0109954B9912C08A81823079F486E02B +:100220008A832FEF3CE281E391E02150304080400F +:100230009040D9F700C0000083E08A83DF91CF911E +:1002400008951F920F920FB60F9211242F933F9390 +:100250004F935F936F937F938F939F93AF93BF93CE +:10026000EF93FF9380911401823011F481E00BC071 +:1002700080911401833011F482E005C08091140153 +:10028000863019F483E00E94790084E686BD2A9ABC +:10029000229A8FEF94E00197F1F700C0000080E010 +:1002A00090E005C025E12A95F1F700000196209124 +:1002B000170130E082179307A8F32A98229AFF913A +:1002C000EF91BF91AF919F918F917F916F915F91CE +:1002D0004F913F912F910F900FBE0F901F90189547 +:1002E000CF92DF92EF92FF920F931F93CF93DF9302 +:1002F00000D01F92CDB7DEB78C01DC01ED91FC91EF +:100300000480F581E02D0995EE24E394F12CEC0EA8 +:10031000FD1E6E01B4E0CB0ED11C05C00280F3813E +:10032000E02DC8010995D801ED91FC910084F1857B +:10033000E02DC8010995D801ED91FC918111EECF16 +:100340000284F385E02DC8010995F70181937F01AF +:10035000EC15FD0541F7D801ED91FC910680F78180 +:10036000E02DC80109958981882329F08E3119F083 +:10037000803F09F042C08A81813009F03EC08B8104 +:10038000843049F018F48130C1F518C0853039F057 +:10039000873099F509C082E0F80182830FC083E0BD +:1003A000D80112968C930AC0D801ED91FC9101906E +:1003B000F081E02DC801099566E011C0EFE1FEE48F +:1003C0003197F1F700C000008EE1AFE0B7E211977E +:1003D000F1F700C000008150C1F7F8016281C80147 +:1003E0000F900F900F90DF91CF911F910F91FF9081 +:1003F000EF90DF90CF900C94C8000F900F900F906B +:10040000DF91CF911F910F91FF90EF90DF90CF90F0 +:10041000089582E191E00E947001FBCF4498089515 +:100420000E940E020E946100339BFECF0895EF925E +:10043000FF921F93CF93DF9300D0CDB7DEB7182F75 +:100440009A830E940E020E9461008A810E946300CA +:10045000F82EE12C812F0E9463009701282BC901FF +:10046000449A8A8399830E9461008A8199810F90BE +:100470000F90DF91CF911F91FF90EF900895CF9350 +:10048000DF93EC0184E091E09983888353985B9833 +:100490005B9A52985A985A9A1D820E945F00299836 +:1004A0000E945F00229A14BC85E085BD84E686BD6B +:1004B00017BC18BC81E080936E007894579A569AC6 +:1004C00080E00E9479004098389A4198399A449A7D +:1004D0000E9461003B9843982FEF80E792E0215003 +:1004E00080409040E1F700C0000080EE90EC0E9458 +:1004F000170287ED90E80E9417028BEA92EC0E94A7 +:10050000170281E89AEC0E94170280E090EE0E94A8 +:10051000170280E098EC0E94170287EF94EC0E948B +:10052000170280E296EA0E94170287E294E90E948D +:10053000170282E296EC0E94170280E698E90E9478 +:10054000170282E00E94790082E08A83DF91CF91D6 +:10055000089588EC92E80E94170281E89AEC0E94C4 +:10056000170283E89AEC0C94170288E092E80C9446 +:10057000170280E090EB0E9417020895CF93DF935B +:1005800000D01F92CDB7DEB788E392E82B834A8371 +:1005900069830E9417020E9410028AEA98EB0E9467 +:1005A00017020E9410028AEA98EB0E9417020E942A +:1005B00010028AEA98EB0E9417020E9410028DE254 +:1005C00098EB0E9417020E94100284ED98EB0E94A3 +:1005D00017020E9410026981862F90E0986B0E949A +:1005E00017020E9410024A81842F90E0986B0E94AB +:1005F00017020E9410022B81822F90E0986B0E94BC +:1006000017020E94100280E098EB0E9417020E94DD +:10061000100288E092E80E9417022FEF80E792E034 +:10062000215080409040E1F700C000000F900F90F3 +:100630000F90DF91CF9108950E940E020E946100F9 +:1006400086B183FB882780F991E08927089582E1AC +:1006500091E00C943F02EE0FFF1F0590F491E02D06 +:060660000994F894FFCF9D +:10066600000000008600D200A902B5021C03B902F0 +:02067600BE02C2 :00000001FF diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss index 7c9fb92..18b9c04 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.lss @@ -3,33 +3,33 @@ Zeitschaltung_V6.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn - 0 .data 00000002 00800100 000005a6 0000063a 2**0 + 0 .data 00000012 00800100 00000666 000006fa 2**0 CONTENTS, ALLOC, LOAD, DATA - 1 .text 000005a6 00000000 00000000 00000094 2**1 + 1 .text 00000666 00000000 00000000 00000094 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .bss 00000005 00800102 00800102 0000063c 2**0 + 2 .bss 00000008 00800112 00800112 0000070c 2**0 ALLOC - 3 .stab 000006cc 00000000 00000000 0000063c 2**2 + 3 .stab 000006cc 00000000 00000000 0000070c 2**2 CONTENTS, READONLY, DEBUGGING - 4 .stabstr 00000082 00000000 00000000 00000d08 2**0 + 4 .stabstr 00000082 00000000 00000000 00000dd8 2**0 CONTENTS, READONLY, DEBUGGING - 5 .comment 0000002f 00000000 00000000 00000d8a 2**0 + 5 .comment 0000002f 00000000 00000000 00000e5a 2**0 CONTENTS, READONLY - 6 .debug_aranges 00000088 00000000 00000000 00000db9 2**0 + 6 .debug_aranges 000000b8 00000000 00000000 00000e89 2**0 CONTENTS, READONLY, DEBUGGING - 7 .debug_info 00003671 00000000 00000000 00000e41 2**0 + 7 .debug_info 00003c2d 00000000 00000000 00000f41 2**0 CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 000004ef 00000000 00000000 000044b2 2**0 + 8 .debug_abbrev 000005f5 00000000 00000000 00004b6e 2**0 CONTENTS, READONLY, DEBUGGING - 9 .debug_line 00000515 00000000 00000000 000049a1 2**0 + 9 .debug_line 00000582 00000000 00000000 00005163 2**0 CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 00000174 00000000 00000000 00004eb8 2**2 + 10 .debug_frame 00000220 00000000 00000000 000056e8 2**2 CONTENTS, READONLY, DEBUGGING - 11 .debug_str 00001ba0 00000000 00000000 0000502c 2**0 + 11 .debug_str 000026d3 00000000 00000000 00005908 2**0 CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 000005d9 00000000 00000000 00006bcc 2**0 + 12 .debug_loc 00000c25 00000000 00000000 00007fdb 2**0 CONTENTS, READONLY, DEBUGGING - 13 .debug_ranges 00000120 00000000 00000000 000071a5 2**0 + 13 .debug_ranges 000000c0 00000000 00000000 00008c00 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: @@ -51,7 +51,7 @@ Disassembly of section .text: 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 84 00 jmp 0x108 ; 0x108 <__vector_16> + 40: 0c 94 21 01 jmp 0x242 ; 0x242 <__vector_16> 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> @@ -63,7 +63,7 @@ Disassembly of section .text: 64: 0c 94 5d 00 jmp 0xba ; 0xba <__bad_interrupt> 00000068 <__ctors_start>: - 68: 70 02 muls r23, r16 + 68: 27 03 mulsu r18, r23 0000006a <__ctors_end>: 6a: 11 24 eor r1, r1 @@ -77,18 +77,18 @@ Disassembly of section .text: 76: 11 e0 ldi r17, 0x01 ; 1 78: a0 e0 ldi r26, 0x00 ; 0 7a: b1 e0 ldi r27, 0x01 ; 1 - 7c: e6 ea ldi r30, 0xA6 ; 166 - 7e: f5 e0 ldi r31, 0x05 ; 5 + 7c: e6 e6 ldi r30, 0x66 ; 102 + 7e: f6 e0 ldi r31, 0x06 ; 6 80: 02 c0 rjmp .+4 ; 0x86 <__do_copy_data+0x10> 82: 05 90 lpm r0, Z+ 84: 0d 92 st X+, r0 - 86: a2 30 cpi r26, 0x02 ; 2 + 86: a2 31 cpi r26, 0x12 ; 18 88: b1 07 cpc r27, r17 8a: d9 f7 brne .-10 ; 0x82 <__do_copy_data+0xc> 0000008c <__do_clear_bss>: 8c: 21 e0 ldi r18, 0x01 ; 1 - 8e: a2 e0 ldi r26, 0x02 ; 2 + 8e: a2 e1 ldi r26, 0x12 ; 18 90: b1 e0 ldi r27, 0x01 ; 1 92: 01 c0 rjmp .+2 ; 0x96 <.do_clear_bss_start> @@ -96,7 +96,7 @@ Disassembly of section .text: 94: 1d 92 st X+, r1 00000096 <.do_clear_bss_start>: - 96: a7 30 cpi r26, 0x07 ; 7 + 96: aa 31 cpi r26, 0x1A ; 26 98: b2 07 cpc r27, r18 9a: e1 f7 brne .-8 ; 0x94 <.do_clear_bss_loop> @@ -107,17 +107,17 @@ Disassembly of section .text: a2: 04 c0 rjmp .+8 ; 0xac <__do_global_ctors+0x10> a4: 22 97 sbiw r28, 0x02 ; 2 a6: fe 01 movw r30, r28 - a8: 0e 94 cd 02 call 0x59a ; 0x59a <__tablejump__> + a8: 0e 94 2d 03 call 0x65a ; 0x65a <__tablejump__> ac: c8 36 cpi r28, 0x68 ; 104 ae: d1 07 cpc r29, r17 b0: c9 f7 brne .-14 ; 0xa4 <__do_global_ctors+0x8> - b2: 0e 94 6a 02 call 0x4d4 ; 0x4d4
- b6: 0c 94 d1 02 jmp 0x5a2 ; 0x5a2 <_exit> + b2: 0e 94 09 02 call 0x412 ; 0x412
+ b6: 0c 94 31 03 jmp 0x662 ; 0x662 <_exit> 000000ba <__bad_interrupt>: ba: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> -000000be <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.2>: +000000be <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10>: static uint8_t pin() { return PINB; } static void pin(uint8_t v) { PINB = v; } @@ -127,1113 +127,1298 @@ Disassembly of section .text: be: 21 9a sbi 0x04, 1 ; 4 c0: 08 95 ret -000000c2 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.30>: +000000c2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22>: + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + c2: 3c 9a sbi 0x07, 4 ; 7 + c4: 08 95 ret + +000000c6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29>: } void init_spi() { SPCR = (1< + cc: 27 ff sbrs r18, 7 + ce: 02 c0 rjmp .+4 ; 0xd4 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29+0xe> namespace avrlib { struct portc { static uint8_t port() { return PORTC; } static void port(uint8_t v) { PORTC = v; } - cc: 40 9a sbi 0x08, 0 ; 8 - ce: 01 c0 rjmp .+2 ; 0xd2 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.30+0x10> - d0: 40 98 cbi 0x08, 0 ; 8 + d0: 40 9a sbi 0x08, 0 ; 8 + d2: 01 c0 rjmp .+2 ; 0xd6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29+0x10> + d4: 40 98 cbi 0x08, 0 ; 8 static uint8_t pin() { return PINC; } static void pin(uint8_t v) { PINC = v; } static uint8_t dir() { return DDRC; } static void dir(uint8_t v) { DDRC = v; } - d2: 38 9a sbi 0x07, 0 ; 7 + d6: 38 9a sbi 0x07, 0 ; 7 mosi::make_high(); } else { mosi::make_low(); } datain <<= 1; - d4: 88 0f add r24, r24 + d8: 88 0f add r24, r24 if(miso::read()) { - d6: 33 99 sbic 0x06, 3 ; 6 + da: 33 99 sbic 0x06, 3 ; 6 datain |= 1; - d8: 81 60 ori r24, 0x01 ; 1 + dc: 81 60 ori r24, 0x01 ; 1 namespace avrlib { struct portc { static uint8_t port() { return PORTC; } static void port(uint8_t v) { PORTC = v; } - da: 41 9a sbi 0x08, 1 ; 8 + de: 41 9a sbi 0x08, 1 ; 8 static uint8_t pin() { return PINC; } static void pin(uint8_t v) { PINC = v; } static uint8_t dir() { return DDRC; } static void dir(uint8_t v) { DDRC = v; } - dc: 39 9a sbi 0x07, 1 ; 7 + e0: 39 9a sbi 0x07, 1 ; 7 } sck::make_high(); data<<=1; - de: 22 0f add r18, r18 + e2: 22 0f add r18, r18 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); - e0: 00 c0 rjmp .+0 ; 0xe2 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.30+0x20> - e2: 00 00 nop + e4: 00 c0 rjmp .+0 ; 0xe6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29+0x20> + e6: 00 00 nop namespace avrlib { struct portc { static uint8_t port() { return PORTC; } static void port(uint8_t v) { PORTC = v; } - e4: 41 98 cbi 0x08, 1 ; 8 + e8: 41 98 cbi 0x08, 1 ; 8 static uint8_t pin() { return PINC; } static void pin(uint8_t v) { PINC = v; } static uint8_t dir() { return DDRC; } static void dir(uint8_t v) { DDRC = v; } - e6: 39 9a sbi 0x07, 1 ; 7 - e8: 91 50 subi r25, 0x01 ; 1 + ea: 39 9a sbi 0x07, 1 ; 7 + ec: 91 50 subi r25, 0x01 ; 1 SPCR = (1< + ee: 71 f7 brne .-36 ; 0xcc <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29+0x6> data<<=1; _delay_us(0.3); sck::make_low(); } return datain; } - ec: 08 95 ret + f0: 08 95 ret -000000ee <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11>: +000000f2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6>: public: Led() { init(); } void color(uint8_t mask) { (mask & (1<<0)) ? green::make_high() : green::make_low(); - ee: 80 ff sbrs r24, 0 - f0: 02 c0 rjmp .+4 ; 0xf6 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11+0x8> + f2: 80 ff sbrs r24, 0 + f4: 02 c0 rjmp .+4 ; 0xfa <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0x8> namespace avrlib { struct portd { static uint8_t port() { return PORTD; } static void port(uint8_t v) { PORTD = v; } - f2: 5e 9a sbi 0x0b, 6 ; 11 - f4: 01 c0 rjmp .+2 ; 0xf8 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11+0xa> - f6: 5e 98 cbi 0x0b, 6 ; 11 + f6: 5e 9a sbi 0x0b, 6 ; 11 + f8: 01 c0 rjmp .+2 ; 0xfc <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0xa> + fa: 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; } - f8: 56 9a sbi 0x0a, 6 ; 10 + fc: 56 9a sbi 0x0a, 6 ; 10 (mask & (1<<1)) ? red::make_high() : red::make_low(); - fa: 81 ff sbrs r24, 1 - fc: 02 c0 rjmp .+4 ; 0x102 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11+0x14> + fe: 81 ff sbrs r24, 1 + 100: 02 c0 rjmp .+4 ; 0x106 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0x14> namespace avrlib { struct portd { static uint8_t port() { return PORTD; } static void port(uint8_t v) { PORTD = v; } - fe: 5f 9a sbi 0x0b, 7 ; 11 - 100: 01 c0 rjmp .+2 ; 0x104 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11+0x16> - 102: 5f 98 cbi 0x0b, 7 ; 11 + 102: 5f 9a sbi 0x0b, 7 ; 11 + 104: 01 c0 rjmp .+2 ; 0x108 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6+0x16> + 106: 5f 98 cbi 0x0b, 7 ; 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; } - 104: 57 9a sbi 0x0a, 7 ; 10 - 106: 08 95 ret + 108: 57 9a sbi 0x0a, 7 ; 10 + 10a: 08 95 ret -00000108 <__vector_16>: - { - recive(); - } -} - -ISR(TIMER0_OVF_vect) { - 108: 1f 92 push r1 - 10a: 0f 92 push r0 - 10c: 0f b6 in r0, 0x3f ; 63 - 10e: 0f 92 push r0 - 110: 11 24 eor r1, r1 - 112: 2f 93 push r18 - 114: 3f 93 push r19 - 116: 4f 93 push r20 - 118: 5f 93 push r21 - 11a: 6f 93 push r22 - 11c: 7f 93 push r23 - 11e: 8f 93 push r24 - 120: 9f 93 push r25 - 122: af 93 push r26 - 124: bf 93 push r27 - 126: ef 93 push r30 - 128: ff 93 push r31 - if(status == SLEEP) { - 12a: 80 91 00 01 lds r24, 0x0100 - 12e: 90 91 01 01 lds r25, 0x0101 - 132: 02 97 sbiw r24, 0x02 ; 2 - 134: 11 f4 brne .+4 ; 0x13a <__vector_16+0x32> - l.color(l.GREEN); - 136: 81 e0 ldi r24, 0x01 ; 1 - 138: 0f c0 rjmp .+30 ; 0x158 <__vector_16+0x50> - } else if(status == ACTIVE) { - 13a: 80 91 00 01 lds r24, 0x0100 - 13e: 90 91 01 01 lds r25, 0x0101 - 142: 03 97 sbiw r24, 0x03 ; 3 - 144: 11 f4 brne .+4 ; 0x14a <__vector_16+0x42> - l.color(l.RED); - 146: 82 e0 ldi r24, 0x02 ; 2 - 148: 07 c0 rjmp .+14 ; 0x158 <__vector_16+0x50> - } else if(status == RUN) { - 14a: 80 91 00 01 lds r24, 0x0100 - 14e: 90 91 01 01 lds r25, 0x0101 - 152: 06 97 sbiw r24, 0x06 ; 6 - 154: 19 f4 brne .+6 ; 0x15c <__vector_16+0x54> - l.color(l.YELLOW); - 156: 83 e0 ldi r24, 0x03 ; 3 - 158: 0e 94 77 00 call 0xee ; 0xee <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11> +0000010c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv>: + void init() + { + led.color(led.RED); + this->status = this->SLEEP; } - void off() { - servo_act::make_low(); - } - void timer() { - TCNT0 = 0x64; // Reinitialize Timer 0 value - 15c: 84 e6 ldi r24, 0x64 ; 100 - 15e: 86 bd out 0x26, r24 ; 38 -namespace avrlib { - - struct portb - { - static uint8_t port() { return PORTB; } - static void port(uint8_t v) { PORTB = v; } - 160: 2a 9a sbi 0x05, 2 ; 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; } - 162: 22 9a sbi 0x04, 2 ; 4 - 164: 8f ef ldi r24, 0xFF ; 255 - 166: 94 e0 ldi r25, 0x04 ; 4 - 168: 01 97 sbiw r24, 0x01 ; 1 - 16a: f1 f7 brne .-4 ; 0x168 <__vector_16+0x60> - 16c: 00 c0 rjmp .+0 ; 0x16e <__vector_16+0x66> - 16e: 00 00 nop - servo_io::make_high(); - _delay_us(s_left); - for(uint16_t i = 0; i < servopos; i++) { - 170: 80 e0 ldi r24, 0x00 ; 0 - 172: 90 e0 ldi r25, 0x00 ; 0 - 174: 05 c0 rjmp .+10 ; 0x180 <__vector_16+0x78> - 176: 25 e1 ldi r18, 0x15 ; 21 - 178: 2a 95 dec r18 - 17a: f1 f7 brne .-4 ; 0x178 <__vector_16+0x70> - 17c: 00 00 nop - 17e: 01 96 adiw r24, 0x01 ; 1 - 180: 20 91 05 01 lds r18, 0x0105 - 184: 30 e0 ldi r19, 0x00 ; 0 - 186: 82 17 cp r24, r18 - 188: 93 07 cpc r25, r19 - 18a: a8 f3 brcs .-22 ; 0x176 <__vector_16+0x6e> -namespace avrlib { - - struct portb - { - static uint8_t port() { return PORTB; } - static void port(uint8_t v) { PORTB = v; } - 18c: 2a 98 cbi 0x05, 2 ; 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; } - 18e: 22 9a sbi 0x04, 2 ; 4 - } - se.timer(); - 190: ff 91 pop r31 - 192: ef 91 pop r30 - 194: bf 91 pop r27 - 196: af 91 pop r26 - 198: 9f 91 pop r25 - 19a: 8f 91 pop r24 - 19c: 7f 91 pop r23 - 19e: 6f 91 pop r22 - 1a0: 5f 91 pop r21 - 1a2: 4f 91 pop r20 - 1a4: 3f 91 pop r19 - 1a6: 2f 91 pop r18 - 1a8: 0f 90 pop r0 - 1aa: 0f be out 0x3f, r0 ; 63 - 1ac: 0f 90 pop r0 - 1ae: 1f 90 pop r1 - 1b0: 18 95 reti - -000001b2 <_ZN6avrlib3pinINS_5portcELh4EE8make_lowEv>: -namespace avrlib { - - struct portc - { - static uint8_t port() { return PORTC; } - static void port(uint8_t v) { PORTC = v; } - 1b2: 44 98 cbi 0x08, 4 ; 8 - - static uint8_t pin() { return PINC; } - static void pin(uint8_t v) { PINC = v; } - - static uint8_t dir() { return DDRC; } - static void dir(uint8_t v) { DDRC = v; } - 1b4: 3c 9a sbi 0x07, 4 ; 7 - 1b6: 08 95 ret - -000001b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25>: - public: - Spi() { - this->init(); - } - void CSOn() { - cs::make_low(); - 1b8: 0e 94 d9 00 call 0x1b2 ; 0x1b2 <_ZN6avrlib3pinINS_5portcELh4EE8make_lowEv> - } - - void rf12_ready(void) - { - s.CSOn(); - while(s.has_data()); // wait until FIFO ready - 1bc: 33 9b sbis 0x06, 3 ; 6 - 1be: fe cf rjmp .-4 ; 0x1bc <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25+0x4> - } - 1c0: 08 95 ret - -000001c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32>: - this->send(0x8208); // TX off - _delay_ms(100); - } - private: - Spi s; - uint16_t send(uint16_t wert) { - 1c2: ef 92 push r14 - 1c4: ff 92 push r15 - 1c6: 1f 93 push r17 - 1c8: cf 93 push r28 - 1ca: df 93 push r29 - 1cc: 1f 92 push r1 - 1ce: cd b7 in r28, 0x3d ; 61 - 1d0: de b7 in r29, 0x3e ; 62 - 1d2: 18 2f mov r17, r24 - 1d4: 99 83 std Y+1, r25 ; 0x01 - 1d6: 0e 94 d9 00 call 0x1b2 ; 0x1b2 <_ZN6avrlib3pinINS_5portcELh4EE8make_lowEv> - } - uint8_t send(uint8_t data) { - if(mode == 0) { - return this->send_hard(data); - } - return this->send_soft(data); - 1da: 89 81 ldd r24, Y+1 ; 0x01 - 1dc: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.30> - s.CSOn(); - uint16_t werti = s.send((uint8_t)(wert >> 8)) << 8; - 1e0: f8 2e mov r15, r24 - 1e2: e1 2c mov r14, r1 - 1e4: 81 2f mov r24, r17 - 1e6: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.30> -namespace avrlib { - - struct portc - { - static uint8_t port() { return PORTC; } - static void port(uint8_t v) { PORTC = v; } - 1ea: 44 9a sbi 0x08, 4 ; 8 - - static uint8_t pin() { return PINC; } - static void pin(uint8_t v) { PINC = v; } - - static uint8_t dir() { return DDRC; } - static void dir(uint8_t v) { DDRC = v; } - 1ec: 3c 9a sbi 0x07, 4 ; 7 - werti |= s.send((uint8_t)wert); - 1ee: 97 01 movw r18, r14 - 1f0: 28 2b or r18, r24 - 1f2: c9 01 movw r24, r18 - s.CSOff(); - return werti; - } - 1f4: 0f 90 pop r0 - 1f6: df 91 pop r29 - 1f8: cf 91 pop r28 - 1fa: 1f 91 pop r17 - 1fc: ff 90 pop r15 - 1fe: ef 90 pop r14 - 200: 08 95 ret - -00000202 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE17rf12_beginasyncrxEv.isra.39>: - s.CSOn(); - while(s.has_data()); // wait until FIFO ready - } - - void rf12_beginasyncrx() { - this->send(0x82C8); // RX on - 202: 88 ec ldi r24, 0xC8 ; 200 - 204: 92 e8 ldi r25, 0x82 ; 130 - 206: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - this->send(0xCA81); // set FIFO mode - 20a: 81 e8 ldi r24, 0x81 ; 129 - 20c: 9a ec ldi r25, 0xCA ; 202 - 20e: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - this->send(0xCA83); // enable FIFO - 212: 83 e8 ldi r24, 0x83 ; 131 - 214: 9a ec ldi r25, 0xCA ; 202 - 216: 0c 94 e1 00 jmp 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - -0000021a <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh>: - *data++=this->send(0xB000); - } - this->send(0x8208); // RX off - } - - void rf12_txpacket(uint8_t addr, uint8_t from, uint8_t data) { - 21a: cf 93 push r28 - 21c: df 93 push r29 - 21e: 00 d0 rcall .+0 ; 0x220 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh+0x6> - 220: 1f 92 push r1 - 222: cd b7 in r28, 0x3d ; 61 - 224: de b7 in r29, 0x3e ; 62 - this->send(0x8238); // TX on - 226: 88 e3 ldi r24, 0x38 ; 56 - 228: 92 e8 ldi r25, 0x82 ; 130 - 22a: 2b 83 std Y+3, r18 ; 0x03 - 22c: 4a 83 std Y+2, r20 ; 0x02 - 22e: 69 83 std Y+1, r22 ; 0x01 - 230: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 234: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB8AA); - 238: 8a ea ldi r24, 0xAA ; 170 - 23a: 98 eb ldi r25, 0xB8 ; 184 - 23c: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 240: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB8AA); - 244: 8a ea ldi r24, 0xAA ; 170 - 246: 98 eb ldi r25, 0xB8 ; 184 - 248: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 24c: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB8AA); - 250: 8a ea ldi r24, 0xAA ; 170 - 252: 98 eb ldi r25, 0xB8 ; 184 - 254: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 258: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB82D); - 25c: 8d e2 ldi r24, 0x2D ; 45 - 25e: 98 eb ldi r25, 0xB8 ; 184 - 260: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 264: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB8D4); - 268: 84 ed ldi r24, 0xD4 ; 212 - 26a: 98 eb ldi r25, 0xB8 ; 184 - 26c: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 270: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB800|addr); - 274: 69 81 ldd r22, Y+1 ; 0x01 - 276: 86 2f mov r24, r22 - 278: 90 e0 ldi r25, 0x00 ; 0 - 27a: 98 6b ori r25, 0xB8 ; 184 - 27c: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 280: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB800|from); - 284: 4a 81 ldd r20, Y+2 ; 0x02 - 286: 84 2f mov r24, r20 - 288: 90 e0 ldi r25, 0x00 ; 0 - 28a: 98 6b ori r25, 0xB8 ; 184 - 28c: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 290: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB800|data); - 294: 2b 81 ldd r18, Y+3 ; 0x03 - 296: 82 2f mov r24, r18 - 298: 90 e0 ldi r25, 0x00 ; 0 - 29a: 98 6b ori r25, 0xB8 ; 184 - 29c: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 2a0: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0xB800); - 2a4: 80 e0 ldi r24, 0x00 ; 0 - 2a6: 98 eb ldi r25, 0xB8 ; 184 - 2a8: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - rf12_ready(); - 2ac: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25> - this->send(0x8208); // TX off - 2b0: 88 e0 ldi r24, 0x08 ; 8 - 2b2: 92 e8 ldi r25, 0x82 ; 130 - 2b4: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - #else - //round up by default - __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); - #endif - - __builtin_avr_delay_cycles(__ticks_dc); - 2b8: 2f ef ldi r18, 0xFF ; 255 - 2ba: 80 e7 ldi r24, 0x70 ; 112 - 2bc: 92 e0 ldi r25, 0x02 ; 2 - 2be: 21 50 subi r18, 0x01 ; 1 - 2c0: 80 40 sbci r24, 0x00 ; 0 - 2c2: 90 40 sbci r25, 0x00 ; 0 - 2c4: e1 f7 brne .-8 ; 0x2be <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh+0xa4> - 2c6: 00 c0 rjmp .+0 ; 0x2c8 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh+0xae> - 2c8: 00 00 nop - _delay_ms(100); - } - 2ca: 0f 90 pop r0 - 2cc: 0f 90 pop r0 - 2ce: 0f 90 pop r0 - 2d0: df 91 pop r29 - 2d2: cf 91 pop r28 - 2d4: 08 95 ret - -000002d6 <_Z4turnv>: - -volatile int status = SLEEP; - -void turn() -{ - if(status == RUN) - 2d6: 80 91 00 01 lds r24, 0x0100 - 2da: 90 91 01 01 lds r25, 0x0101 - 2de: 06 97 sbiw r24, 0x06 ; 6 - 2e0: 09 f4 brne .+2 ; 0x2e4 <_Z4turnv+0xe> - 2e2: 42 c0 rjmp .+132 ; 0x368 <_Z4turnv+0x92> - return; - status = RUN; - 2e4: 86 e0 ldi r24, 0x06 ; 6 - 2e6: 90 e0 ldi r25, 0x00 ; 0 - 2e8: 90 93 01 01 sts 0x0101, r25 - 2ec: 80 93 00 01 sts 0x0100, r24 -namespace avrlib { - - struct portb - { - static uint8_t port() { return PORTB; } - static void port(uint8_t v) { PORTB = v; } - 2f0: 29 9a sbi 0x05, 1 ; 5 - 2f2: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.2> + void hook_turn() + 10c: cf 93 push r28 + 10e: df 93 push r29 + 110: ec 01 movw r28, r24 + { + if(this->status == this->RUN){ + 112: 8a 81 ldd r24, Y+2 ; 0x02 + 114: 86 30 cpi r24, 0x06 ; 6 + 116: c9 f1 breq .+114 ; 0x18a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x7e> + return; + } + this->status = this->RUN; + 118: 86 e0 ldi r24, 0x06 ; 6 + 11a: 8a 83 std Y+2, r24 ; 0x02 public: Servo() { init(); } void turn(uint16_t mask) { this->servopos = mask; - 2f6: 10 92 05 01 sts 0x0105, r1 - 2fa: 2f ef ldi r18, 0xFF ; 255 - 2fc: 89 ef ldi r24, 0xF9 ; 249 - 2fe: 90 e0 ldi r25, 0x00 ; 0 - 300: 21 50 subi r18, 0x01 ; 1 - 302: 80 40 sbci r24, 0x00 ; 0 - 304: 90 40 sbci r25, 0x00 ; 0 - 306: e1 f7 brne .-8 ; 0x300 <_Z4turnv+0x2a> - 308: 00 c0 rjmp .+0 ; 0x30a <_Z4turnv+0x34> - 30a: 00 00 nop - se.on(); - se.turn(se.LEFT); - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); //r.txpacket(MASTER, DEVICE, status); - 30c: 20 91 00 01 lds r18, 0x0100 - 310: 30 91 01 01 lds r19, 0x0101 - 314: 4e e1 ldi r20, 0x1E ; 30 - 316: 61 e0 ldi r22, 0x01 ; 1 - 318: 82 e0 ldi r24, 0x02 ; 2 - 31a: 91 e0 ldi r25, 0x01 ; 1 - 31c: 0e 94 0d 01 call 0x21a ; 0x21a <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh> - 320: 2f ef ldi r18, 0xFF ; 255 - 322: 83 ec ldi r24, 0xC3 ; 195 - 324: 99 e0 ldi r25, 0x09 ; 9 - 326: 21 50 subi r18, 0x01 ; 1 - 328: 80 40 sbci r24, 0x00 ; 0 - 32a: 90 40 sbci r25, 0x00 ; 0 - 32c: e1 f7 brne .-8 ; 0x326 <_Z4turnv+0x50> - 32e: 00 c0 rjmp .+0 ; 0x330 <_Z4turnv+0x5a> - 330: 00 00 nop - 332: 89 e6 ldi r24, 0x69 ; 105 - 334: 80 93 05 01 sts 0x0105, r24 - 338: 2f ef ldi r18, 0xFF ; 255 - 33a: 82 e5 ldi r24, 0x52 ; 82 - 33c: 97 e0 ldi r25, 0x07 ; 7 - 33e: 21 50 subi r18, 0x01 ; 1 - 340: 80 40 sbci r24, 0x00 ; 0 - 342: 90 40 sbci r25, 0x00 ; 0 - 344: e1 f7 brne .-8 ; 0x33e <_Z4turnv+0x68> - 346: 00 c0 rjmp .+0 ; 0x348 <_Z4turnv+0x72> - 348: 00 00 nop - 34a: 82 ed ldi r24, 0xD2 ; 210 - 34c: 80 93 05 01 sts 0x0105, r24 - 350: 2f ef ldi r18, 0xFF ; 255 - 352: 86 e1 ldi r24, 0x16 ; 22 - 354: 91 e1 ldi r25, 0x11 ; 17 - 356: 21 50 subi r18, 0x01 ; 1 - 358: 80 40 sbci r24, 0x00 ; 0 - 35a: 90 40 sbci r25, 0x00 ; 0 - 35c: e1 f7 brne .-8 ; 0x356 <_Z4turnv+0x80> - 35e: 00 c0 rjmp .+0 ; 0x360 <_Z4turnv+0x8a> - 360: 00 00 nop - 362: 29 98 cbi 0x05, 1 ; 5 - 364: 0c 94 5f 00 jmp 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.2> - 368: 08 95 ret + 11c: 1d 82 std Y+5, r1 ; 0x05 +namespace avrlib { -0000036a <_Z4pollv>: - se.off(); -} + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 11e: 29 9a sbi 0x05, 1 ; 5 + 120: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10> + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif -void poll() -{ - if(status == ACTIVE) { - 36a: 80 91 00 01 lds r24, 0x0100 - 36e: 90 91 01 01 lds r25, 0x0101 - 372: 03 97 sbiw r24, 0x03 ; 3 - 374: 51 f4 brne .+20 ; 0x38a <_Z4pollv+0x20> - if(mc.is_pressed()) { - 376: 4a 99 sbic 0x09, 2 ; 9 - 378: 08 c0 rjmp .+16 ; 0x38a <_Z4pollv+0x20> - uint8_t rf12_rxbyte() { - return this->send(0xB000); + __builtin_avr_delay_cycles(__ticks_dc); + 124: 8f e1 ldi r24, 0x1F ; 31 + 126: 9e e4 ldi r25, 0x4E ; 78 + 128: 01 97 sbiw r24, 0x01 ; 1 + 12a: f1 f7 brne .-4 ; 0x128 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x1c> + 12c: 00 c0 rjmp .+0 ; 0x12e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x22> + 12e: 00 00 nop + 130: 8e e1 ldi r24, 0x1E ; 30 + 132: ef e0 ldi r30, 0x0F ; 15 + 134: f7 e2 ldi r31, 0x27 ; 39 + 136: 31 97 sbiw r30, 0x01 ; 1 + 138: f1 f7 brne .-4 ; 0x136 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x2a> + 13a: 00 c0 rjmp .+0 ; 0x13c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x30> + 13c: 00 00 nop + 13e: 81 50 subi r24, 0x01 ; 1 + virtual uint8_t funk_get_byte() = 0; + virtual void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) = 0; + + void wait() { + _delay_ms(10); + for(uint8_t i=0;iDEVICE;i++) { + 140: c1 f7 brne .-16 ; 0x132 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x26> + 142: ff ef ldi r31, 0xFF ; 255 + 144: 23 ec ldi r18, 0xC3 ; 195 + 146: 89 e0 ldi r24, 0x09 ; 9 + 148: f1 50 subi r31, 0x01 ; 1 + 14a: 20 40 sbci r18, 0x00 ; 0 + 14c: 80 40 sbci r24, 0x00 ; 0 + 14e: e1 f7 brne .-8 ; 0x148 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x3c> + 150: 00 c0 rjmp .+0 ; 0x152 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x46> + 152: 00 00 nop + 154: 89 e6 ldi r24, 0x69 ; 105 + 156: 8d 83 std Y+5, r24 ; 0x05 + 158: 9f ef ldi r25, 0xFF ; 255 + 15a: e2 e5 ldi r30, 0x52 ; 82 + 15c: f7 e0 ldi r31, 0x07 ; 7 + 15e: 91 50 subi r25, 0x01 ; 1 + 160: e0 40 sbci r30, 0x00 ; 0 + 162: f0 40 sbci r31, 0x00 ; 0 + 164: e1 f7 brne .-8 ; 0x15e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x52> + 166: 00 c0 rjmp .+0 ; 0x168 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x5c> + 168: 00 00 nop + 16a: 82 ed ldi r24, 0xD2 ; 210 + 16c: 8d 83 std Y+5, r24 ; 0x05 + 16e: 2f ef ldi r18, 0xFF ; 255 + 170: 86 e1 ldi r24, 0x16 ; 22 + 172: 91 e1 ldi r25, 0x11 ; 17 + 174: 21 50 subi r18, 0x01 ; 1 + 176: 80 40 sbci r24, 0x00 ; 0 + 178: 90 40 sbci r25, 0x00 ; 0 + 17a: e1 f7 brne .-8 ; 0x174 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x68> + 17c: 00 c0 rjmp .+0 ; 0x17e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv+0x72> + 17e: 00 00 nop + 180: 29 98 cbi 0x05, 1 ; 5 + servo.turn(servo.MIDDLE); + _delay_ms(300); + servo.turn(servo.RIGHT); + _delay_ms(700); + servo.off(); } + 182: df 91 pop r29 + 184: cf 91 pop r28 + 186: 0c 94 5f 00 jmp 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10> + 18a: df 91 pop r29 + 18c: cf 91 pop r28 + 18e: 08 95 ret - void rf12_endasyncrx() { - this->send(0x8208); // RX off - 37a: 88 e0 ldi r24, 0x08 ; 8 - 37c: 92 e8 ldi r25, 0x82 ; 130 - 37e: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - r.rf12_endasyncrx(); //r.endasyncrx(); - turn(); - 382: 0e 94 6b 01 call 0x2d6 ; 0x2d6 <_Z4turnv> - r.rf12_beginasyncrx(); //r.beginasyncrx(); - 386: 0e 94 01 01 call 0x202 ; 0x202 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE17rf12_beginasyncrxEv.isra.39> - } - } - if(status == SLEEP) { - 38a: 80 91 00 01 lds r24, 0x0100 - 38e: 90 91 01 01 lds r25, 0x0101 - 392: 02 97 sbiw r24, 0x02 ; 2 - 394: 79 f4 brne .+30 ; 0x3b4 <_Z4pollv+0x4a> - if(mc.is_pressed()) { - 396: 4a 99 sbic 0x09, 2 ; 9 - 398: 0d c0 rjmp .+26 ; 0x3b4 <_Z4pollv+0x4a> - 39a: 88 e0 ldi r24, 0x08 ; 8 - 39c: 92 e8 ldi r25, 0x82 ; 130 - 39e: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - r.rf12_endasyncrx(); //r.endasyncrx(); - r.rf12_txpacket(MASTER, DEVICE, DEDECT); //r.txpacket(MASTER, DEVICE, DEDECT); - 3a2: 28 e0 ldi r18, 0x08 ; 8 - 3a4: 4e e1 ldi r20, 0x1E ; 30 - 3a6: 61 e0 ldi r22, 0x01 ; 1 - 3a8: 82 e0 ldi r24, 0x02 ; 2 - 3aa: 91 e0 ldi r25, 0x01 ; 1 - 3ac: 0e 94 0d 01 call 0x21a ; 0x21a <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh> - r.rf12_beginasyncrx(); //r.beginasyncrx(); - 3b0: 0e 94 01 01 call 0x202 ; 0x202 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE17rf12_beginasyncrxEv.isra.39> - } - } - if(st.is_pressed()) { - 3b4: 4b 99 sbic 0x09, 3 ; 9 - 3b6: 21 c0 rjmp .+66 ; 0x3fa <_Z4pollv+0x90> - if(status == SLEEP) { - 3b8: 80 91 00 01 lds r24, 0x0100 - 3bc: 90 91 01 01 lds r25, 0x0101 - 3c0: 02 97 sbiw r24, 0x02 ; 2 - 3c2: d9 f4 brne .+54 ; 0x3fa <_Z4pollv+0x90> - l.color(l.YELLOW); - 3c4: 83 e0 ldi r24, 0x03 ; 3 - 3c6: 0e 94 77 00 call 0xee ; 0xee <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11> - status = RUN; - 3ca: 86 e0 ldi r24, 0x06 ; 6 - 3cc: 90 e0 ldi r25, 0x00 ; 0 - 3ce: 90 93 01 01 sts 0x0101, r25 - 3d2: 80 93 00 01 sts 0x0100, r24 - 3d6: 2f ef ldi r18, 0xFF ; 255 - 3d8: 81 e1 ldi r24, 0x11 ; 17 - 3da: 9a e7 ldi r25, 0x7A ; 122 - 3dc: 21 50 subi r18, 0x01 ; 1 - 3de: 80 40 sbci r24, 0x00 ; 0 - 3e0: 90 40 sbci r25, 0x00 ; 0 - 3e2: e1 f7 brne .-8 ; 0x3dc <_Z4pollv+0x72> - 3e4: 00 c0 rjmp .+0 ; 0x3e6 <_Z4pollv+0x7c> - 3e6: 00 00 nop - _delay_ms(5000); - status = ACTIVE; - 3e8: 83 e0 ldi r24, 0x03 ; 3 - 3ea: 90 e0 ldi r25, 0x00 ; 0 - 3ec: 90 93 01 01 sts 0x0101, r25 - 3f0: 80 93 00 01 sts 0x0100, r24 - l.color(l.BLACK); - 3f4: 80 e0 ldi r24, 0x00 ; 0 - 3f6: 0c 94 77 00 jmp 0xee ; 0xee <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11> - 3fa: 08 95 ret - -000003fc <_Z6recivev>: - rf12_beginasyncrx(); //r.beginasyncrx(); - } - l.color(l.GREEN); -}*/ - -void recive() { - 3fc: cf 93 push r28 - r.rf12_beginasyncrx(); - 3fe: 0e 94 01 01 call 0x202 ; 0x202 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE17rf12_beginasyncrxEv.isra.39> - while(r.rf12_hasdata()) { - 402: 02 c0 rjmp .+4 ; 0x408 <_Z6recivev+0xc> - poll(); - 404: 0e 94 b5 01 call 0x36a ; 0x36a <_Z4pollv> - public: - Spi() { - this->init(); - } - void CSOn() { - cs::make_low(); - 408: 0e 94 d9 00 call 0x1b2 ; 0x1b2 <_ZN6avrlib3pinINS_5portcELh4EE8make_lowEv> - l.color(l.GREEN); -}*/ - -void recive() { - r.rf12_beginasyncrx(); - while(r.rf12_hasdata()) { - 40c: 33 9b sbis 0x06, 3 ; 6 - 40e: fa cf rjmp .-12 ; 0x404 <_Z6recivev+0x8> - s.CSOn(); - return s.has_data(); +00000190 <_ZN4Snap11send_packetEh>: + data[i] = this->funk_get_byte(); + } + this->funk_end(); } - uint8_t rf12_rxbyte() { - return this->send(0xB000); - 410: 80 e0 ldi r24, 0x00 ; 0 - 412: 90 eb ldi r25, 0xB0 ; 176 - 414: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - poll(); - } - uint8_t addr = r.rf12_rxbyte(); - if(addr == ALL || addr == DEVICE || addr == GROUP) { - 418: 88 23 and r24, r24 - 41a: 41 f0 breq .+16 ; 0x42c <_Z6recivev+0x30> - 41c: 8e 31 cpi r24, 0x1E ; 30 - 41e: 31 f0 breq .+12 ; 0x42c <_Z6recivev+0x30> - 420: 80 3f cpi r24, 0xF0 ; 240 - 422: 09 f0 breq .+2 ; 0x426 <_Z6recivev+0x2a> - 424: 55 c0 rjmp .+170 ; 0x4d0 <_Z6recivev+0xd4> - 426: 02 c0 rjmp .+4 ; 0x42c <_Z6recivev+0x30> - while(r.rf12_hasdata()) { - poll(); - 428: 0e 94 b5 01 call 0x36a ; 0x36a <_Z4pollv> - 42c: 0e 94 d9 00 call 0x1b2 ; 0x1b2 <_ZN6avrlib3pinINS_5portcELh4EE8make_lowEv> - while(r.rf12_hasdata()) { - poll(); - } - uint8_t addr = r.rf12_rxbyte(); - if(addr == ALL || addr == DEVICE || addr == GROUP) { - while(r.rf12_hasdata()) { - 430: 33 9b sbis 0x06, 3 ; 6 - 432: fa cf rjmp .-12 ; 0x428 <_Z6recivev+0x2c> - 434: 80 e0 ldi r24, 0x00 ; 0 - 436: 90 eb ldi r25, 0xB0 ; 176 - 438: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - 43c: c8 2f mov r28, r24 - poll(); - } - uint8_t from = r.rf12_rxbyte(); - while(r.rf12_hasdata()) { - 43e: 02 c0 rjmp .+4 ; 0x444 <_Z6recivev+0x48> - poll(); - 440: 0e 94 b5 01 call 0x36a ; 0x36a <_Z4pollv> - 444: 0e 94 d9 00 call 0x1b2 ; 0x1b2 <_ZN6avrlib3pinINS_5portcELh4EE8make_lowEv> - if(addr == ALL || addr == DEVICE || addr == GROUP) { - while(r.rf12_hasdata()) { - poll(); - } - uint8_t from = r.rf12_rxbyte(); - while(r.rf12_hasdata()) { - 448: 33 9b sbis 0x06, 3 ; 6 - 44a: fa cf rjmp .-12 ; 0x440 <_Z6recivev+0x44> - poll(); - } - if(from == MASTER) { - 44c: c1 30 cpi r28, 0x01 ; 1 - 44e: 09 f0 breq .+2 ; 0x452 <_Z6recivev+0x56> - 450: 3f c0 rjmp .+126 ; 0x4d0 <_Z6recivev+0xd4> - 452: 80 e0 ldi r24, 0x00 ; 0 - 454: 90 eb ldi r25, 0xB0 ; 176 - 456: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - uint8_t data = r.rf12_rxbyte(); - switch(data) { - 45a: 84 30 cpi r24, 0x04 ; 4 - 45c: 49 f0 breq .+18 ; 0x470 <_Z6recivev+0x74> - 45e: 18 f4 brcc .+6 ; 0x466 <_Z6recivev+0x6a> - 460: 81 30 cpi r24, 0x01 ; 1 - 462: c9 f4 brne .+50 ; 0x496 <_Z6recivev+0x9a> - 464: 1d c0 rjmp .+58 ; 0x4a0 <_Z6recivev+0xa4> - 466: 85 30 cpi r24, 0x05 ; 5 - 468: 31 f0 breq .+12 ; 0x476 <_Z6recivev+0x7a> - 46a: 87 30 cpi r24, 0x07 ; 7 - 46c: a1 f4 brne .+40 ; 0x496 <_Z6recivev+0x9a> - 46e: 0a c0 rjmp .+20 ; 0x484 <_Z6recivev+0x88> - case PING: { - break; - } - case SETSLEEP: { - status = SLEEP; - 470: 82 e0 ldi r24, 0x02 ; 2 - 472: 90 e0 ldi r25, 0x00 ; 0 - 474: 02 c0 rjmp .+4 ; 0x47a <_Z6recivev+0x7e> - break; - } - case SETACTIVE: { - status = ACTIVE; - 476: 83 e0 ldi r24, 0x03 ; 3 - 478: 90 e0 ldi r25, 0x00 ; 0 - 47a: 90 93 01 01 sts 0x0101, r25 - 47e: 80 93 00 01 sts 0x0100, r24 - break; - 482: 0e c0 rjmp .+28 ; 0x4a0 <_Z6recivev+0xa4> - } + void send_packet(uint8_t data) { + 190: 26 2f mov r18, r22 + this->funk_send_packet(this->MASTER, this->DEVICE, data); + 192: dc 01 movw r26, r24 + 194: ed 91 ld r30, X+ + 196: fc 91 ld r31, X + 198: 04 84 ldd r0, Z+12 ; 0x0c + 19a: f5 85 ldd r31, Z+13 ; 0x0d + 19c: e0 2d mov r30, r0 + 19e: 4e e1 ldi r20, 0x1E ; 30 + 1a0: 61 e0 ldi r22, 0x01 ; 1 + 1a2: 09 94 ijmp - void rf12_endasyncrx() { - this->send(0x8208); // RX off - 484: 88 e0 ldi r24, 0x08 ; 8 - 486: 92 e8 ldi r25, 0x82 ; 130 - 488: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - } - case SETRUN: { - r.rf12_endasyncrx(); - turn(); - 48c: 0e 94 6b 01 call 0x2d6 ; 0x2d6 <_Z4turnv> - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); - return; - } - } -} - 490: cf 91 pop r28 - break; - } - case SETRUN: { - r.rf12_endasyncrx(); - turn(); - r.rf12_beginasyncrx(); - 492: 0c 94 01 01 jmp 0x202 ; 0x202 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE17rf12_beginasyncrxEv.isra.39> - 496: 88 e0 ldi r24, 0x08 ; 8 - 498: 92 e8 ldi r25, 0x82 ; 130 - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); - return; - } - } -} - 49a: cf 91 pop r28 - 49c: 0c 94 e1 00 jmp 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - 4a0: 88 e0 ldi r24, 0x08 ; 8 - 4a2: 92 e8 ldi r25, 0x82 ; 130 - 4a4: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> - 4a8: 2f ef ldi r18, 0xFF ; 255 - 4aa: 89 ef ldi r24, 0xF9 ; 249 - 4ac: 90 e0 ldi r25, 0x00 ; 0 - 4ae: 21 50 subi r18, 0x01 ; 1 - 4b0: 80 40 sbci r24, 0x00 ; 0 - 4b2: 90 40 sbci r25, 0x00 ; 0 - 4b4: e1 f7 brne .-8 ; 0x4ae <_Z6recivev+0xb2> - 4b6: 00 c0 rjmp .+0 ; 0x4b8 <_Z6recivev+0xbc> - 4b8: 00 00 nop - return; +000001a4 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv>: + + void hook_poll() + 1a4: cf 93 push r28 + 1a6: df 93 push r29 + 1a8: ec 01 movw r28, r24 + { + if(this->status == this->ACTIVE) { + 1aa: 8a 81 ldd r24, Y+2 ; 0x02 + 1ac: 83 30 cpi r24, 0x03 ; 3 + 1ae: d9 f4 brne .+54 ; 0x1e6 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x42> + if(mc.is_pressed()) { + 1b0: 4a 99 sbic 0x09, 2 ; 9 + 1b2: 19 c0 rjmp .+50 ; 0x1e6 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x42> + this->funk_end(); + 1b4: e8 81 ld r30, Y + 1b6: f9 81 ldd r31, Y+1 ; 0x01 + 1b8: 06 80 ldd r0, Z+6 ; 0x06 + 1ba: f7 81 ldd r31, Z+7 ; 0x07 + 1bc: e0 2d mov r30, r0 + 1be: ce 01 movw r24, r28 + 1c0: 09 95 icall + this->hook_turn(); + 1c2: e8 81 ld r30, Y + 1c4: f9 81 ldd r31, Y+1 ; 0x01 + 1c6: 01 90 ld r0, Z+ + 1c8: f0 81 ld r31, Z + 1ca: e0 2d mov r30, r0 + 1cc: ce 01 movw r24, r28 + 1ce: 09 95 icall + this->send_packet(this->RUN); + 1d0: 66 e0 ldi r22, 0x06 ; 6 + 1d2: ce 01 movw r24, r28 + 1d4: 0e 94 c8 00 call 0x190 ; 0x190 <_ZN4Snap11send_packetEh> + this->funk_begin(); + 1d8: e8 81 ld r30, Y + 1da: f9 81 ldd r31, Y+1 ; 0x01 + 1dc: 04 80 ldd r0, Z+4 ; 0x04 + 1de: f5 81 ldd r31, Z+5 ; 0x05 + 1e0: e0 2d mov r30, r0 + 1e2: ce 01 movw r24, r28 + 1e4: 09 95 icall } } - r.rf12_endasyncrx(); - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); - 4ba: 20 91 00 01 lds r18, 0x0100 - 4be: 30 91 01 01 lds r19, 0x0101 - 4c2: 4e e1 ldi r20, 0x1E ; 30 - 4c4: 61 e0 ldi r22, 0x01 ; 1 - 4c6: 82 e0 ldi r24, 0x02 ; 2 - 4c8: 91 e0 ldi r25, 0x01 ; 1 - return; - } - } -} - 4ca: cf 91 pop r28 - return; + if(this->status == this->SLEEP) { + 1e6: 8a 81 ldd r24, Y+2 ; 0x02 + 1e8: 82 30 cpi r24, 0x02 ; 2 + 1ea: a1 f4 brne .+40 ; 0x214 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x70> + if(mc.is_pressed()) { + 1ec: 4a 99 sbic 0x09, 2 ; 9 + 1ee: 12 c0 rjmp .+36 ; 0x214 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x70> + this->funk_end(); + 1f0: e8 81 ld r30, Y + 1f2: f9 81 ldd r31, Y+1 ; 0x01 + 1f4: 06 80 ldd r0, Z+6 ; 0x06 + 1f6: f7 81 ldd r31, Z+7 ; 0x07 + 1f8: e0 2d mov r30, r0 + 1fa: ce 01 movw r24, r28 + 1fc: 09 95 icall + this->send_packet(this->DEDECT); + 1fe: 68 e0 ldi r22, 0x08 ; 8 + 200: ce 01 movw r24, r28 + 202: 0e 94 c8 00 call 0x190 ; 0x190 <_ZN4Snap11send_packetEh> + this->funk_begin(); + 206: e8 81 ld r30, Y + 208: f9 81 ldd r31, Y+1 ; 0x01 + 20a: 04 80 ldd r0, Z+4 ; 0x04 + 20c: f5 81 ldd r31, Z+5 ; 0x05 + 20e: e0 2d mov r30, r0 + 210: ce 01 movw r24, r28 + 212: 09 95 icall + } + } + if(st.is_pressed()) { + 214: 4b 99 sbic 0x09, 3 ; 9 + 216: 12 c0 rjmp .+36 ; 0x23c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x98> + if(this->status == this->SLEEP) { + 218: 8a 81 ldd r24, Y+2 ; 0x02 + 21a: 82 30 cpi r24, 0x02 ; 2 + 21c: 79 f4 brne .+30 ; 0x23c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x98> + this->status = this->RUN; + 21e: 86 e0 ldi r24, 0x06 ; 6 + 220: 8a 83 std Y+2, r24 ; 0x02 + 222: 2f ef ldi r18, 0xFF ; 255 + 224: 3c e2 ldi r19, 0x2C ; 44 + 226: 81 e3 ldi r24, 0x31 ; 49 + 228: 91 e0 ldi r25, 0x01 ; 1 + 22a: 21 50 subi r18, 0x01 ; 1 + 22c: 30 40 sbci r19, 0x00 ; 0 + 22e: 80 40 sbci r24, 0x00 ; 0 + 230: 90 40 sbci r25, 0x00 ; 0 + 232: d9 f7 brne .-10 ; 0x22a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x86> + 234: 00 c0 rjmp .+0 ; 0x236 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv+0x92> + 236: 00 00 nop + _delay_ms(15000); + this->status = this->ACTIVE; + 238: 83 e0 ldi r24, 0x03 ; 3 + 23a: 8a 83 std Y+2, r24 ; 0x02 } } - r.rf12_endasyncrx(); - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); - 4cc: 0c 94 0d 01 jmp 0x21a ; 0x21a <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh> - return; } - } -} - 4d0: cf 91 pop r28 - 4d2: 08 95 ret + 23c: df 91 pop r29 + 23e: cf 91 pop r28 + 240: 08 95 ret -000004d4
: - -int main(void) { - l.color(l.RED); - 4d4: 82 e0 ldi r24, 0x02 ; 2 - 4d6: 0e 94 77 00 call 0xee ; 0xee <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11> - while(1) +00000242 <__vector_16>: { - recive(); - 4da: 0e 94 fe 01 call 0x3fc ; 0x3fc <_Z6recivev> - 4de: fd cf rjmp .-6 ; 0x4da + funk.worker(); + } +} -000004e0 <_GLOBAL__sub_I_l>: - 4e0: 57 9a sbi 0x0a, 7 ; 10 - 4e2: 56 9a sbi 0x0a, 6 ; 10 - static const uint8_t YELLOW = 3; - private: - void init() { - red::make_output(); - green::make_output(); - color(BLACK); - 4e4: 80 e0 ldi r24, 0x00 ; 0 - 4e6: 0e 94 77 00 call 0xee ; 0xee <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11> - static const uint16_t MIDDLE = s_middle; - static const uint16_t RIGHT = s_right; - private: - uint8_t servopos; - void init() { - this->servopos = 0; - 4ea: 10 92 05 01 sts 0x0105, r1 - 4ee: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.2> - 4f2: 29 98 cbi 0x05, 1 ; 5 - 4f4: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.2> +ISR(TIMER0_OVF_vect) { + 242: 1f 92 push r1 + 244: 0f 92 push r0 + 246: 0f b6 in r0, 0x3f ; 63 + 248: 0f 92 push r0 + 24a: 11 24 eor r1, r1 + 24c: 2f 93 push r18 + 24e: 3f 93 push r19 + 250: 4f 93 push r20 + 252: 5f 93 push r21 + 254: 6f 93 push r22 + 256: 7f 93 push r23 + 258: 8f 93 push r24 + 25a: 9f 93 push r25 + 25c: af 93 push r26 + 25e: bf 93 push r27 + 260: ef 93 push r30 + 262: ff 93 push r31 + volatile uint8_t status; + Funk() { + this->init(); + } + void timer() { + if(this->status == this->SLEEP) { + 264: 80 91 14 01 lds r24, 0x0114 + 268: 82 30 cpi r24, 0x02 ; 2 + 26a: 11 f4 brne .+4 ; 0x270 <__vector_16+0x2e> + led.color(led.GREEN); + 26c: 81 e0 ldi r24, 0x01 ; 1 + 26e: 0b c0 rjmp .+22 ; 0x286 <__vector_16+0x44> + } else if(this->status == this->ACTIVE) { + 270: 80 91 14 01 lds r24, 0x0114 + 274: 83 30 cpi r24, 0x03 ; 3 + 276: 11 f4 brne .+4 ; 0x27c <__vector_16+0x3a> + led.color(led.RED); + 278: 82 e0 ldi r24, 0x02 ; 2 + 27a: 05 c0 rjmp .+10 ; 0x286 <__vector_16+0x44> + } else if(this->status == this->RUN) { + 27c: 80 91 14 01 lds r24, 0x0114 + 280: 86 30 cpi r24, 0x06 ; 6 + 282: 19 f4 brne .+6 ; 0x28a <__vector_16+0x48> + led.color(led.YELLOW); + 284: 83 e0 ldi r24, 0x03 ; 3 + 286: 0e 94 79 00 call 0xf2 ; 0xf2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6> + } + void off() { + servo_act::make_low(); + } + void timer() { + TCNT0 = 0x64; // Reinitialize Timer 0 value + 28a: 84 e6 ldi r24, 0x64 ; 100 + 28c: 86 bd out 0x26, r24 ; 38 + 28e: 2a 9a sbi 0x05, 2 ; 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; } - 4f8: 22 9a sbi 0x04, 2 ; 4 - // Clock value: 7,813 kHz - // Mode: Normal top=0xFF - // OC0A output: Disconnected - // OC0B output: Disconnected - // Timer Period: 19,968 ms - TCCR0A=(0<servopos = 0; - servo_act::make_output(); - servo_act::make_low(); - servo_io::make_output(); - this->init_timer(); - sei(); - 50e: 78 94 sei - 510: 53 98 cbi 0x0a, 3 ; 10 + __builtin_avr_delay_cycles(__ticks_dc); + 292: 8f ef ldi r24, 0xFF ; 255 + 294: 94 e0 ldi r25, 0x04 ; 4 + 296: 01 97 sbiw r24, 0x01 ; 1 + 298: f1 f7 brne .-4 ; 0x296 <__vector_16+0x54> + 29a: 00 c0 rjmp .+0 ; 0x29c <__vector_16+0x5a> + 29c: 00 00 nop + servo_io::make_high(); + _delay_us(s_left); + for(uint16_t i = 0; i < servopos; i++) { + 29e: 80 e0 ldi r24, 0x00 ; 0 + 2a0: 90 e0 ldi r25, 0x00 ; 0 + 2a2: 05 c0 rjmp .+10 ; 0x2ae <__vector_16+0x6c> + 2a4: 25 e1 ldi r18, 0x15 ; 21 + 2a6: 2a 95 dec r18 + 2a8: f1 f7 brne .-4 ; 0x2a6 <__vector_16+0x64> + 2aa: 00 00 nop + 2ac: 01 96 adiw r24, 0x01 ; 1 + 2ae: 20 91 17 01 lds r18, 0x0117 + 2b2: 30 e0 ldi r19, 0x00 ; 0 + 2b4: 82 17 cp r24, r18 + 2b6: 93 07 cpc r25, r19 + 2b8: a8 f3 brcs .-22 ; 0x2a4 <__vector_16+0x62> +namespace avrlib { + + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 2ba: 2a 98 cbi 0x05, 2 ; 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; } + 2bc: 22 9a sbi 0x04, 2 ; 4 + funk.timer(); + 2be: ff 91 pop r31 + 2c0: ef 91 pop r30 + 2c2: bf 91 pop r27 + 2c4: af 91 pop r26 + 2c6: 9f 91 pop r25 + 2c8: 8f 91 pop r24 + 2ca: 7f 91 pop r23 + 2cc: 6f 91 pop r22 + 2ce: 5f 91 pop r21 + 2d0: 4f 91 pop r20 + 2d2: 3f 91 pop r19 + 2d4: 2f 91 pop r18 + 2d6: 0f 90 pop r0 + 2d8: 0f be out 0x3f, r0 ; 63 + 2da: 0f 90 pop r0 + 2dc: 1f 90 pop r1 + 2de: 18 95 reti + +000002e0 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv>: + } + servo.timer(); + } + void worker() { + 2e0: cf 92 push r12 + 2e2: df 92 push r13 + 2e4: ef 92 push r14 + 2e6: ff 92 push r15 + 2e8: 0f 93 push r16 + 2ea: 1f 93 push r17 + 2ec: cf 93 push r28 + 2ee: df 93 push r29 + 2f0: 00 d0 rcall .+0 ; 0x2f2 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x12> + 2f2: 1f 92 push r1 + 2f4: cd b7 in r28, 0x3d ; 61 + 2f6: de b7 in r29, 0x3e ; 62 + 2f8: 8c 01 movw r16, r24 + for(uint8_t i=0;iDEVICE;i++) { + _delay_ms(5); + } + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + 2fa: dc 01 movw r26, r24 + 2fc: ed 91 ld r30, X+ + 2fe: fc 91 ld r31, X + 300: 04 80 ldd r0, Z+4 ; 0x04 + 302: f5 81 ldd r31, Z+5 ; 0x05 + 304: e0 2d mov r30, r0 + 306: 09 95 icall + 308: ee 24 eor r14, r14 + 30a: e3 94 inc r14 + 30c: f1 2c mov r15, r1 + 30e: ec 0e add r14, r28 + 310: fd 1e adc r15, r29 + 312: 6e 01 movw r12, r28 + 314: b4 e0 ldi r27, 0x04 ; 4 + 316: cb 0e add r12, r27 + 318: d1 1c adc r13, r1 + 31a: 05 c0 rjmp .+10 ; 0x326 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x46> + for (uint8_t i = 0; i < len; i++) + { + while(this->funk_has_data()) { + this->hook_poll(); + 31c: 02 80 ldd r0, Z+2 ; 0x02 + 31e: f3 81 ldd r31, Z+3 ; 0x03 + 320: e0 2d mov r30, r0 + 322: c8 01 movw r24, r16 + 324: 09 95 icall + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + for (uint8_t i = 0; i < len; i++) + { + while(this->funk_has_data()) { + 326: d8 01 movw r26, r16 + 328: ed 91 ld r30, X+ + 32a: fc 91 ld r31, X + 32c: 00 84 ldd r0, Z+8 ; 0x08 + 32e: f1 85 ldd r31, Z+9 ; 0x09 + 330: e0 2d mov r30, r0 + 332: c8 01 movw r24, r16 + 334: 09 95 icall + 336: d8 01 movw r26, r16 + 338: ed 91 ld r30, X+ + 33a: fc 91 ld r31, X + 33c: 81 11 cpse r24, r1 + 33e: ee cf rjmp .-36 ; 0x31c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x3c> + this->hook_poll(); + } + data[i] = this->funk_get_byte(); + 340: 02 84 ldd r0, Z+10 ; 0x0a + 342: f3 85 ldd r31, Z+11 ; 0x0b + 344: e0 2d mov r30, r0 + 346: c8 01 movw r24, r16 + 348: 09 95 icall + 34a: f7 01 movw r30, r14 + 34c: 81 93 st Z+, r24 + 34e: 7f 01 movw r14, r30 + _delay_ms(5); + } + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + for (uint8_t i = 0; i < len; i++) + 350: ec 15 cp r30, r12 + 352: fd 05 cpc r31, r13 + 354: 41 f7 brne .-48 ; 0x326 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x46> + while(this->funk_has_data()) { + this->hook_poll(); + } + data[i] = this->funk_get_byte(); + } + this->funk_end(); + 356: d8 01 movw r26, r16 + 358: ed 91 ld r30, X+ + 35a: fc 91 ld r31, X + 35c: 06 80 ldd r0, Z+6 ; 0x06 + 35e: f7 81 ldd r31, Z+7 ; 0x07 + 360: e0 2d mov r30, r0 + 362: c8 01 movw r24, r16 + 364: 09 95 icall + uint8_t data[3]; + this->get_packet(data, 3); + if(data[0] == ALL || data[0] == DEVICE || data[0] == GROUP) { + 366: 89 81 ldd r24, Y+1 ; 0x01 + 368: 88 23 and r24, r24 + 36a: 29 f0 breq .+10 ; 0x376 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x96> + 36c: 8e 31 cpi r24, 0x1E ; 30 + 36e: 19 f0 breq .+6 ; 0x376 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x96> + 370: 80 3f cpi r24, 0xF0 ; 240 + 372: 09 f0 breq .+2 ; 0x376 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x96> + 374: 42 c0 rjmp .+132 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + if(data[1] == this->MASTER) { + 376: 8a 81 ldd r24, Y+2 ; 0x02 + 378: 81 30 cpi r24, 0x01 ; 1 + 37a: 09 f0 breq .+2 ; 0x37e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x9e> + 37c: 3e c0 rjmp .+124 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + switch(data[2]) { + 37e: 8b 81 ldd r24, Y+3 ; 0x03 + 380: 84 30 cpi r24, 0x04 ; 4 + 382: 49 f0 breq .+18 ; 0x396 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xb6> + 384: 18 f4 brcc .+6 ; 0x38c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xac> + 386: 81 30 cpi r24, 0x01 ; 1 + 388: c1 f5 brne .+112 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + 38a: 18 c0 rjmp .+48 ; 0x3bc <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xdc> + 38c: 85 30 cpi r24, 0x05 ; 5 + 38e: 39 f0 breq .+14 ; 0x39e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xbe> + 390: 87 30 cpi r24, 0x07 ; 7 + 392: 99 f5 brne .+102 ; 0x3fa <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0x11a> + 394: 09 c0 rjmp .+18 ; 0x3a8 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xc8> + case this->PING: { + break; + } + case this->SETSLEEP: { + this->status = this->SLEEP; + 396: 82 e0 ldi r24, 0x02 ; 2 + 398: f8 01 movw r30, r16 + 39a: 82 83 std Z+2, r24 ; 0x02 + break; + 39c: 0f c0 rjmp .+30 ; 0x3bc <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xdc> + } + case this->SETACTIVE: { + this->status = this->ACTIVE; + 39e: 83 e0 ldi r24, 0x03 ; 3 + 3a0: d8 01 movw r26, r16 + 3a2: 12 96 adiw r26, 0x02 ; 2 + 3a4: 8c 93 st X, r24 + break; + 3a6: 0a c0 rjmp .+20 ; 0x3bc <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xdc> + } + case this->SETRUN: { + this->hook_turn(); + 3a8: d8 01 movw r26, r16 + 3aa: ed 91 ld r30, X+ + 3ac: fc 91 ld r31, X + 3ae: 01 90 ld r0, Z+ + 3b0: f0 81 ld r31, Z + 3b2: e0 2d mov r30, r0 + 3b4: c8 01 movw r24, r16 + 3b6: 09 95 icall + this->send_packet(this->RUN); + 3b8: 66 e0 ldi r22, 0x06 ; 6 + 3ba: 11 c0 rjmp .+34 ; 0x3de <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xfe> + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + 3bc: ef e1 ldi r30, 0x1F ; 31 + 3be: fe e4 ldi r31, 0x4E ; 78 + 3c0: 31 97 sbiw r30, 0x01 ; 1 + 3c2: f1 f7 brne .-4 ; 0x3c0 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xe0> + 3c4: 00 c0 rjmp .+0 ; 0x3c6 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xe6> + 3c6: 00 00 nop + 3c8: 8e e1 ldi r24, 0x1E ; 30 + 3ca: af e0 ldi r26, 0x0F ; 15 + 3cc: b7 e2 ldi r27, 0x27 ; 39 + 3ce: 11 97 sbiw r26, 0x01 ; 1 + 3d0: f1 f7 brne .-4 ; 0x3ce <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xee> + 3d2: 00 c0 rjmp .+0 ; 0x3d4 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xf4> + 3d4: 00 00 nop + 3d6: 81 50 subi r24, 0x01 ; 1 + virtual uint8_t funk_get_byte() = 0; + virtual void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) = 0; + + void wait() { + _delay_ms(10); + for(uint8_t i=0;iDEVICE;i++) { + 3d8: c1 f7 brne .-16 ; 0x3ca <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv+0xea> + default: { + return; + } + } + this->wait(); + this->send_packet(this->status); + 3da: f8 01 movw r30, r16 + 3dc: 62 81 ldd r22, Z+2 ; 0x02 + 3de: c8 01 movw r24, r16 + return; + } + } + } + 3e0: 0f 90 pop r0 + 3e2: 0f 90 pop r0 + 3e4: 0f 90 pop r0 + 3e6: df 91 pop r29 + 3e8: cf 91 pop r28 + 3ea: 1f 91 pop r17 + 3ec: 0f 91 pop r16 + 3ee: ff 90 pop r15 + 3f0: ef 90 pop r14 + 3f2: df 90 pop r13 + 3f4: cf 90 pop r12 + default: { + return; + } + } + this->wait(); + this->send_packet(this->status); + 3f6: 0c 94 c8 00 jmp 0x190 ; 0x190 <_ZN4Snap11send_packetEh> + return; + } + } + } + 3fa: 0f 90 pop r0 + 3fc: 0f 90 pop r0 + 3fe: 0f 90 pop r0 + 400: df 91 pop r29 + 402: cf 91 pop r28 + 404: 1f 91 pop r17 + 406: 0f 91 pop r16 + 408: ff 90 pop r15 + 40a: ef 90 pop r14 + 40c: df 90 pop r13 + 40e: cf 90 pop r12 + 410: 08 95 ret + +00000412
: +funkclass funk; + +int main(void) { + while(1) + { + funk.worker(); + 412: 82 e1 ldi r24, 0x12 ; 18 + 414: 91 e0 ldi r25, 0x01 ; 1 + 416: 0e 94 70 01 call 0x2e0 ; 0x2e0 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv> + 41a: fb cf rjmp .-10 ; 0x412
+ +0000041c <_ZN6avrlib3pinINS_5portcELh4EE5clearEv>: +namespace avrlib { + + struct portc + { + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + 41c: 44 98 cbi 0x08, 4 ; 8 + 41e: 08 95 ret + +00000420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42>: + + static bool output() { return (Port::dir() & (1< + 424: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + this->init(); + } + + void ready(void) { + s.CSOn(); + while(s.has_data()); // wait until FIFO ready + 428: 33 9b sbis 0x06, 3 ; 6 + 42a: fe cf rjmp .-4 ; 0x428 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42+0x8> + } + 42c: 08 95 ret + +0000042e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31>: + this->send(0x8208); // TX off + _delay_ms(100); + } + private: + Spi s; + uint16_t send(uint16_t wert) { + 42e: ef 92 push r14 + 430: ff 92 push r15 + 432: 1f 93 push r17 + 434: cf 93 push r28 + 436: df 93 push r29 + 438: 00 d0 rcall .+0 ; 0x43a <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31+0xc> + 43a: cd b7 in r28, 0x3d ; 61 + 43c: de b7 in r29, 0x3e ; 62 + 43e: 18 2f mov r17, r24 + 440: 9a 83 std Y+2, r25 ; 0x02 + 442: 0e 94 0e 02 call 0x41c ; 0x41c <_ZN6avrlib3pinINS_5portcELh4EE5clearEv> + 446: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + } + uint8_t send(uint8_t data) { + if(mode == 0) { + return this->send_hard(data); + } + return this->send_soft(data); + 44a: 8a 81 ldd r24, Y+2 ; 0x02 + 44c: 0e 94 63 00 call 0xc6 ; 0xc6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29> + s.CSOn(); + uint16_t werti = s.send((uint8_t)(wert >> 8)) << 8; + 450: f8 2e mov r15, r24 + 452: e1 2c mov r14, r1 + 454: 81 2f mov r24, r17 + 456: 0e 94 63 00 call 0xc6 ; 0xc6 <_ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29> + werti |= s.send((uint8_t)wert); + 45a: 97 01 movw r18, r14 + 45c: 28 2b or r18, r24 + 45e: c9 01 movw r24, r18 + 460: 44 9a sbi 0x08, 4 ; 8 + 462: 8a 83 std Y+2, r24 ; 0x02 + 464: 99 83 std Y+1, r25 ; 0x01 + 466: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + s.CSOff(); + return werti; + } + 46a: 8a 81 ldd r24, Y+2 ; 0x02 + 46c: 99 81 ldd r25, Y+1 ; 0x01 + 46e: 0f 90 pop r0 + 470: 0f 90 pop r0 + 472: df 91 pop r29 + 474: cf 91 pop r28 + 476: 1f 91 pop r17 + 478: ff 90 pop r15 + 47a: ef 90 pop r14 + 47c: 08 95 ret + +0000047e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev>: + +template +class Funk : public Snap { + public: + volatile uint8_t status; + Funk() { + 47e: cf 93 push r28 + 480: df 93 push r29 + 482: ec 01 movw r28, r24 + 484: 84 e0 ldi r24, 0x04 ; 4 + 486: 91 e0 ldi r25, 0x01 ; 1 + 488: 99 83 std Y+1, r25 ; 0x01 + 48a: 88 83 st Y, r24 + 48c: 53 98 cbi 0x0a, 3 ; 10 namespace avrlib { struct portd { static uint8_t port() { return PORTD; } static void port(uint8_t v) { PORTD = v; } - 512: 5b 98 cbi 0x0b, 3 ; 11 - 514: 5b 9a sbi 0x0b, 3 ; 11 + 48e: 5b 98 cbi 0x0b, 3 ; 11 + 490: 5b 9a sbi 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; } - 516: 52 98 cbi 0x0a, 2 ; 10 + 492: 52 98 cbi 0x0a, 2 ; 10 namespace avrlib { struct portd { static uint8_t port() { return PORTD; } static void port(uint8_t v) { PORTD = v; } - 518: 5a 98 cbi 0x0b, 2 ; 11 - 51a: 5a 9a sbi 0x0b, 2 ; 11 + 494: 5a 98 cbi 0x0b, 2 ; 11 + 496: 5a 9a sbi 0x0b, 2 ; 11 + static const uint16_t MIDDLE = s_middle; + static const uint16_t RIGHT = s_right; + private: + uint8_t servopos; + void init() { + this->servopos = 0; + 498: 1d 82 std Y+5, r1 ; 0x05 + 49a: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10> namespace avrlib { - struct portc + struct portb { - static uint8_t port() { return PORTC; } - static void port(uint8_t v) { PORTC = v; } - 51c: 40 98 cbi 0x08, 0 ; 8 + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 49e: 29 98 cbi 0x05, 1 ; 5 + 4a0: 0e 94 5f 00 call 0xbe ; 0xbe <_ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.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; } + 4a4: 22 9a sbi 0x04, 2 ; 4 + // Clock value: 7,813 kHz + // Mode: Normal top=0xFF + // OC0A output: Disconnected + // OC0B output: Disconnected + // Timer Period: 19,968 ms + TCCR0A=(0<servopos = 0; + servo_act::make_output(); + servo_act::make_low(); + servo_io::make_output(); + this->init_timer(); + sei(); + 4ba: 78 94 sei + + 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; } + 4bc: 57 9a sbi 0x0a, 7 ; 10 + 4be: 56 9a sbi 0x0a, 6 ; 10 + static const uint8_t YELLOW = 3; + private: + void init() { + red::make_output(); + green::make_output(); + color(BLACK); + 4c0: 80 e0 ldi r24, 0x00 ; 0 + 4c2: 0e 94 79 00 call 0xf2 ; 0xf2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6> + 4c6: 40 98 cbi 0x08, 0 ; 8 static uint8_t pin() { return PINC; } static void pin(uint8_t v) { PINC = v; } static uint8_t dir() { return DDRC; } static void dir(uint8_t v) { DDRC = v; } - 51e: 38 9a sbi 0x07, 0 ; 7 + 4c8: 38 9a sbi 0x07, 0 ; 7 namespace avrlib { struct portc { static uint8_t port() { return PORTC; } static void port(uint8_t v) { PORTC = v; } - 520: 41 98 cbi 0x08, 1 ; 8 + 4ca: 41 98 cbi 0x08, 1 ; 8 static uint8_t pin() { return PINC; } static void pin(uint8_t v) { PINC = v; } static uint8_t dir() { return DDRC; } static void dir(uint8_t v) { DDRC = v; } - 522: 39 9a sbi 0x07, 1 ; 7 + 4cc: 39 9a sbi 0x07, 1 ; 7 namespace avrlib { struct portc { static uint8_t port() { return PORTC; } static void port(uint8_t v) { PORTC = v; } - 524: 44 9a sbi 0x08, 4 ; 8 + 4ce: 44 9a sbi 0x08, 4 ; 8 + 4d0: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> static uint8_t pin() { return PINC; } static void pin(uint8_t v) { PINC = v; } static uint8_t dir() { return DDRC; } static void dir(uint8_t v) { DDRC = v; } - 526: 3c 9a sbi 0x07, 4 ; 7 - 528: 3b 98 cbi 0x07, 3 ; 7 + 4d4: 3b 98 cbi 0x07, 3 ; 7 namespace avrlib { struct portc { static uint8_t port() { return PORTC; } static void port(uint8_t v) { PORTC = v; } - 52a: 43 98 cbi 0x08, 3 ; 8 - 52c: 2f ef ldi r18, 0xFF ; 255 - 52e: 80 e7 ldi r24, 0x70 ; 112 - 530: 92 e0 ldi r25, 0x02 ; 2 - 532: 21 50 subi r18, 0x01 ; 1 - 534: 80 40 sbci r24, 0x00 ; 0 - 536: 90 40 sbci r25, 0x00 ; 0 - 538: e1 f7 brne .-8 ; 0x532 <__stack+0x33> - 53a: 00 c0 rjmp .+0 ; 0x53c <__stack+0x3d> - 53c: 00 00 nop - return werti; - } + 4d6: 43 98 cbi 0x08, 3 ; 8 + 4d8: 2f ef ldi r18, 0xFF ; 255 + 4da: 80 e7 ldi r24, 0x70 ; 112 + 4dc: 92 e0 ldi r25, 0x02 ; 2 + 4de: 21 50 subi r18, 0x01 ; 1 + 4e0: 80 40 sbci r24, 0x00 ; 0 + 4e2: 90 40 sbci r25, 0x00 ; 0 + 4e4: e1 f7 brne .-8 ; 0x4de <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev+0x60> + 4e6: 00 c0 rjmp .+0 ; 0x4e8 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev+0x6a> + 4e8: 00 00 nop void init(void) { _delay_ms(100); this->send(0xC0E0); // AVR CLK: 10MHz - 53e: 80 ee ldi r24, 0xE0 ; 224 - 540: 90 ec ldi r25, 0xC0 ; 192 - 542: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 4ea: 80 ee ldi r24, 0xE0 ; 224 + 4ec: 90 ec ldi r25, 0xC0 ; 192 + 4ee: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->send(0x80D7); // Enable FIFO - 546: 87 ed ldi r24, 0xD7 ; 215 - 548: 90 e8 ldi r25, 0x80 ; 128 - 54a: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 4f2: 87 ed ldi r24, 0xD7 ; 215 + 4f4: 90 e8 ldi r25, 0x80 ; 128 + 4f6: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->send(0xC2AB); // Data Filter: internal - 54e: 8b ea ldi r24, 0xAB ; 171 - 550: 92 ec ldi r25, 0xC2 ; 194 - 552: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 4fa: 8b ea ldi r24, 0xAB ; 171 + 4fc: 92 ec ldi r25, 0xC2 ; 194 + 4fe: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->send(0xCA81); // Set FIFO mode - 556: 81 e8 ldi r24, 0x81 ; 129 - 558: 9a ec ldi r25, 0xCA ; 202 - 55a: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 502: 81 e8 ldi r24, 0x81 ; 129 + 504: 9a ec ldi r25, 0xCA ; 202 + 506: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->send(0xE000); // disable wakeuptimer - 55e: 80 e0 ldi r24, 0x00 ; 0 - 560: 90 ee ldi r25, 0xE0 ; 224 - 562: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 50a: 80 e0 ldi r24, 0x00 ; 0 + 50c: 90 ee ldi r25, 0xE0 ; 224 + 50e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->send(0xC800); // disable low duty cycle - 566: 80 e0 ldi r24, 0x00 ; 0 - 568: 98 ec ldi r25, 0xC8 ; 200 - 56a: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 512: 80 e0 ldi r24, 0x00 ; 0 + 514: 98 ec ldi r25, 0xC8 ; 200 + 516: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->send(0xC4F7); // AFC settings: autotuning: -10kHz...+7,5kHz - 56e: 87 ef ldi r24, 0xF7 ; 247 - 570: 94 ec ldi r25, 0xC4 ; 196 - 572: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 51a: 87 ef ldi r24, 0xF7 ; 247 + 51c: 94 ec ldi r25, 0xC4 ; 196 + 51e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> if( freq < 96 ) { // 430,2400MHz this->send( 0xA000 | 96 ); } else if( freq > 3903 ) { // 439,7575MHz this->send( 0xA000 | 3903 ); } this->send( 0xA000 | freq ); - 576: 80 e2 ldi r24, 0x20 ; 32 - 578: 96 ea ldi r25, 0xA6 ; 166 - 57a: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 522: 80 e2 ldi r24, 0x20 ; 32 + 524: 96 ea ldi r25, 0xA6 ; 166 + 526: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> this->setbandwidth(); // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm this->setbaud(); // 19200 baud this->setpower(); // 1mW Ausgangsleistung, 120kHz Frequenzshift } void setbandwidth() { this->send( 0x9400 | ( ( bandwidth & 7 ) << 5 ) | ( ( gain & 3 ) << 3 ) | ( drssi & 7 ) ); - 57e: 87 e2 ldi r24, 0x27 ; 39 - 580: 94 e9 ldi r25, 0x94 ; 148 - 582: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 52a: 87 e2 ldi r24, 0x27 ; 39 + 52c: 94 e9 ldi r25, 0x94 ; 148 + 52e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> return; } if (baud < 5400) { // Baudrate= 344827,58621/(R+1)/(1+CS*7) this->send(0xC680 | ( ( 43104 / baud ) - 1 ) ); } else { this->send(0xC600 | ( ( 344828UL / baud ) - 1 ) ); - 586: 82 e2 ldi r24, 0x22 ; 34 - 588: 96 ec ldi r25, 0xC6 ; 198 - 58a: 0e 94 e1 00 call 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 532: 82 e2 ldi r24, 0x22 ; 34 + 534: 96 ec ldi r25, 0xC6 ; 198 + 536: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> } } void setpower() { this->send( 0x9800 | ( power & 7 ) | ( ( mod & 15 ) << 4 ) ); - 58e: 80 e6 ldi r24, 0x60 ; 96 - 590: 98 e9 ldi r25, 0x98 ; 152 - 592: 0c 94 e1 00 jmp 0x1c2 ; 0x1c2 <_ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32> + 53a: 80 e6 ldi r24, 0x60 ; 96 + 53c: 98 e9 ldi r25, 0x98 ; 152 + 53e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + Servo servo; + Led led; + Rfm12 rfm12; + void init() + { + led.color(led.RED); + 542: 82 e0 ldi r24, 0x02 ; 2 + 544: 0e 94 79 00 call 0xf2 ; 0xf2 <_ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6> + this->status = this->SLEEP; + 548: 82 e0 ldi r24, 0x02 ; 2 + 54a: 8a 83 std Y+2, r24 ; 0x02 +class Funk : public Snap { + public: + volatile uint8_t status; + Funk() { + this->init(); + } + 54c: df 91 pop r29 + 54e: cf 91 pop r28 + 550: 08 95 ret -00000596 <__tablejump2__>: - 596: ee 0f add r30, r30 - 598: ff 1f adc r31, r31 +00000552 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE10funk_beginEv>: + s.CSOn(); + while(s.has_data()); // wait until FIFO ready + } -0000059a <__tablejump__>: - 59a: 05 90 lpm r0, Z+ - 59c: f4 91 lpm r31, Z - 59e: e0 2d mov r30, r0 - 5a0: 09 94 ijmp + void beginasyncrx() { + this->send(0x82C8); // RX on + 552: 88 ec ldi r24, 0xC8 ; 200 + 554: 92 e8 ldi r25, 0x82 ; 130 + 556: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xCA81); // set FIFO mode + 55a: 81 e8 ldi r24, 0x81 ; 129 + 55c: 9a ec ldi r25, 0xCA ; 202 + 55e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->send(0xCA83); // enable FIFO + 562: 83 e8 ldi r24, 0x83 ; 131 + 564: 9a ec ldi r25, 0xCA ; 202 + 566: 0c 94 17 02 jmp 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> -000005a2 <_exit>: - 5a2: f8 94 cli +0000056a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE8funk_endEv>: + uint8_t rxbyte() { + return this->send(0xB000); + } -000005a4 <__stop_program>: - 5a4: ff cf rjmp .-2 ; 0x5a4 <__stop_program> + void endasyncrx() { + this->send(0x8208); // RX off + 56a: 88 e0 ldi r24, 0x08 ; 8 + 56c: 92 e8 ldi r25, 0x82 ; 130 + 56e: 0c 94 17 02 jmp 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + +00000572 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_get_byteEv>: + s.CSOn(); + return s.has_data(); + } + + uint8_t rxbyte() { + return this->send(0xB000); + 572: 80 e0 ldi r24, 0x00 ; 0 + 574: 90 eb ldi r25, 0xB0 ; 176 + 576: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + uint8_t funk_has_data() { + return rfm12.hasdata(); + } + uint8_t funk_get_byte() { + return rfm12.rxbyte(); + } + 57a: 08 95 ret + +0000057c <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh>: + void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) { + 57c: cf 93 push r28 + 57e: df 93 push r29 + 580: 00 d0 rcall .+0 ; 0x582 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh+0x6> + 582: 1f 92 push r1 + 584: cd b7 in r28, 0x3d ; 61 + 586: de b7 in r29, 0x3e ; 62 + } + this->send(0x8208); // RX off + } + + void txpacket(uint8_t addr, uint8_t from, uint8_t data) { + this->send(0x8238); // TX on + 588: 88 e3 ldi r24, 0x38 ; 56 + 58a: 92 e8 ldi r25, 0x82 ; 130 + 58c: 2b 83 std Y+3, r18 ; 0x03 + 58e: 4a 83 std Y+2, r20 ; 0x02 + 590: 69 83 std Y+1, r22 ; 0x01 + 592: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 596: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8AA); + 59a: 8a ea ldi r24, 0xAA ; 170 + 59c: 98 eb ldi r25, 0xB8 ; 184 + 59e: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5a2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8AA); + 5a6: 8a ea ldi r24, 0xAA ; 170 + 5a8: 98 eb ldi r25, 0xB8 ; 184 + 5aa: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5ae: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8AA); + 5b2: 8a ea ldi r24, 0xAA ; 170 + 5b4: 98 eb ldi r25, 0xB8 ; 184 + 5b6: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5ba: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB82D); + 5be: 8d e2 ldi r24, 0x2D ; 45 + 5c0: 98 eb ldi r25, 0xB8 ; 184 + 5c2: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5c6: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB8D4); + 5ca: 84 ed ldi r24, 0xD4 ; 212 + 5cc: 98 eb ldi r25, 0xB8 ; 184 + 5ce: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5d2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800|addr); + 5d6: 69 81 ldd r22, Y+1 ; 0x01 + 5d8: 86 2f mov r24, r22 + 5da: 90 e0 ldi r25, 0x00 ; 0 + 5dc: 98 6b ori r25, 0xB8 ; 184 + 5de: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5e2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800|from); + 5e6: 4a 81 ldd r20, Y+2 ; 0x02 + 5e8: 84 2f mov r24, r20 + 5ea: 90 e0 ldi r25, 0x00 ; 0 + 5ec: 98 6b ori r25, 0xB8 ; 184 + 5ee: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 5f2: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800|data); + 5f6: 2b 81 ldd r18, Y+3 ; 0x03 + 5f8: 82 2f mov r24, r18 + 5fa: 90 e0 ldi r25, 0x00 ; 0 + 5fc: 98 6b ori r25, 0xB8 ; 184 + 5fe: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 602: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0xB800); + 606: 80 e0 ldi r24, 0x00 ; 0 + 608: 98 eb ldi r25, 0xB8 ; 184 + 60a: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + this->ready(); + 60e: 0e 94 10 02 call 0x420 ; 0x420 <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42> + this->send(0x8208); // TX off + 612: 88 e0 ldi r24, 0x08 ; 8 + 614: 92 e8 ldi r25, 0x82 ; 130 + 616: 0e 94 17 02 call 0x42e ; 0x42e <_ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31> + 61a: 2f ef ldi r18, 0xFF ; 255 + 61c: 80 e7 ldi r24, 0x70 ; 112 + 61e: 92 e0 ldi r25, 0x02 ; 2 + 620: 21 50 subi r18, 0x01 ; 1 + 622: 80 40 sbci r24, 0x00 ; 0 + 624: 90 40 sbci r25, 0x00 ; 0 + 626: e1 f7 brne .-8 ; 0x620 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh+0xa4> + 628: 00 c0 rjmp .+0 ; 0x62a <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh+0xae> + 62a: 00 00 nop + rfm12.txpacket(addr, from, data); + } + 62c: 0f 90 pop r0 + 62e: 0f 90 pop r0 + 630: 0f 90 pop r0 + 632: df 91 pop r29 + 634: cf 91 pop r28 + 636: 08 95 ret + +00000638 <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_has_dataEv>: + 638: 0e 94 0e 02 call 0x41c ; 0x41c <_ZN6avrlib3pinINS_5portcELh4EE5clearEv> + 63c: 0e 94 61 00 call 0xc2 ; 0xc2 <_ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22> + + static uint8_t pin() { return PINC; } + 640: 86 b1 in r24, 0x06 ; 6 + } + uint8_t has_data() { + return !miso::read(); + 642: 83 fb bst r24, 3 + 644: 88 27 eor r24, r24 + 646: 80 f9 bld r24, 0 + void funk_end() { + rfm12.endasyncrx(); + } + uint8_t funk_has_data() { + return rfm12.hasdata(); + } + 648: 91 e0 ldi r25, 0x01 ; 1 + 64a: 89 27 eor r24, r25 + 64c: 08 95 ret + +0000064e <_GLOBAL__sub_I_funk>: + moveclass, //Bewegungsmelder + startclass, //Startknopf + servoclass, //Servo + ledclass //LED +> funkclass; +funkclass funk; + 64e: 82 e1 ldi r24, 0x12 ; 18 + 650: 91 e0 ldi r25, 0x01 ; 1 + 652: 0c 94 3f 02 jmp 0x47e ; 0x47e <_ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev> + +00000656 <__tablejump2__>: + 656: ee 0f add r30, r30 + 658: ff 1f adc r31, r31 + +0000065a <__tablejump__>: + 65a: 05 90 lpm r0, Z+ + 65c: f4 91 lpm r31, Z + 65e: e0 2d mov r30, r0 + 660: 09 94 ijmp + +00000662 <_exit>: + 662: f8 94 cli + +00000664 <__stop_program>: + 664: ff cf rjmp .-2 ; 0x664 <__stop_program> diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map index 4705120..14f37b7 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.map @@ -16,7 +16,20 @@ Discarded input sections .bss 0x00000000 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/avr5/crtm168a.o .group 0x00000000 0x8 Zeitschaltung_V6.o .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o + .group 0x00000000 0x8 Zeitschaltung_V6.o .text 0x00000000 0x0 Zeitschaltung_V6.o + .rodata._ZTV4Snap + 0x00000000 0x12 Zeitschaltung_V6.o .text 0x00000000 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/avr5\libgcc.a(_exit.o) .bss 0x00000000 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/avr5\libgcc.a(_exit.o) .text.libgcc.mul @@ -198,7 +211,7 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .rela.plt *(.rela.plt) -.text 0x00000000 0x5a6 +.text 0x00000000 0x666 *(.vectors) .vectors 0x00000000 0x68 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/avr5/crtm168a.o 0x00000000 __vector_default @@ -284,49 +297,68 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 0x000000ba __vector_20 0x000000be . = ALIGN (0x2) *(.text.*) - .text._ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.2 + .text._ZN6avrlib3pinINS_5portbELh1EE6outputEb.part.10 0x000000be 0x4 Zeitschaltung_V6.o - .text._ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.30 - 0x000000c2 0x2c Zeitschaltung_V6.o - .text._ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.11 - 0x000000ee 0x1a Zeitschaltung_V6.o + .text._ZN6avrlib3pinINS_5portcELh4EE6outputEb.part.22 + 0x000000c2 0x4 Zeitschaltung_V6.o + .text._ZN3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EE9send_softEh.isra.29 + 0x000000c6 0x2c Zeitschaltung_V6.o + .text._ZN3LedIN6avrlib5portdELi7ELi6EE5colorEh.isra.6 + 0x000000f2 0x1a Zeitschaltung_V6.o + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv + 0x0000010c 0x84 Zeitschaltung_V6.o + 0x0000010c _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_turnEv + .text._ZN4Snap11send_packetEh + 0x00000190 0x14 Zeitschaltung_V6.o + 0x00000190 _ZN4Snap11send_packetEh + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv + 0x000001a4 0x9e Zeitschaltung_V6.o + 0x000001a4 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE9hook_pollEv .text.__vector_16 - 0x00000108 0xaa Zeitschaltung_V6.o - 0x00000108 __vector_16 - .text._ZN6avrlib3pinINS_5portcELh4EE8make_lowEv - 0x000001b2 0x6 Zeitschaltung_V6.o - 0x000001b2 _ZN6avrlib3pinINS_5portcELh4EE8make_lowEv - .text._ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE10rf12_readyEv.isra.25 - 0x000001b8 0xa Zeitschaltung_V6.o - .text._ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE4sendEj.isra.32 - 0x000001c2 0x40 Zeitschaltung_V6.o - .text._ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE17rf12_beginasyncrxEv.isra.39 - 0x00000202 0x18 Zeitschaltung_V6.o - .text._ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh - 0x0000021a 0xbc Zeitschaltung_V6.o - 0x0000021a _ZN4Rf12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELj1568ELj9600ELh0ELh6EE13rf12_txpacketEhhh - .text._Z4turnv - 0x000002d6 0x94 Zeitschaltung_V6.o - 0x000002d6 _Z4turnv - .text._Z4pollv - 0x0000036a 0x92 Zeitschaltung_V6.o - 0x0000036a _Z4pollv - .text._Z6recivev - 0x000003fc 0xd8 Zeitschaltung_V6.o - 0x000003fc _Z6recivev + 0x00000242 0x9e Zeitschaltung_V6.o + 0x00000242 __vector_16 + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv + 0x000002e0 0x132 Zeitschaltung_V6.o + 0x000002e0 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE6workerEv .text.startup.main - 0x000004d4 0xc Zeitschaltung_V6.o - 0x000004d4 main - .text.startup._GLOBAL__sub_I_l - 0x000004e0 0xb6 Zeitschaltung_V6.o - .text.libgcc 0x00000596 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/avr5\libgcc.a(_tablejump.o) - 0x00000596 __tablejump2__ - 0x0000059a __tablejump__ - 0x000005a2 . = ALIGN (0x2) + 0x00000412 0xa Zeitschaltung_V6.o + 0x00000412 main + .text._ZN6avrlib3pinINS_5portcELh4EE5clearEv + 0x0000041c 0x4 Zeitschaltung_V6.o + 0x0000041c _ZN6avrlib3pinINS_5portcELh4EE5clearEv + .text._ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5readyEv.isra.42 + 0x00000420 0xe Zeitschaltung_V6.o + .text._ZN5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE4sendEj.isra.31 + 0x0000042e 0x50 Zeitschaltung_V6.o + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC2Ev + 0x0000047e 0xd4 Zeitschaltung_V6.o + 0x0000047e _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC2Ev + 0x0000047e _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEEC1Ev + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE10funk_beginEv + 0x00000552 0x18 Zeitschaltung_V6.o + 0x00000552 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE10funk_beginEv + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE8funk_endEv + 0x0000056a 0x8 Zeitschaltung_V6.o + 0x0000056a _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE8funk_endEv + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_get_byteEv + 0x00000572 0xa Zeitschaltung_V6.o + 0x00000572 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_get_byteEv + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh + 0x0000057c 0xbc Zeitschaltung_V6.o + 0x0000057c _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE16funk_send_packetEhhh + .text._ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_has_dataEv + 0x00000638 0x16 Zeitschaltung_V6.o + 0x00000638 _ZN4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE13funk_has_dataEv + .text.startup._GLOBAL__sub_I_funk + 0x0000064e 0x8 Zeitschaltung_V6.o + .text.libgcc 0x00000656 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/avr5\libgcc.a(_tablejump.o) + 0x00000656 __tablejump2__ + 0x0000065a __tablejump__ + 0x00000662 . = ALIGN (0x2) *(.fini9) - .fini9 0x000005a2 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/avr5\libgcc.a(_exit.o) - 0x000005a2 _exit - 0x000005a2 exit + .fini9 0x00000662 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/avr5\libgcc.a(_exit.o) + 0x00000662 _exit + 0x00000662 exit *(.fini9) *(.fini8) *(.fini8) @@ -345,50 +377,48 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 *(.fini1) *(.fini1) *(.fini0) - .fini0 0x000005a2 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/avr5\libgcc.a(_exit.o) + .fini0 0x00000662 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/avr5\libgcc.a(_exit.o) *(.fini0) - 0x000005a6 _etext = . + 0x00000666 _etext = . -.data 0x00800100 0x2 load address 0x000005a6 +.data 0x00800100 0x12 load address 0x00000666 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/avr5/crtm168a.o - .data 0x00800100 0x2 Zeitschaltung_V6.o - 0x00800100 status - .data 0x00800102 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/avr5\libgcc.a(_exit.o) - .data 0x00800102 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/avr5\libgcc.a(_copy_data.o) - .data 0x00800102 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/avr5\libgcc.a(_clear_bss.o) - .data 0x00800102 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/avr5\libgcc.a(_ctors.o) - .data 0x00800102 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/avr5\libgcc.a(_tablejump.o) + .data 0x00800100 0x0 Zeitschaltung_V6.o + .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/avr5\libgcc.a(_exit.o) + .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/avr5\libgcc.a(_copy_data.o) + .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/avr5\libgcc.a(_clear_bss.o) + .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/avr5\libgcc.a(_ctors.o) + .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/avr5\libgcc.a(_tablejump.o) *(.data*) *(.rodata) *(.rodata*) + .rodata._ZTV4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE + 0x00800100 0x12 Zeitschaltung_V6.o + 0x00800100 _ZTV4FunkI5Rfm12I3SpiIN6avrlib5portcELi4ELi3ELi0ELi1ELi1EELh1ELh0ELh7ELm433920ELj9600ELh0ELh6EE5InputINS2_5portdELi2EES6_IS7_Li3EE5ServoINS2_5portbELi2ELi1ELj640ELj105ELj210ELh8EE3LedIS7_Li7ELi6EEE *(.gnu.linkonce.d*) - 0x00800102 . = ALIGN (0x2) - 0x00800102 _edata = . - 0x00800102 PROVIDE (__data_end, .) + 0x00800112 . = ALIGN (0x2) + 0x00800112 _edata = . + 0x00800112 PROVIDE (__data_end, .) -.bss 0x00800102 0x5 - 0x00800102 PROVIDE (__bss_start, .) +.bss 0x00800112 0x8 + 0x00800112 PROVIDE (__bss_start, .) *(.bss) - .bss 0x00800102 0x5 Zeitschaltung_V6.o - 0x00800102 r - 0x00800103 mc - 0x00800104 st - 0x00800105 se - 0x00800106 l + .bss 0x00800112 0x8 Zeitschaltung_V6.o + 0x00800112 funk *(.bss*) *(COMMON) - 0x00800107 PROVIDE (__bss_end, .) - 0x000005a6 __data_load_start = LOADADDR (.data) - 0x000005a8 __data_load_end = (__data_load_start + SIZEOF (.data)) + 0x0080011a PROVIDE (__bss_end, .) + 0x00000666 __data_load_start = LOADADDR (.data) + 0x00000678 __data_load_end = (__data_load_start + SIZEOF (.data)) -.noinit 0x00800107 0x0 - 0x00800107 PROVIDE (__noinit_start, .) +.noinit 0x0080011a 0x0 + 0x0080011a PROVIDE (__noinit_start, .) *(.noinit*) - 0x00800107 PROVIDE (__noinit_end, .) - 0x00800107 _end = . - 0x00800107 PROVIDE (__heap_start, .) + 0x0080011a PROVIDE (__noinit_end, .) + 0x0080011a _end = . + 0x0080011a PROVIDE (__heap_start, .) .eeprom 0x00810000 0x0 *(.eeprom*) @@ -446,39 +476,39 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .debug_sfnames *(.debug_sfnames) -.debug_aranges 0x00000000 0x88 +.debug_aranges 0x00000000 0xb8 *(.debug_aranges) .debug_aranges - 0x00000000 0x88 Zeitschaltung_V6.o + 0x00000000 0xb8 Zeitschaltung_V6.o .debug_pubnames *(.debug_pubnames) -.debug_info 0x00000000 0x3671 +.debug_info 0x00000000 0x3c2d *(.debug_info) - .debug_info 0x00000000 0x3671 Zeitschaltung_V6.o + .debug_info 0x00000000 0x3c2d Zeitschaltung_V6.o *(.gnu.linkonce.wi.*) -.debug_abbrev 0x00000000 0x4ef +.debug_abbrev 0x00000000 0x5f5 *(.debug_abbrev) - .debug_abbrev 0x00000000 0x4ef Zeitschaltung_V6.o + .debug_abbrev 0x00000000 0x5f5 Zeitschaltung_V6.o -.debug_line 0x00000000 0x515 +.debug_line 0x00000000 0x582 *(.debug_line) - .debug_line 0x00000000 0x515 Zeitschaltung_V6.o + .debug_line 0x00000000 0x582 Zeitschaltung_V6.o -.debug_frame 0x00000000 0x174 +.debug_frame 0x00000000 0x220 *(.debug_frame) - .debug_frame 0x00000000 0x174 Zeitschaltung_V6.o + .debug_frame 0x00000000 0x220 Zeitschaltung_V6.o -.debug_str 0x00000000 0x1ba0 +.debug_str 0x00000000 0x26d3 *(.debug_str) - .debug_str 0x00000000 0x1ba0 Zeitschaltung_V6.o - 0x1c0a (size before relaxing) + .debug_str 0x00000000 0x26d3 Zeitschaltung_V6.o + 0x2775 (size before relaxing) -.debug_loc 0x00000000 0x5d9 +.debug_loc 0x00000000 0xc25 *(.debug_loc) - .debug_loc 0x00000000 0x5d9 Zeitschaltung_V6.o + .debug_loc 0x00000000 0xc25 Zeitschaltung_V6.o .debug_macinfo *(.debug_macinfo) @@ -486,9 +516,9 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .debug_pubtypes *(.debug_pubtypes) -.debug_ranges 0x00000000 0x120 +.debug_ranges 0x00000000 0xc0 *(.debug_ranges) - .debug_ranges 0x00000000 0x120 Zeitschaltung_V6.o + .debug_ranges 0x00000000 0xc0 Zeitschaltung_V6.o .debug_macro *(.debug_macro) diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec index 502b87c..7ddae23 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/Zeitschaltung_V6.srec @@ -3,92 +3,105 @@ S11300000C9435000C945D000C945D000C945D0020 S11300100C945D000C945D000C945D000C945D00E8 S11300200C945D000C945D000C945D000C945D00D8 S11300300C945D000C945D000C945D000C945D00C8 -S11300400C9484000C945D000C945D000C945D0091 +S11300400C9421010C945D000C945D000C945D00F3 S11300500C945D000C945D000C945D000C945D00A8 -S11300600C945D000C945D00700211241FBECFEF50 -S1130070D4E0DEBFCDBF11E0A0E0B1E0E6EAF5E0F8 -S113008002C005900D92A230B107D9F721E0A2E099 -S1130090B1E001C01D92A730B207E1F710E0CAE653 -S11300A0D0E004C02297FE010E94CD02C836D107D9 -S11300B0C9F70E946A020C94D1020C940000219AA0 -S11300C00895282F98E080E027FF02C0409A01C0DD -S11300D04098389A880F33998160419A399A220F4F -S11300E000C000004198399A915071F7089580FF3B -S11300F002C05E9A01C05E98569A81FF02C05F9A60 -S113010001C05F98579A08951F920F920FB60F92ED -S113011011242F933F934F935F936F937F938F9308 -S11301209F93AF93BF93EF93FF93809100019091BE -S11301300101029711F481E00FC0809100019091B8 -S11301400101039711F482E007C0809100019091AE -S11301500101069719F483E00E94770084E686BDC6 -S11301602A9A229A8FEF94E00197F1F700C00000D9 -S113017080E090E005C025E12A95F1F700000196A2 -S11301802091050130E082179307A8F32A98229A58 -S1130190FF91EF91BF91AF919F918F917F916F915B -S11301A05F914F913F912F910F900FBE0F901F9031 -S11301B0189544983C9A08950E94D900339BFECF29 -S11301C00895EF92FF921F93CF93DF931F92CDB7C1 -S11301D0DEB7182F99830E94D90089810E9461009B -S11301E0F82EE12C812F0E946100449A3C9A9701D9 -S11301F0282BC9010F90DF91CF911F91FF90EF90B1 -S1130200089588EC92E80E94E10081E89AEC0E944B -S1130210E10083E89AEC0C94E100CF93DF9300D0E3 -S11302201F92CDB7DEB788E392E82B834A836983B4 -S11302300E94E1000E94DC008AEA98EB0E94E1003F -S11302400E94DC008AEA98EB0E94E1000E94DC0034 -S11302508AEA98EB0E94E1000E94DC008DE298EBB0 -S11302600E94E1000E94DC0084ED98EB0E94E10012 -S11302700E94DC006981862F90E0986B0E94E10067 -S11302800E94DC004A81842F90E0986B0E94E10078 -S11302900E94DC002B81822F90E0986B0E94E10089 -S11302A00E94DC0080E098EB0E94E1000E94DC00E8 -S11302B088E092E80E94E1002FEF80E792E021506D -S11302C080409040E1F700C000000F900F900F9025 -S11302D0DF91CF91089580910001909101010697DB -S11302E009F442C086E090E09093010180930001FC -S11302F0299A0E945F00109205012FEF89EF90E088 -S1130300215080409040E1F700C00000209100019E -S1130310309101014EE161E082E091E00E940D0123 -S11303202FEF83EC99E0215080409040E1F700C02A -S1130330000089E6809305012FEF82E597E02150C4 -S113034080409040E1F700C0000082ED80930501F9 -S11303502FEF86E191E1215080409040E1F700C009 -S1130360000029980C945F000895809100019091F9 -S11303700101039751F44A9908C088E092E80E9469 -S1130380E1000E946B010E940101809100019091A3 -S11303900101029779F44A990DC088E092E80E941D -S11303A0E10028E04EE161E082E091E00E940D016D -S11303B00E9401014B9921C080910001909101019B -S11303C00297D9F483E00E94770086E090E090934E -S11303D00101809300012FEF81E19AE721508040D1 -S11303E09040E1F700C0000083E090E090930101A9 -S11303F08093000180E00C9477000895CF930E94CD -S1130400010102C00E94B5010E94D900339BFACFBA -S113041080E090EB0E94E100882341F08E3131F0BE -S1130420803F09F055C002C00E94B5010E94D90066 -S1130430339BFACF80E090EB0E94E100C82F02C00A -S11304400E94B5010E94D900339BFACFC13009F054 -S11304503FC080E090EB0E94E100843049F018F442 -S11304608130C9F41DC0853031F08730A1F40AC051 -S113047082E090E002C083E090E0909301018093D9 -S113048000010EC088E092E80E94E1000E946B0126 -S1130490CF910C94010188E092E8CF910C94E10093 -S11304A088E092E80E94E1002FEF89EF90E021506C -S11304B080409040E1F700C000002091000130919D -S11304C001014EE161E082E091E0CF910C940D01D5 -S11304D0CF91089582E00E9477000E94FE01FDCF33 -S11304E0579A569A80E00E947700109205010E9464 -S11304F05F0029980E945F00229A14BC85E085BDA4 -S113050084E686BD17BC18BC81E080936E007894A5 -S113051053985B985B9A52985A985A9A4098389A8A -S11305204198399A449A3C9A3B9843982FEF80E734 -S113053092E0215080409040E1F700C0000080EE3E -S113054090EC0E94E10087ED90E80E94E1008BEAC4 -S113055092EC0E94E10081E89AEC0E94E10080E0C4 -S113056090EE0E94E10080E098EC0E94E10087EFA9 -S113057094EC0E94E10080E296EA0E94E10087E2A6 -S113058094E90E94E10082E296EC0E94E10080E698 -S113059098E90C94E100EE0FFF1F0590F491E02D13 -S10905A00994F894FFCF5A -S10505A602004D +S11300600C945D000C945D00270311241FBECFEF98 +S1130070D4E0DEBFCDBF11E0A0E0B1E0E6E6F6E0FB +S113008002C005900D92A231B107D9F721E0A2E197 +S1130090B1E001C01D92AA31B207E1F710E0CAE64F +S11300A0D0E004C02297FE010E942D03C836D10778 +S11300B0C9F70E9409020C9431030C940000219AA0 +S11300C008953C9A0895282F98E080E027FF02C005 +S11300D0409A01C04098389A880F33998160419AB8 +S11300E0399A220F00C000004198399A915071F753 +S11300F0089580FF02C05E9A01C05E98569A81FFFF +S113010002C05F9A01C05F98579A0895CF93DF9316 +S1130110EC018A818630C9F186E08A831D82299A9E +S11301200E945F008FE19EE40197F1F700C0000098 +S11301308EE1EFE0F7E23197F1F700C00000815063 +S1130140C1F7FFEF23EC89E0F15020408040E1F754 +S113015000C0000089E68D839FEFE2E5F7E091504F +S1130160E040F040E1F700C0000082ED8D832FEF06 +S113017086E191E1215080409040E1F700C0000009 +S11301802998DF91CF910C945F00DF91CF9108956E +S1130190262FDC01ED91FC910484F585E02D4EE1E0 +S11301A061E00994CF93DF93EC018A818330D9F421 +S11301B04A9919C0E881F9810680F781E02DCE01C2 +S11301C00995E881F9810190F081E02DCE0109952E +S11301D066E0CE010E94C800E881F9810480F581BF +S11301E0E02DCE0109958A818230A1F44A9912C08A +S11301F0E881F9810680F781E02DCE01099568E058 +S1130200CE010E94C800E881F9810480F581E02DC7 +S1130210CE0109954B9912C08A81823079F486E027 +S11302208A832FEF3CE281E391E02150304080400B +S11302309040D9F700C0000083E08A83DF91CF911A +S113024008951F920F920FB60F9211242F933F938C +S11302504F935F936F937F938F939F93AF93BF93CA +S1130260EF93FF9380911401823011F481E00BC06D +S113027080911401833011F482E005C0809114014F +S1130280863019F483E00E94790084E686BD2A9AB8 +S1130290229A8FEF94E00197F1F700C0000080E00C +S11302A090E005C025E12A95F1F700000196209120 +S11302B0170130E082179307A8F32A98229AFF9136 +S11302C0EF91BF91AF919F918F917F916F915F91CA +S11302D04F913F912F910F900FBE0F901F90189543 +S11302E0CF92DF92EF92FF920F931F93CF93DF93FE +S11302F000D01F92CDB7DEB78C01DC01ED91FC91EB +S11303000480F581E02D0995EE24E394F12CEC0EA4 +S1130310FD1E6E01B4E0CB0ED11C05C00280F3813A +S1130320E02DC8010995D801ED91FC910084F18577 +S1130330E02DC8010995D801ED91FC918111EECF12 +S11303400284F385E02DC8010995F70181937F01AB +S1130350EC15FD0541F7D801ED91FC910680F7817C +S1130360E02DC80109958981882329F08E3119F07F +S1130370803F09F042C08A81813009F03EC08B8100 +S1130380843049F018F48130C1F518C0853039F053 +S1130390873099F509C082E0F80182830FC083E0B9 +S11303A0D80112968C930AC0D801ED91FC9101906A +S11303B0F081E02DC801099566E011C0EFE1FEE48B +S11303C03197F1F700C000008EE1AFE0B7E211977A +S11303D0F1F700C000008150C1F7F8016281C80143 +S11303E00F900F900F90DF91CF911F910F91FF907D +S11303F0EF90DF90CF900C94C8000F900F900F9067 +S1130400DF91CF911F910F91FF90EF90DF90CF90EC +S1130410089582E191E00E947001FBCF4498089511 +S11304200E940E020E946100339BFECF0895EF925A +S1130430FF921F93CF93DF9300D0CDB7DEB7182F71 +S11304409A830E940E020E9461008A810E946300C6 +S1130450F82EE12C812F0E9463009701282BC901FB +S1130460449A8A8399830E9461008A8199810F90BA +S11304700F90DF91CF911F91FF90EF900895CF934C +S1130480DF93EC0184E091E09983888353985B982F +S11304905B9A52985A985A9A1D820E945F00299832 +S11304A00E945F00229A14BC85E085BD84E686BD67 +S11304B017BC18BC81E080936E007894579A569AC2 +S11304C080E00E9479004098389A4198399A449A79 +S11304D00E9461003B9843982FEF80E792E02150FF +S11304E080409040E1F700C0000080EE90EC0E9454 +S11304F0170287ED90E80E9417028BEA92EC0E94A3 +S1130500170281E89AEC0E94170280E090EE0E94A4 +S1130510170280E098EC0E94170287EF94EC0E9487 +S1130520170280E296EA0E94170287E294E90E9489 +S1130530170282E296EC0E94170280E698E90E9474 +S1130540170282E00E94790082E08A83DF91CF91D2 +S1130550089588EC92E80E94170281E89AEC0E94C0 +S1130560170283E89AEC0C94170288E092E80C9442 +S1130570170280E090EB0E9417020895CF93DF9357 +S113058000D01F92CDB7DEB788E392E82B834A836D +S113059069830E9417020E9410028AEA98EB0E9463 +S11305A017020E9410028AEA98EB0E9417020E9426 +S11305B010028AEA98EB0E9417020E9410028DE250 +S11305C098EB0E9417020E94100284ED98EB0E949F +S11305D017020E9410026981862F90E0986B0E9496 +S11305E017020E9410024A81842F90E0986B0E94A7 +S11305F017020E9410022B81822F90E0986B0E94B8 +S113060017020E94100280E098EB0E9417020E94D9 +S1130610100288E092E80E9417022FEF80E792E030 +S1130620215080409040E1F700C000000F900F90EF +S11306300F90DF91CF9108950E940E020E946100F5 +S113064086B183FB882780F991E08927089582E1A8 +S113065091E00C943F02EE0FFF1F0590F491E02D02 +S10906600994F894FFCF99 +S1130666000000008600D200A902B5021C03B902EC +S1050676BE02BE S9030000FC diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/comunication/.gitignore b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Debug/comunication/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/FastDelegate.h b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/FastDelegate.h new file mode 100644 index 0000000..d9136f8 --- /dev/null +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/FastDelegate.h @@ -0,0 +1,2036 @@ +// +// Efficient delegates in C++ that generate only two lines of asm code! +// Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp +// +// - Don Clugston, Mar 2004. +// Major contributions were made by Jody Hagins. +// +// +// Adapted for WinAVR by Lauri Kirikal, Mar 2007. +// +// History: +// 24-Apr-04 1.0 * Submitted to CodeProject. +// 28-Apr-04 1.1 * Prevent most unsafe uses of evil static function hack. +// * Improved syntax for horrible_cast (thanks Paul Bludov). +// * Tested on Metrowerks MWCC and Intel ICL (IA32) +// * Compiled, but not run, on Comeau C++ and Intel Itanium ICL. +// 27-Jun-04 1.2 * Now works on Borland C++ Builder 5.5 +// * Now works on /clr "managed C++" code on VC7, VC7.1 +// * Comeau C++ now compiles without warnings. +// * Prevent the virtual inheritance case from being used on +// VC6 and earlier, which generate incorrect code. +// * Improved warning and error messages. Non-standard hacks +// now have compile-time checks to make them safer. +// * implicit_cast used instead of static_cast in many cases. +// * If calling a const member function, a const class pointer can be used. +// * MakeDelegate() global helper function added to simplify pass-by-value. +// * Added fastdelegate.Clear() +// 16-Jul-04 1.2.1* Workaround for gcc bug (const member function pointers in templates) +// 30-Oct-04 1.3 * Support for (non-void) return values. +// * No more workarounds in client code! +// MSVC and Intel now use a clever hack invented by John Dlugosz: +// - The FASTDELEGATEDECLARE workaround is no longer necessary. +// - No more warning messages for VC6 +// * Less use of macros. Error messages should be more comprehensible. +// * Added include guards +// * Added FastDelegate::Empty() to test if invocation is safe (Thanks Neville Franks). +// * Now tested on VS 2005 Express Beta, PGI C++ +// 24-Dec-04 1.4 * Added DelegateMemento, to allow collections of disparate delegates. +// * <,>,<=,>= comparison operators to allow storage in ordered containers. +// * Substantial reduction of code size, especially the 'Closure' class. +// * Standardised all the compiler-specific workarounds. +// * MFP conversion now works for CodePlay (but not yet supported in the full code). +// * Now compiles without warnings on _any_ supported compiler, including BCC 5.5.1 +// * New syntax: FastDelegate< int (char *, double) >. +// 14-Feb-05 1.4.1* Now treats =0 as equivalent to .Clear(), ==0 as equivalent to .Empty(). (Thanks elfric). +// * Now tested on Intel ICL for AMD64, VS2005 Beta for AMD64 and Itanium. +// 30-Mar-05 1.5 * Safebool idiom: "if (dg)" is now equivalent to "if (!dg.Empty())" +// * Fully supported by CodePlay VectorC +// * Bugfix for Metrowerks: Empty() was buggy because a valid MFP can be 0 on MWCC! +// * More optimal assignment,== and != operators for static function pointers. + +/* + Minor Changes For AVR C++ Lib Compatibility + + STARTS ... +*/ +#ifndef __AVR_CPP_DELEGATE_H__ +#define __AVR_CPP_DELEGATE_H__ + +#if !(defined(EXCLUDE_FAST_DELEGATE) && defined(EXCLUDE_MULTI_DELEGATE) && defined(EXLUDE_DATA_DELEGATE)) + +#ifndef __cplusplus +#error "Delegate.h needs C++ compiler." +#else + +/* + Header file memory.h is missing in WinAVR. + Needed functions are defined in string.h + + Lauri Kirikal +*/ +#ifdef __AVR__ +#include +#else +#include // to allow <,> comparisons +#endif + +/* + ... ENDS + + Lauri Kirikal +*/ + +//////////////////////////////////////////////////////////////////////////////// +// Configuration options +// +//////////////////////////////////////////////////////////////////////////////// + +// Uncomment the following #define for optimally-sized delegates. +// In this case, the generated asm code is almost identical to the code you'd get +// if the compiler had native support for delegates. +// It will not work on systems where sizeof(dataptr) < sizeof(codeptr). +// Thus, it will not work for DOS compilers using the medium model. +// It will also probably fail on some DSP systems. +#define FASTDELEGATE_USESTATICFUNCTIONHACK + +// Uncomment the next line to allow function declarator syntax. +// It is automatically enabled for those compilers where it is known to work. +//#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX + +//////////////////////////////////////////////////////////////////////////////// +// Compiler identification for workarounds +// +//////////////////////////////////////////////////////////////////////////////// + +// Compiler identification. It's not easy to identify Visual C++ because +// many vendors fraudulently define Microsoft's identifiers. +#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__) +#define FASTDLGT_ISMSVC + +#if (_MSC_VER <1300) // Many workarounds are required for VC6. +#define FASTDLGT_VC6 +#pragma warning(disable:4786) // disable this ridiculous warning +#endif + +#endif + +// Does the compiler uses Microsoft's member function pointer structure? +// If so, it needs special treatment. +// Metrowerks CodeWarrior, Intel, and CodePlay fraudulently define Microsoft's +// identifier, _MSC_VER. We need to filter Metrowerks out. +#if defined(_MSC_VER) && !defined(__MWERKS__) +#define FASTDLGT_MICROSOFT_MFP + +#if !defined(__VECTOR_C) +// CodePlay doesn't have the __single/multi/virtual_inheritance keywords +#define FASTDLGT_HASINHERITANCE_KEYWORDS +#endif +#endif + +// Does it allow function declarator syntax? The following compilers are known to work: +#if defined(FASTDLGT_ISMSVC) && (_MSC_VER >=1310) // VC 7.1 +#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX +#endif + +// Gcc(2.95+), and versions of Digital Mars, Intel and Comeau in common use. +#if defined (__DMC__) || defined(__GNUC__) || defined(__ICL) || defined(__COMO__) +#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX +#endif + +// It works on Metrowerks MWCC 3.2.2. From boost.Config it should work on earlier ones too. +#if defined (__MWERKS__) +#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX +#endif + +#ifdef __GNUC__ // Workaround GCC bug #8271 + // At present, GCC doesn't recognize constness of MFPs in templates +#define FASTDELEGATE_GCC_BUG_8271 +#endif + + + +//////////////////////////////////////////////////////////////////////////////// +// General tricks used in this code +// +// (a) Error messages are generated by typdefing an array of negative size to +// generate compile-time errors. +// (b) Warning messages on MSVC are generated by declaring unused variables, and +// enabling the "variable XXX is never used" warning. +// (c) Unions are used in a few compiler-specific cases to perform illegal casts. +// (d) For Microsoft and Intel, when adjusting the 'this' pointer, it's cast to +// (char *) first to ensure that the correct number of *bytes* are added. +// +//////////////////////////////////////////////////////////////////////////////// +// Helper templates +// +//////////////////////////////////////////////////////////////////////////////// + +/* + namespace names modified: + fastdelegate -> CppDelegate + detail -> Internal + + Lauri Kirikal +*/ + +namespace CppDelegate { +namespace Internal { // we'll hide the implementation details in a nested namespace. + +// implicit_cast< > +// I believe this was originally going to be in the C++ standard but +// was left out by accident. It's even milder than static_cast. +// I use it instead of static_cast<> to emphasize that I'm not doing +// anything nasty. +// Usage is identical to static_cast<> +template +inline OutputClass implicit_cast(InputClass input){ + return input; +} + +// horrible_cast< > +// This is truly evil. It completely subverts C++'s type system, allowing you +// to cast from any class to any other class. Technically, using a union +// to perform the cast is undefined behaviour (even in C). But we can see if +// it is OK by checking that the union is the same size as each of its members. +// horrible_cast<> should only be used for compiler-specific workarounds. +// Usage is identical to reinterpret_cast<>. + +// This union is declared outside the horrible_cast because BCC 5.5.1 +// can't inline a function with a nested class, and gives a warning. +template +union horrible_union{ + OutputClass out; + InputClass in; +}; + +template +inline OutputClass horrible_cast(const InputClass input){ + horrible_union u; + // Cause a compile-time error if in, out and u are not the same size. + // If the compile fails here, it means the compiler has peculiar + // unions which would prevent the cast from working. + typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u) + && sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1]; + u.in = input; + return u.out; +} + +//////////////////////////////////////////////////////////////////////////////// +// Workarounds +// +//////////////////////////////////////////////////////////////////////////////// + +// Backwards compatibility: This macro used to be necessary in the virtual inheritance +// case for Intel and Microsoft. Now it just forward-declares the class. +#define FASTDELEGATEDECLARE(CLASSNAME) class CLASSNAME; + +// Prevent use of the static function hack with the DOS medium model. +#ifdef __MEDIUM__ +#undef FASTDELEGATE_USESTATICFUNCTIONHACK +#endif + +// DefaultVoid - a workaround for 'void' templates in VC6. +// +// (1) VC6 and earlier do not allow 'void' as a default template argument. +// (2) They also doesn't allow you to return 'void' from a function. +// +// Workaround for (1): Declare a dummy type 'DefaultVoid' which we use +// when we'd like to use 'void'. We convert it into 'void' and back +// using the templates DefaultVoidToVoid<> and VoidToDefaultVoid<>. +// Workaround for (2): On VC6, the code for calling a void function is +// identical to the code for calling a non-void function in which the +// return value is never used, provided the return value is returned +// in the EAX register, rather than on the stack. +// This is true for most fundamental types such as int, enum, void *. +// Const void * is the safest option since it doesn't participate +// in any automatic conversions. But on a 16-bit compiler it might +// cause extra code to be generated, so we disable it for all compilers +// except for VC6 (and VC5). +#ifdef FASTDLGT_VC6 +// VC6 workaround +typedef const void * DefaultVoid; +#else +// On any other compiler, just use a normal void. +typedef void DefaultVoid; +#endif + +// Translate from 'DefaultVoid' to 'void'. +// Everything else is unchanged +template +struct DefaultVoidToVoid { typedef T type; }; + +template <> +struct DefaultVoidToVoid { typedef void type; }; + +// Translate from 'void' into 'DefaultVoid' +// Everything else is unchanged +template +struct VoidToDefaultVoid { typedef T type; }; + +template <> +struct VoidToDefaultVoid { typedef DefaultVoid type; }; + + + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 1: +// +// Conversion of member function pointer to a standard form +// +//////////////////////////////////////////////////////////////////////////////// + +// GenericClass is a fake class, ONLY used to provide a type. +// It is vitally important that it is never defined, so that the compiler doesn't +// think it can optimize the invocation. For example, Borland generates simpler +// code if it knows the class only uses single inheritance. + +// Compilers using Microsoft's structure need to be treated as a special case. +#ifdef FASTDLGT_MICROSOFT_MFP + +#ifdef FASTDLGT_HASINHERITANCE_KEYWORDS + // For Microsoft and Intel, we want to ensure that it's the most efficient type of MFP + // (4 bytes), even when the /vmg option is used. Declaring an empty class + // would give 16 byte pointers in this case.... + class __single_inheritance GenericClass; +#endif + // ...but for Codeplay, an empty class *always* gives 4 byte pointers. + // If compiled with the /clr option ("managed C++"), the JIT compiler thinks + // it needs to load GenericClass before it can call any of its functions, + // (compiles OK but crashes at runtime!), so we need to declare an + // empty class to make it happy. + // Codeplay and VC4 can't cope with the unknown_inheritance case either. + class GenericClass {}; +#else + class GenericClass; +#endif + +// The size of a single inheritance member function pointer. +const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)()); + +// SimplifyMemFunc< >::Convert() +// +// A template function that converts an arbitrary member function pointer into the +// simplest possible form of member function pointer, using a supplied 'this' pointer. +// According to the standard, this can be done legally with reinterpret_cast<>. +// For (non-standard) compilers which use member function pointers which vary in size +// depending on the class, we need to use knowledge of the internal structure of a +// member function pointer, as used by the compiler. Template specialization is used +// to distinguish between the sizes. Because some compilers don't support partial +// template specialisation, I use full specialisation of a wrapper struct. + +// general case -- don't know how to convert it. Force a compile failure +template +struct SimplifyMemFunc { + template + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + // Unsupported member function type -- force a compile failure. + // (it's illegal to have a array with negative size). + typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100]; + return 0; + } +}; + +// For compilers where all member func ptrs are the same size, everything goes here. +// For non-standard compilers, only single_inheritance classes go here. +template <> +struct SimplifyMemFunc { + template + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { +#if defined __DMC__ + // Digital Mars doesn't allow you to cast between abitrary PMF's, + // even though the standard says you can. The 32-bit compiler lets you + // static_cast through an int, but the DOS compiler doesn't. + bound_func = horrible_cast(function_to_bind); +#else + bound_func = reinterpret_cast(function_to_bind); +#endif + return reinterpret_cast(pthis); + } +}; + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 1b: +// +// Workarounds for Microsoft and Intel +// +//////////////////////////////////////////////////////////////////////////////// + + +// Compilers with member function pointers which violate the standard (MSVC, Intel, Codeplay), +// need to be treated as a special case. +#ifdef FASTDLGT_MICROSOFT_MFP + +/* + ... ERASED for shorter compiling time ... + + Lauri Kirikal +*/ + +#error "MSVC, Intel, Codeplay compilers support erased from this file." + +#endif // MS/Intel hacks + +} // namespace Internal + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 2: +// +// Define the delegate storage, and cope with static functions +// +//////////////////////////////////////////////////////////////////////////////// + +// DelegateMemento -- an opaque structure which can hold an arbitary delegate. +// It knows nothing about the calling convention or number of arguments used by +// the function pointed to. +// It supplies comparison operators so that it can be stored in STL collections. +// It cannot be set to anything other than null, nor invoked directly: +// it must be converted to a specific delegate. + +// Implementation: +// There are two possible implementations: the Safe method and the Evil method. +// DelegateMemento - Safe version +// +// This implementation is standard-compliant, but a bit tricky. +// A static function pointer is stored inside the class. +// Here are the valid values: +// +-- Static pointer --+--pThis --+-- pMemFunc-+-- Meaning------+ +// | 0 | 0 | 0 | Empty | +// | !=0 |(dontcare)| Invoker | Static function| +// | 0 | !=0 | !=0* | Method call | +// +--------------------+----------+------------+----------------+ +// * For Metrowerks, this can be 0. (first virtual function in a +// single_inheritance class). +// When stored stored inside a specific delegate, the 'dontcare' entries are replaced +// with a reference to the delegate itself. This complicates the = and == operators +// for the delegate class. + +// DelegateMemento - Evil version +// +// For compilers where data pointers are at least as big as code pointers, it is +// possible to store the function pointer in the this pointer, using another +// horrible_cast. In this case the DelegateMemento implementation is simple: +// +--pThis --+-- pMemFunc-+-- Meaning---------------------+ +// | 0 | 0 | Empty | +// | !=0 | !=0* | Static function or method call| +// +----------+------------+-------------------------------+ +// * For Metrowerks, this can be 0. (first virtual function in a +// single_inheritance class). +// Note that the Sun C++ and MSVC documentation explicitly state that they +// support static_cast between void * and function pointers. + +/* + DelegateMemento moved from CppDelegate namespace to CppDelegate::Internal namespace + + Lauri Kirikal +*/ +namespace Internal +{ +class DelegateMemento { +protected: + // the data is protected, not private, because many + // compilers have problems with template friends. + typedef void (Internal::GenericClass::*GenericMemFuncType)(); // arbitrary MFP. + Internal::GenericClass *m_pthis; + GenericMemFuncType m_pFunction; + +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + typedef void (*GenericFuncPtr)(); // arbitrary code pointer + GenericFuncPtr m_pStaticFunction; +#endif + +public: +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + DelegateMemento() : m_pthis(0), m_pFunction(0), m_pStaticFunction(0) {}; + void Clear() { + m_pthis=0; m_pFunction=0; m_pStaticFunction=0; + } +#else + DelegateMemento() : m_pthis(0), m_pFunction(0) {}; + void Clear() { m_pthis=0; m_pFunction=0; } +#endif +public: +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + inline bool IsEqual (const DelegateMemento &x) const{ + // We have to cope with the static function pointers as a special case + if (m_pFunction!=x.m_pFunction) return false; + // the static function ptrs must either both be equal, or both be 0. + if (m_pStaticFunction!=x.m_pStaticFunction) return false; + if (m_pStaticFunction!=0) return m_pthis==x.m_pthis; + else return true; + } +#else // Evil Method + inline bool IsEqual (const DelegateMemento &x) const{ + return m_pthis==x.m_pthis && m_pFunction==x.m_pFunction; + } +#endif + // Provide a strict weak ordering for DelegateMementos. + inline bool IsLess(const DelegateMemento &right) const { + // deal with static function pointers first +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0) + return m_pStaticFunction < right.m_pStaticFunction; +#endif + if (m_pthis !=right.m_pthis) return m_pthis < right.m_pthis; + // There are no ordering operators for member function pointers, + // but we can fake one by comparing each byte. The resulting ordering is + // arbitrary (and compiler-dependent), but it permits storage in ordered STL containers. + return memcmp(&m_pFunction, &right.m_pFunction, sizeof(m_pFunction)) < 0; + + } + // BUGFIX (Mar 2005): + // We can't just compare m_pFunction because on Metrowerks, + // m_pFunction can be zero even if the delegate is not empty! + inline bool operator ! () const // Is it bound to anything? + { return m_pthis==0 && m_pFunction==0; } + inline bool Empty() const // Is it bound to anything? + { return m_pthis==0 && m_pFunction==0; } +public: + DelegateMemento & operator = (const DelegateMemento &right) { + SetMementoFrom(right); + return *this; + } + inline bool operator <(const DelegateMemento &right) { + return IsLess(right); + } + inline bool operator >(const DelegateMemento &right) { + return right.IsLess(*this); + } + DelegateMemento (const DelegateMemento &right) : + m_pthis(right.m_pthis), m_pFunction(right.m_pFunction) +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + , m_pStaticFunction (right.m_pStaticFunction) +#endif + {} +protected: + void SetMementoFrom(const DelegateMemento &right) { + m_pFunction = right.m_pFunction; + m_pthis = right.m_pthis; +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = right.m_pStaticFunction; +#endif + } +}; +} // namespace Internal + +// ClosurePtr<> +// +// A private wrapper class that adds function signatures to DelegateMemento. +// It's the class that does most of the actual work. +// The signatures are specified by: +// GenericMemFunc: must be a type of GenericClass member function pointer. +// StaticFuncPtr: must be a type of function pointer with the same signature +// as GenericMemFunc. +// UnvoidStaticFuncPtr: is the same as StaticFuncPtr, except on VC6 +// where it never returns void (returns DefaultVoid instead). + +// An outer class, FastDelegateN<>, handles the invoking and creates the +// necessary typedefs. +// This class does everything else. + +namespace Internal { + +template < class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr> +class ClosurePtr : public DelegateMemento { +public: + // These functions are for setting the delegate to a member function. + + // Here's the clever bit: we convert an arbitrary member function into a + // standard form. XMemFunc should be a member function of class X, but I can't + // enforce that here. It needs to be enforced by the wrapper class. + template < class X, class XMemFunc > + inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) { + m_pthis = SimplifyMemFunc< sizeof(function_to_bind) > + ::Convert(pthis, function_to_bind, m_pFunction); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } + // For const member functions, we only need a const class pointer. + // Since we know that the member function is const, it's safe to + // remove the const qualifier from the 'this' pointer with a const_cast. + // VC6 has problems if we just overload 'bindmemfunc', so we give it a different name. + template < class X, class XMemFunc> + inline void bindconstmemfunc(const X *pthis, XMemFunc function_to_bind) { + m_pthis= SimplifyMemFunc< sizeof(function_to_bind) > + ::Convert(const_cast(pthis), function_to_bind, m_pFunction); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } +#ifdef FASTDELEGATE_GCC_BUG_8271 // At present, GCC doesn't recognize constness of MFPs in templates + template < class X, class XMemFunc> + inline void bindmemfunc(const X *pthis, XMemFunc function_to_bind) { + bindconstmemfunc(pthis, function_to_bind); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } +#endif + // These functions are required for invoking the stored function + inline GenericClass *GetClosureThis() const { return m_pthis; } + inline GenericMemFunc GetClosureMemPtr() const { return reinterpret_cast(m_pFunction); } + +// There are a few ways of dealing with static function pointers. +// There's a standard-compliant, but tricky method. +// There's also a straightforward hack, that won't work on DOS compilers using the +// medium memory model. It's so evil that I can't recommend it, but I've +// implemented it anyway because it produces very nice asm code. + +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + +// ClosurePtr<> - Safe version +// +// This implementation is standard-compliant, but a bit tricky. +// I store the function pointer inside the class, and the delegate then +// points to itself. Whenever the delegate is copied, these self-references +// must be transformed, and this complicates the = and == operators. +public: + // The next two functions are for operator ==, =, and the copy constructor. + // We may need to convert the m_pthis pointers, so that + // they remain as self-references. + template< class DerivedClass > + inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &x) { + SetMementoFrom(x); + if (m_pStaticFunction!=0) { + // transform self references... + m_pthis=reinterpret_cast(pParent); + } + } + // For static functions, the 'static_function_invoker' class in the parent + // will be called. The parent then needs to call GetStaticFunction() to find out + // the actual function to invoke. + template < class DerivedClass, class ParentInvokerSig > + inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker, + StaticFuncPtr function_to_bind ) { + if (function_to_bind==0) { // cope with assignment to 0 + m_pFunction=0; + } else { + bindmemfunc(pParent, static_function_invoker); + } + m_pStaticFunction=reinterpret_cast(function_to_bind); + } + inline UnvoidStaticFuncPtr GetStaticFunction() const { + return reinterpret_cast(m_pStaticFunction); + } +#else + +// ClosurePtr<> - Evil version +// +// For compilers where data pointers are at least as big as code pointers, it is +// possible to store the function pointer in the this pointer, using another +// horrible_cast. Invocation isn't any faster, but it saves 4 bytes, and +// speeds up comparison and assignment. If C++ provided direct language support +// for delegates, they would produce asm code that was almost identical to this. +// Note that the Sun C++ and MSVC documentation explicitly state that they +// support static_cast between void * and function pointers. + + template + inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) { + SetMementoFrom(right); + } + // For static functions, the 'static_function_invoker' class in the parent + // will be called. The parent then needs to call GetStaticFunction() to find out + // the actual function to invoke. + // ******** EVIL, EVIL CODE! ******* + template + inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker, + StaticFuncPtr function_to_bind) { + if (function_to_bind==0) { // cope with assignment to 0 + m_pFunction=0; + } else { + // We'll be ignoring the 'this' pointer, but we need to make sure we pass + // a valid value to bindmemfunc(). + bindmemfunc(pParent, static_function_invoker); + } + + // WARNING! Evil hack. We store the function in the 'this' pointer! + // Ensure that there's a compilation failure if function pointers + // and data pointers have different sizes. + // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK. + typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1]; + m_pthis = horrible_cast(function_to_bind); + // MSVC, SunC++ and DMC accept the following (non-standard) code: + // m_pthis = static_cast(static_cast(function_to_bind)); + // BCC32, Comeau and DMC accept this method. MSVC7.1 needs __int64 instead of long + // m_pthis = reinterpret_cast(reinterpret_cast(function_to_bind)); + } + // ******** EVIL, EVIL CODE! ******* + // This function will be called with an invalid 'this' pointer!! + // We're just returning the 'this' pointer, converted into + // a function pointer! + inline UnvoidStaticFuncPtr GetStaticFunction() const { + // Ensure that there's a compilation failure if function pointers + // and data pointers have different sizes. + // If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK. + typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1]; + return horrible_cast(this); + } +#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + + // Does the closure contain this static function? + inline bool IsEqualToStaticFuncPtr(StaticFuncPtr funcptr){ + if (funcptr==0) return Empty(); + // For the Evil method, if it doesn't actually contain a static function, this will return an arbitrary + // value that is not equal to any valid function pointer. + else return funcptr==reinterpret_cast(GetStaticFunction()); + } +}; + + +} // namespace Internal + +//////////////////////////////////////////////////////////////////////////////// +// Fast Delegates, part 3: +// +// Wrapper classes to ensure type safety +// +//////////////////////////////////////////////////////////////////////////////// + + +// Once we have the member function conversion templates, it's easy to make the +// wrapper classes. So that they will work with as many compilers as possible, +// the classes are of the form +// FastDelegate3 +// They can cope with any combination of parameters. The max number of parameters +// allowed is 8, but it is trivial to increase this limit. +// Note that we need to treat const member functions seperately. +// All this class does is to enforce type safety, and invoke the delegate with +// the correct list of parameters. + +// Because of the weird rule about the class of derived member function pointers, +// you sometimes need to apply a downcast to the 'this' pointer. +// This is the reason for the use of "implicit_cast(pthis)" in the code below. +// If CDerivedClass is derived from CBaseClass, but doesn't override SimpleVirtualFunction, +// without this trick you'd need to write: +// MyDelegate(static_cast(&d), &CDerivedClass::SimpleVirtualFunction); +// but with the trick you can write +// MyDelegate(&d, &CDerivedClass::SimpleVirtualFunction); + +// RetType is the type the compiler uses in compiling the template. For VC6, +// it cannot be void. DesiredRetType is the real type which is returned from +// all of the functions. It can be void. + +// Implicit conversion to "bool" is achieved using the safe_bool idiom, +// using member data pointers (MDP). This allows "if (dg)..." syntax +// Because some compilers (eg codeplay) don't have a unique value for a zero +// MDP, an extra padding member is added to the SafeBool struct. +// Some compilers (eg VC6) won't implicitly convert from 0 to an MDP, so +// in that case the static function constructor is not made explicit; this +// allows "if (dg==0) ..." to compile. + + +/* + Member function names modified: + bind -> Bind + empty -> IsEmpty + clear -> Clear + + Functions GetMemento and SetMemento: public -> protected + + Lauri Kirikal +*/ + +// N=0 +template +class FastDelegate0 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(); + typedef RetType (*UnvoidStaticFunctionPtr)(); + typedef RetType (Internal::GenericClass::*GenericMemFn)(); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate0 type; + + // Construction and comparison functions + FastDelegate0() { Clear(); } + FastDelegate0(const FastDelegate0 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate0 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate0 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate0 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate0 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate0 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate0(Y *pthis, DesiredRetType (X::* function_to_bind)() ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)()) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate0(const Y *pthis, DesiredRetType (X::* function_to_bind)() const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)() const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate0(DesiredRetType (*function_to_bind)() ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)() ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)()) { + m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType Invoke() const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(); } + inline RetType operator() () const { + return Invoke(); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear(); } +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } +private: // Invoker for static functions + RetType InvokeStaticFunction() const { + return (*(m_Closure.GetStaticFunction()))(); } +}; + +// N=1 +template +class FastDelegate1 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate1 type; + + // Construction and comparison functions + FastDelegate1() { Clear(); } + FastDelegate1(const FastDelegate1 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate1 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate1 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate1 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate1 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate1 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate1(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate1(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate1(DesiredRetType (*function_to_bind)(Param1 p1) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1)) { + m_Closure.bindstaticfunc(this, &FastDelegate1::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType Invoke(Param1 p1) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1); } + inline RetType operator() (Param1 p1) const { + return Invoke(p1); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear(); } +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1) const { + return (*(m_Closure.GetStaticFunction()))(p1); } +}; + +//N=2 +template +class FastDelegate2 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate2 type; + + // Construction and comparison functions + FastDelegate2() { Clear(); } + FastDelegate2(const FastDelegate2 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate2 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate2 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate2 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate2 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate2 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate2(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate2(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) { + m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2); } +}; + +//N=3 +template +class FastDelegate3 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate3 type; + + // Construction and comparison functions + FastDelegate3() { Clear(); } + FastDelegate3(const FastDelegate3 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate3 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate3 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate3 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate3 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate3 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate3(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate3(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate3(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) { + m_Closure.bindstaticfunc(this, &FastDelegate3::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3); } +}; + +//N=4 +template +class FastDelegate4 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate4 type; + + // Construction and comparison functions + FastDelegate4() { Clear(); } + FastDelegate4(const FastDelegate4 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate4 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate4 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate4 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate4 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate4 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate4(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate4(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate4(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) { + m_Closure.bindstaticfunc(this, &FastDelegate4::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4); } +}; + +//N=5 +template +class FastDelegate5 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate5 type; + + // Construction and comparison functions + FastDelegate5() { Clear(); } + FastDelegate5(const FastDelegate5 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate5 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate5 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate5 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate5 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate5 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate5(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate5(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate5(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) { + m_Closure.bindstaticfunc(this, &FastDelegate5::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5); } +}; + +//N=6 +template +class FastDelegate6 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate6 type; + + // Construction and comparison functions + FastDelegate6() { Clear(); } + FastDelegate6(const FastDelegate6 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate6 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate6 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate6 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate6 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate6 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate6(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate6(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate6(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) { + m_Closure.bindstaticfunc(this, &FastDelegate6::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6); } +}; + +//N=7 +template +class FastDelegate7 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate7 type; + + // Construction and comparison functions + FastDelegate7() { Clear(); } + FastDelegate7(const FastDelegate7 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate7 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate7 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate7 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate7 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate7 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate7(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate7(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate7(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) { + m_Closure.bindstaticfunc(this, &FastDelegate7::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7); } +}; + +//N=8 +template +class FastDelegate8 { +private: + typedef typename Internal::DefaultVoidToVoid::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8); + typedef RetType (Internal::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8); + typedef Internal::ClosurePtr ClosureType; + ClosureType m_Closure; +public: + // Typedefs to aid generic programming + typedef FastDelegate8 type; + + // Construction and comparison functions + FastDelegate8() { Clear(); } + FastDelegate8(const FastDelegate8 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate8 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate8 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate8 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate8 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate8 &x) const { + return x.m_Closure.IsLess(m_Closure); } + // Binding to non-const member functions + template < class X, class Y > + FastDelegate8(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) { + m_Closure.bindmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Binding to const member functions. + template < class X, class Y > + FastDelegate8(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + template < class X, class Y > + inline void Bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) { + m_Closure.bindconstmemfunc(Internal::implicit_cast(pthis), function_to_bind); } + // Static functions. We convert them into a member function call. + // This constructor also provides implicit conversion + FastDelegate8(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) { + Bind(function_to_bind); } + // for efficiency, prevent creation of a temporary + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) { + Bind(function_to_bind); } + inline void Bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) { + m_Closure.bindstaticfunc(this, &FastDelegate8::InvokeStaticFunction, + function_to_bind); } + // Invoke the delegate + RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8); } + // Implicit conversion to "bool" using the safe_bool idiom +private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; +public: + operator unspecified_bool_type() const { + return IsEmpty()? 0: &SafeBoolStruct::m_nonzero; + } + // necessary to allow ==0 to work despite the safe_bool idiom + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { // Is it bound to anything? + return !m_Closure; } + inline bool IsEmpty() const { + return !m_Closure; } + void Clear() { m_Closure.Clear();} +protected: + // Conversion to and from the DelegateMemento storage class + const Internal::DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const Internal::DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + +private: // Invoker for static functions + RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8); } +}; + +/* + ... part 4, part 5 ERASED ... + + And now on only AVR-specific code with GPL license + + Lauri Kirikal + */ + +/**********************************************************************************************************************\ + + C++ library for Atmel AVR microcontrollers + Copyright (C) 2007 Lauri Kirikal, Mikk Leini, MTÜ TTÜ Robotiklubi + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + See http://creativecommons.org/licenses/GPL/2.0/ + + MTÜ TTÜ Robotiklubi http://www.robotiklubi.ee robotiklubi@gmail.com + Lauri Kirikal laurikirikal@gmail.com + Mikk Leini mikk.leini@gmail.com + +\**********************************************************************************************************************/ + +#ifndef EXCLUDE_FAST_DELEGATE + typedef FastDelegate0 FastDelegate; +#endif + +#if !defined(EXCLUDE_DATA_DELEGATE) || !defined(EXCLUDE_MULTI_DELEGATE) + + namespace Internal + { + template bool AddFastDelegate(Delegate &delegate, FastDelegate &addable) + { + + if (!delegate.me) + { + delegate.me = addable; + } + else + { + if (delegate.next == NULL) + { + delegate.next = new Delegate(addable); + if (delegate.next == NULL) return false; + } + else + { + return delegate.next->Add(addable); + } + } + + return true; + + } // AddFastDelegate + + template bool AddFunction(Delegate &delegate, Function function) + { + if (!delegate.me) + { + delegate.me.Bind(function); + } + else + { + if (delegate.next == NULL) + { + delegate.next = new Delegate(function); + if (delegate.next == NULL) return false; + } + else + { + return delegate.next->Add(function); + } + } + + return true; + + } // AddFunction + + template + bool AddMemberFunction(Delegate &delegate, Object *object, MemberFunction function) + { + if (!delegate.me) + { + delegate.me.Bind(object, function); + } + else + { + if (delegate.next == NULL) + { + delegate.next = new Delegate(object, function); + if (delegate.next == NULL) return false; + } + else + { + return delegate.next->Add(object, function); + } + } + + return true; + + } // AddMemberFunction + + template bool RemoveAll(Delegate &delegate, FastDelegate &removable) + { + if (removable == delegate.me) + { + if (delegate.next == NULL) + { + delegate.me.Clear(); + } + else + { + Delegate *cutOut, *cutOutNext = delegate.next; + + while (cutOutNext->me == removable) + { + cutOut = cutOutNext; + cutOutNext = cutOut->next; + + delete cutOut; + + if (cutOutNext == NULL) + { + delegate.next = NULL; + delegate.me.Clear(); + return true; + } + } + + delegate.me = cutOutNext->me; + delegate.next = cutOutNext->next; + + delete cutOutNext; + + if (delegate.next != NULL) + delegate.next->RemoveAll(removable); + + } + } + else + { + if (delegate.next == NULL) + return false; + else + return delegate.next->RemoveAll(removable); + } + + return true; + + } // RemoveAll + + template bool Remove(Delegate &delegate, FastDelegate &removable) + { + if (removable == delegate.me) + { + if (delegate.next == NULL) + { + delegate.me.Clear(); + } + else + { + Delegate *cutOut = delegate.next; + + delegate.me = cutOut->me; + delegate.next = cutOut->next; + + delete cutOut; + } + } + else + { + if (delegate.next == NULL) + return false; + else + return delegate.next->Remove(removable); + } + + return true; + + } // Remove + + template void Clear(Delegate &delegate) + { + if (delegate.next != NULL) + { + delegate.next->Clear(); + delete delegate.next; + delegate.next = NULL; + } + delegate.me.Clear(); + + } // Clear + + } // namespace Internal + +#endif // if !defined(EXCLUDE_DATA_DELEGATE) || !defined(EXCLUDE_MULTI_DELEGATE) + +#ifndef EXCLUDE_DATA_DELEGATE + + template class DelegateController; + + template class DataDelegate + { + public: + + typedef void (*Function)(Controller &); + typedef FastDelegate1 FastDelegate; + + private: + + friend class DelegateController; + template friend bool Internal::AddFastDelegate(Delegate &delegate, FastDelegate &addable); + template friend bool Internal::AddFunction(Delegate &delegate, Function function); + template friend bool Internal::AddMemberFunction(Delegate &delegate, Object *object, MemberFunction function); + template friend bool Internal::RemoveAll(Delegate &delegate, FastDelegate &removable); + template friend bool Internal::Remove(Delegate &delegate, FastDelegate &removable); + template friend void Internal::Clear(Delegate &delegate); + + DataDelegate * next; + FastDelegate me; + + DataDelegate() : next(NULL), me() {} + DataDelegate(Function function) : next(NULL), me(function) {} + DataDelegate(const FastDelegate &_me) : next(NULL), me(_me) {} + template DataDelegate(X *object, void (Y::* function)(Controller &) ) : next(NULL), me(object, function) {} + template DataDelegate(const X *object, void (Y::* function)(Controller &) const) : next(NULL), me(object, function) {} + + void Invoke(Controller &controller) const + { + if (!me.IsEmpty() ) + { + me(controller); + if (next != NULL) next->Invoke(controller); + } + + } // OPERATOR () + + inline void operator() (Controller &controller) const { Invoke(controller); } + + public: + + inline bool Add(FastDelegate &addable) + { + return Internal::AddFastDelegate, FastDelegate>(*this, addable); + + } // Add 1 + + inline bool Add(Function function) + { + return Internal::AddFunction, Function>(*this, function); + + } // Add 2 + + template inline bool Add(X *object, void (Y::* function)(Controller &) ) + { + return Internal::AddMemberFunction, X, void (Y::*)(Controller &)>(*this, object, function); + + } // Add 3 + + template inline bool Add(const X *object, void (Y::* function)(Controller &) const) + { + return Internal::AddMemberFunction, const X, void (Y::*)(Controller &) const>(*this, object, function); + + } // Add 4 + + inline bool RemoveAll(FastDelegate &removable) + { + return Internal::RemoveAll, Function>(*this, removable); + + } // RemoveAll 1 + + inline bool RemoveAll(Function function) + { + FastDelegate removable(function); + + return RemoveAll(removable); + + } // RemoveAll 2 + + template inline bool RemoveAll(X *object, void (Y::* function)(Controller &) ) + { + FastDelegate removable(object, function); + + return RemoveAll(removable); + + } // RemoveAll 3 + + template inline bool RemoveAll(const X *object, void (Y::* function)(Controller &) const) + { + FastDelegate removable(object, function); + + return RemoveAll(removable); + + } // RemoveAll 4 + + inline bool Remove(FastDelegate &removable) + { + return Internal::Remove, FastDelegate>(*this, removable); + + } // Remove 1 + + inline bool Remove(Function function) + { + FastDelegate removable(function); + + return Remove(removable); + + } // Remove 2 + + template inline bool Remove(X *object, void (Y::* function)(Controller &) ) + { + FastDelegate removable(object, function); + + return Remove(removable); + + } // Remove 3 + + template inline bool Remove(const X *object, void (Y::* function)(Controller &) const) + { + FastDelegate removable(object, function); + + return Remove(removable); + + } // Remove 4 + + inline void Clear() { Internal::Clear >(*this); } + inline bool IsEmpty() { return !me; } + inline bool operator ! () { return IsEmpty(); } + inline bool operator += (Function function) { return Add(function); } + inline bool operator += (FastDelegate &addable) { return Add(addable); } + inline bool operator -= (Function function) { return Remove(function); } + inline bool operator -= (FastDelegate &removable) { return Remove(removable); } + + ~DataDelegate() { Clear(); } + + }; // class DataDelegate + + + template class DelegateController + { + protected: + + virtual bool Before() = 0; + virtual void After() {}; + + private: + + DataDelegate dataDelegate; + + public: + + DelegateController() : dataDelegate() {} + DataDelegate &Delegate() { return dataDelegate; } + + void Invoke() + { + if (Before() ) + { + dataDelegate(*((Derived *)this)); + After(); + } + + } // operator () + + inline void operator() () { Invoke(); } + virtual ~DelegateController() {} + + }; // class DelegateController + +#endif // ifndef EXCLUDE_DATA_DELEGATE + +#ifndef EXCLUDE_MULTI_DELEGATE + + class MultiDelegate + { + public: + + typedef void (*Function)(void); + typedef FastDelegate0<> FastDelegate; + + private: + + MultiDelegate * next; + FastDelegate me; + + template friend bool Internal::AddFastDelegate(Delegate &delegate, FastDelegate &addable); + template friend bool Internal::AddFunction(Delegate &delegate, Function function); + template friend bool Internal::AddMemberFunction(Delegate &delegate, Object *object, MemberFunction function); + template friend bool Internal::RemoveAll(Delegate &delegate, FastDelegate &removable); + template friend bool Internal::Remove(Delegate &delegate, FastDelegate &removable); + template friend void Internal::Clear(Delegate &delegate); + + public: + + MultiDelegate() : next(NULL), me() {} + MultiDelegate(Function function) : next(NULL), me(function) {} + MultiDelegate(const FastDelegate &_me) : next(NULL), me(_me) {} + template MultiDelegate(X *object, void (Y::* function)() ) : next(NULL), me(object, function) {} + template MultiDelegate(const X *object, void (Y::* function)() const) : next(NULL), me(object, function) {} + + void Invoke() const + { + if (!me.IsEmpty() ) + { + me(); + if (next != NULL) next->Invoke(); + } + + } // OPERATOR () + + inline bool Add(FastDelegate &addable) + { + return Internal::AddFastDelegate(*this, addable); + + } // Add 1 + + inline bool Add(Function function) + { + return Internal::AddFunction(*this, function); + + } // Add 2 + + template inline bool Add(X *object, void (Y::* function)() ) + { + return Internal::AddMemberFunction(*this, object, function); + + } // Add 3 + + template inline bool Add(const X *object, void (Y::* function)() const) + { + return Internal::AddMemberFunction(*this, object, function); + + } // Add 4 + + inline bool RemoveAll(FastDelegate &removable) + { + return Internal::RemoveAll(*this, removable); + + } // RemoveAll 1 + + inline bool RemoveAll(Function function) + { + FastDelegate removable(function); + + return RemoveAll(removable); + + } // RemoveAll 2 + + template inline bool RemoveAll(X *object, void (Y::* function)() ) + { + FastDelegate removable(object, function); + + return RemoveAll(removable); + + } // RemoveAll 3 + + template inline bool RemoveAll(const X *object, void (Y::* function)() const) + { + return RemoveAll(object, (void (Y::*)(void))function); + + } // RemoveAll 4 + + inline bool Remove(FastDelegate &removable) + { + return Internal::Remove(*this, removable); + + } // Remove 1 + + inline bool Remove(Function function) + { + FastDelegate removable(function); + + return Remove(removable); + + } // Remove 2 + + template inline bool Remove(X *object, void (Y::* function)() ) + { + FastDelegate removable(object, function); + + return Remove(removable); + + } // Remove 3 + + template inline bool Remove(const X *object, void (Y::* function)() const) + { + return Remove(object, (void (Y::*)(void))function); + + } // Remove 4 + + inline void Clear() { Internal::Clear(*this); } + inline bool IsEmpty() const { return !me; } + inline void operator() () const { Invoke(); } + inline bool operator ! () const { return IsEmpty(); } + inline bool operator += (Function function) { return Add(function); } + inline bool operator += (FastDelegate &addable) { return Add(addable); } + inline bool operator -= (Function function) { return Remove(function); } + inline bool operator -= (FastDelegate &removable) { return Remove(removable); } + ~MultiDelegate() { Clear(); } + + }; // class MultiDelegate + +#endif // ifndef EXCLUDE_MULTI_DELEGATE + + // clean up after ourselves... +#undef FASTDLGT_RETTYPE + +} // namespace CppDelegate + +#endif // ifdef __cplusplus +#endif // if !(defined(EXCLUDE_FAST_DELEGATE) && defined(EXCLUDE_MULTI_DELEGATE) && defined(EXLUDE_DATA_DELEGATE)) +#endif // ifndef __AVR_CPP_DELEGATE_H__ + diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp index 19ff703..c02524d 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cpp @@ -4,140 +4,25 @@ * Created: 06.05.2014 23:18:58 * Author: netz */ -#include "config.h" #include "peripheral.h" -#include -#include "codes.h" +#include "comunication/funk.hpp" -//ledclass l; -servoclass se; -startclass st; -moveclass mc; -rf12class r; - -volatile int status = SLEEP; - -void turn() -{ - if(status == RUN) - return; - status = RUN; - se.on(); - se.turn(se.LEFT); - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); //r.txpacket(MASTER, DEVICE, status); - _delay_ms(400); - se.turn(se.MIDDLE); - _delay_ms(300); - se.turn(se.RIGHT); - _delay_ms(700); - se.off(); -} - -void poll() -{ - if(status == ACTIVE) { - if(mc.is_pressed()) { - r.rf12_endasyncrx(); //r.endasyncrx(); - turn(); - r.rf12_beginasyncrx(); //r.beginasyncrx(); - } - } - if(status == SLEEP) { - if(mc.is_pressed()) { - r.rf12_endasyncrx(); //r.endasyncrx(); - r.rf12_txpacket(MASTER, DEVICE, DEDECT); //r.txpacket(MASTER, DEVICE, DEDECT); - r.rf12_beginasyncrx(); //r.beginasyncrx(); - } - } - if(st.is_pressed()) { - if(status == SLEEP) { - l.color(l.YELLOW); - status = RUN; - _delay_ms(5000); - status = ACTIVE; - l.color(l.BLACK); - - } - } -} - -/*void resieve() -{ - rf12_beginasyncrx(); //r.beginasyncrx(); - while(rf12_hasdata() /r.hasdata()/) { - poll(); - _delay_ms(1000); - rf12_endasyncrx(); //r.endasyncrx(); - rf12_txpacket(MASTER, DEVICE, DEDECT); //r.txpacket(MASTER, DEVICE, DEDECT); - rf12_beginasyncrx(); //r.beginasyncrx(); - } - l.color(l.GREEN); -}*/ - -void recive() { - r.rf12_beginasyncrx(); - while(r.rf12_hasdata()) { - poll(); - } - uint8_t addr = r.rf12_rxbyte(); - if(addr == ALL || addr == DEVICE || addr == GROUP) { - while(r.rf12_hasdata()) { - poll(); - } - uint8_t from = r.rf12_rxbyte(); - while(r.rf12_hasdata()) { - poll(); - } - if(from == MASTER) { - uint8_t data = r.rf12_rxbyte(); - switch(data) { - case PING: { - break; - } - case SETSLEEP: { - status = SLEEP; - break; - } - case SETACTIVE: { - status = ACTIVE; - break; - } - case SETRUN: { - r.rf12_endasyncrx(); - turn(); - r.rf12_beginasyncrx(); - return; - } - default: - { - r.rf12_endasyncrx(); - return; - } - } - r.rf12_endasyncrx(); - _delay_ms(10+DEVICE); - r.rf12_txpacket(MASTER, DEVICE, status); - return; - } - } -} +typedef Funk< + rfm12class, //Rfm12 Funk Hardware + moveclass, //Bewegungsmelder + startclass, //Startknopf + servoclass, //Servo + ledclass //LED +> funkclass; +funkclass funk; int main(void) { - l.color(l.RED); while(1) { - recive(); + funk.worker(); } } ISR(TIMER0_OVF_vect) { - if(status == SLEEP) { - l.color(l.GREEN); - } else if(status == ACTIVE) { - l.color(l.RED); - } else if(status == RUN) { - l.color(l.YELLOW); - } - se.timer(); + funk.timer(); } \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj index af3a96d..bdb8c5f 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/Zeitschaltung_V6.cppproj @@ -123,49 +123,50 @@ - True - True - True - True - True - True - - - DEBUG - - - Optimize (-O1) - True - True - Default (-g2) - True - True - True - - - DEBUG - - - Optimize for size (-Os) - True - True - Default (-g2) - True - - - libm - - - <segmentname>=<address>, for example .boot=0xff - Default (-Wa,-g) - + True + True + True + True + True + True + + + DEBUG + + + Optimize (-O1) + True + True + Default (-g2) + True + True + True + + + DEBUG + + + Optimize for size (-Os) + True + True + Default (-g2) + True + -std=c++11 + + + libm + + + <segmentname>=<address>, for example .boot=0xff + Default (-Wa,-g) + - + compile - + compile @@ -198,12 +199,6 @@ compile - - compile - - - compile - compile @@ -211,6 +206,7 @@ + \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/codes.h b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/codes.h deleted file mode 100644 index e43f196..0000000 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/codes.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * codes.h - * - * Created: 29.03.2013 13:58:28 - * Author: netz - */ - - -#ifndef CODES_H_ -#define CODES_H_ - -#ifndef ALL -#define ALL 0 -#define GROUP 240 -#define DEVICE 30 -#define MASTER 1 -#endif - -#ifndef PING -#define PING 1 -#define SLEEP 2 -#define ACTIVE 3 -#define SETSLEEP 4 -#define SETACTIVE 5 -#define RUN 6 -#define SETRUN 7 -#define DEDECT 8 -#define SETDEDECT 9 -#endif - -#endif /* CODES_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/comunication/Snap.hpp b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/comunication/Snap.hpp new file mode 100644 index 0000000..bdb0f83 --- /dev/null +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/comunication/Snap.hpp @@ -0,0 +1,64 @@ +/* + * Snap.hpp + * + * Created: 10.05.2014 13:28:04 + * Author: netz + */ + + +#ifndef SNAP_H_ +#define SNAP_H_ + +class Snap { + public: + static const uint8_t DEVICE = 30; + + static const uint8_t ALL = 0; + static const uint8_t GROUP = 240; + static const uint8_t MASTER = 1; + + static const uint8_t PING = 1; + static const uint8_t SLEEP = 2; + static const uint8_t ACTIVE = 3; + static const uint8_t SETSLEEP = 4; + static const uint8_t SETACTIVE = 5; + static const uint8_t RUN = 6; + static const uint8_t SETRUN = 7; + static const uint8_t DEDECT = 8; + static const uint8_t SETDEDECT = 9; + + protected: + virtual void hook_turn() = 0; + virtual void hook_poll() = 0; + virtual void funk_begin() = 0; + virtual void funk_end() = 0; + virtual uint8_t funk_has_data() = 0; + virtual uint8_t funk_get_byte() = 0; + virtual void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) = 0; + + void wait() { + _delay_ms(10); + for(uint8_t i=0;iDEVICE;i++) { + _delay_ms(5); + } + } + void get_packet(uint8_t data[], uint8_t len){ + this->funk_begin(); + for (uint8_t i = 0; i < len; i++) + { + while(this->funk_has_data()) { + this->hook_poll(); + } + data[i] = this->funk_get_byte(); + } + this->funk_end(); + } + + void send_packet(uint8_t data) { + this->funk_send_packet(this->MASTER, this->DEVICE, data); + } +}; + + + +#endif /* SNAP_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/comunication/funk.hpp b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/comunication/funk.hpp new file mode 100644 index 0000000..2985c15 --- /dev/null +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/comunication/funk.hpp @@ -0,0 +1,133 @@ +/* + * funk.hpp + * + * Created: 10.05.2014 10:00:08 + * Author: netz + */ + +#ifndef FUNK_H_ +#define FUNK_H_ + +#include "Snap.hpp" + +template +class Funk : public Snap { + public: + volatile uint8_t status; + Funk() { + this->init(); + } + void timer() { + if(this->status == this->SLEEP) { + led.color(led.GREEN); + } else if(this->status == this->ACTIVE) { + led.color(led.RED); + } else if(this->status == this->RUN) { + led.color(led.YELLOW); + } + servo.timer(); + } + void worker() { + uint8_t data[3]; + this->get_packet(data, 3); + if(data[0] == ALL || data[0] == DEVICE || data[0] == GROUP) { + if(data[1] == this->MASTER) { + switch(data[2]) { + case this->PING: { + break; + } + case this->SETSLEEP: { + this->status = this->SLEEP; + break; + } + case this->SETACTIVE: { + this->status = this->ACTIVE; + break; + } + case this->SETRUN: { + this->hook_turn(); + this->send_packet(this->RUN); + return; + } + default: { + return; + } + } + this->wait(); + this->send_packet(this->status); + return; + } + } + } + private: + Input_Start st; + Input_Beweg mc; + Servo servo; + Led led; + Rfm12 rfm12; + void init() + { + led.color(led.RED); + this->status = this->SLEEP; + } + void hook_turn() + { + if(this->status == this->RUN){ + return; + } + this->status = this->RUN; + + servo.turn(servo.LEFT); + servo.on(); + this->wait(); + _delay_ms(400); + servo.turn(servo.MIDDLE); + _delay_ms(300); + servo.turn(servo.RIGHT); + _delay_ms(700); + servo.off(); + } + + void hook_poll() + { + if(this->status == this->ACTIVE) { + if(mc.is_pressed()) { + this->funk_end(); + this->hook_turn(); + this->send_packet(this->RUN); + this->funk_begin(); + } + } + if(this->status == this->SLEEP) { + if(mc.is_pressed()) { + this->funk_end(); + this->send_packet(this->DEDECT); + this->funk_begin(); + } + } + if(st.is_pressed()) { + if(this->status == this->SLEEP) { + this->status = this->RUN; + _delay_ms(15000); + this->status = this->ACTIVE; + } + } + } + void funk_begin() { + rfm12.beginasyncrx(); + } + void funk_end() { + rfm12.endasyncrx(); + } + uint8_t funk_has_data() { + return rfm12.hasdata(); + } + uint8_t funk_get_byte() { + return rfm12.rxbyte(); + } + void funk_send_packet(uint8_t addr, uint8_t from, uint8_t data) { + rfm12.txpacket(addr, from, data); + } +}; + +#endif /* FUNK_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/config.h b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/config.h deleted file mode 100644 index e6ec868..0000000 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/config.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * config.h - * - * Created: 03.11.2013 22:39:54 - * Author: netz - */ - - -#ifndef CONFIG_H_ -#define CONFIG_H_ - -#define F_CPU 8000000 - -#endif /* CONFIG_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp index 67c44d7..c36d11c 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Led.hpp @@ -35,6 +35,4 @@ class Led { const typedef avrlib::pin green; }; - - #endif /* LED_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp index 7a81444..0dafd0c 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/Spi.hpp @@ -9,7 +9,6 @@ #ifndef SPI_H_ #define SPI_H_ -#include "../config.h" #include #include #include "hardware/pin.hpp" diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp index 0d20dc8..37ab8b1 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/io/rfm12.hpp @@ -9,40 +9,72 @@ #ifndef RFM12_H_ #define RFM12_H_ -//#define RF12FREQ(frequenz) ((frequenz-430.0)/0.0025) - -template +template class Rfm12 { public: Rfm12() { - init(); + this->init(); } - void send(uint16_t data) { + + void ready(void) { s.CSOn(); - s.send_16(data); - // s.send((uint8_t)(t >> 8)); - // s.send((uint8_t)t); - s.CSOff(); + while(s.has_data()); // wait until FIFO ready } + void beginasyncrx() { this->send(0x82C8); // RX on this->send(0xCA81); // set FIFO mode this->send(0xCA83); // enable FIFO } + uint8_t hasdata() { s.CSOn(); - uint8_t ret = s.has_data(); - s.CSOff(); - return ret; + return s.has_data(); } - void ready(void) - { - s.CSOn(); - while (!s.has_data()); // wait until FIFO ready + + uint8_t rxbyte() { + return this->send(0xB000); } + void endasyncrx() { this->send(0x8208); // RX off } + + void txdata(uint8_t *data, uint8_t number) { + uint8_t i; + this->send(0x8238); // TX on + this->ready(); + this->send(0xB8AA); + this->ready(); + this->send(0xB8AA); + this->ready(); + this->send(0xB8AA); + this->ready(); + this->send(0xB82D); + this->ready(); + this->send(0xB8D4); + for (i=0; iready(); + this->send(0xB800|(*data++)); + } + this->ready(); + this->send(0x8208); // TX off + } + + void rxdata(uint8_t *data, uint8_t number) { + uint8_t i; + this->send(0x82C8); // RX on + this->send(0xCA81); // set FIFO mode + this->send(0xCA83); // enable FIFO + for (i=0; iready(); + *data++=this->send(0xB000); + } + this->send(0x8208); // RX off + } + void txpacket(uint8_t addr, uint8_t from, uint8_t data) { this->send(0x8238); // TX on this->ready(); @@ -69,7 +101,16 @@ class Rfm12 { } private: Spi s; - void init() { + uint16_t send(uint16_t wert) { + s.CSOn(); + uint16_t werti = s.send((uint8_t)(wert >> 8)) << 8; + werti |= s.send((uint8_t)wert); + s.CSOff(); + return werti; + } + void init(void) { + _delay_ms(100); + this->send(0xC0E0); // AVR CLK: 10MHz this->send(0x80D7); // Enable FIFO this->send(0xC2AB); // Data Filter: internal @@ -77,36 +118,36 @@ class Rfm12 { this->send(0xE000); // disable wakeuptimer this->send(0xC800); // disable low duty cycle this->send(0xC4F7); // AFC settings: autotuning: -10kHz...+7,5kHz - - this->setfreq(); - this->setbandwidth(); - this->setbaud(); - this->setpower(); + + this->setfreq(); // Sende/Empfangsfrequenz auf 433,92MHz einstellen + this->setbandwidth(); // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm + this->setbaud(); // 19200 baud + this->setpower(); // 1mW Ausgangsleistung, 120kHz Frequenzshift } void setbandwidth() { - this->send(0x9400|((bandwidth&7)<<5)|((gain&3)<<3)|(drssi&7)); + this->send( 0x9400 | ( ( bandwidth & 7 ) << 5 ) | ( ( gain & 3 ) << 3 ) | ( drssi & 7 ) ); } void setfreq() { - uint16_t frequenz = (uint16_t)((freq-430000)/0.0025); - if (frequenz<96) { // 430,2400MHz - this->send(0xA000|96); - } else if (frequenz>3903) { // 439,7575MHz - this->send(0xA000|3903); + uint16_t freq = (uint16_t)(((float)(frequenz-430000)/1000)/0.0025); // macro for calculating frequency value out of frequency in kHz + if( freq < 96 ) { // 430,2400MHz + this->send( 0xA000 | 96 ); + } else if( freq > 3903 ) { // 439,7575MHz + this->send( 0xA000 | 3903 ); } - this->send(0xA000|frequenz); + this->send( 0xA000 | freq ); } void setbaud() { - if (baud<663) { + if (baud < 663) { return; } - if (baud<5400) { // Baudrate= 344827,58621/(R+1)/(1+CS*7) - this->send(0xC680|((43104/baud)-1)); + if (baud < 5400) { // Baudrate= 344827,58621/(R+1)/(1+CS*7) + this->send(0xC680 | ( ( 43104 / baud ) - 1 ) ); } else { - this->send(0xC600|((344828UL/baud)-1)); + this->send(0xC600 | ( ( 344828UL / baud ) - 1 ) ); } } void setpower() { - this->send(0x9800|(power&7)|((mod&15)<<4)); + this->send( 0x9800 | ( power & 7 ) | ( ( mod & 15 ) << 4 ) ); } }; diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h index 9e52e2e..7504197 100644 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h +++ b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/peripheral.h @@ -9,11 +9,12 @@ #ifndef PERIPHERAL_H_ #define PERIPHERAL_H_ +#define F_CPU 8000000 + #include "io/hardware/portb.hpp" #include "io/hardware/portc.hpp" #include "io/hardware/portd.hpp" - #include "io/Led.hpp" typedef Led< avrlib::portd, //LED an PORTD @@ -22,7 +23,7 @@ typedef Led< > ledclass; #include "io/Servo.hpp" -typedef Servo< //640, 105, 210, 8 Blaue Servos +typedef Servo< //<640, 105, 210, 8> Blaue Servos avrlib::portb, //Servo an PORTB PINB2, //Datenpin des Servos PINB1, //Mosfetpin des Servos @@ -37,6 +38,7 @@ typedef Input< avrlib::portd, //Startknopf an PORTD PIND3 //Pin an dem der Startknopf hängt > startclass; + typedef Input< avrlib::portd, //Bewegungsmelder an PORTD PIND2 //Pin an dem der Bewegungsmelder hängt @@ -52,9 +54,7 @@ typedef Spi< // spiclass; -ledclass l; - -/*#include "io/rfm12.hpp" +#include "io/rfm12.hpp" typedef Rfm12< spiclass, //SPI Hardware 1, //Bandwidth // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm @@ -64,22 +64,6 @@ typedef Rfm12< 9600, //Baudrate // 9600 baud 0, //Power // 1mW Ausgangsleistung, 120kHz Frequenzshift 6 //Mod -> rfm12class;*/ - -#include "rf12.hpp" -typedef Rf12< - spiclass, //SPI Hardware - 1, //Bandwidth // 400kHz Bandbreite, 0dB Verstärkung, DRSSI threshold: -61dBm - 0, //Gain - 7, //DRRSI - (uint16_t)RF12FREQ(433.92), // Sende/Empfangsfrequenz auf 433,92MHz einstellen - 9600, //Baudrate // 9600 baud - 0, //Power // 1mW Ausgangsleistung, 120kHz Frequenzshift - 6 //Mod -> rf12class; - -/*extern "C" { - #include "rf12.h" -};*/ +> rfm12class; #endif /* PERIPHERAL_H_ */ \ No newline at end of file diff --git a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/rf12.h b/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/rf12.h deleted file mode 100644 index 0ddb4a4..0000000 --- a/V6/Program/Zeitschaltung_V6/Zeitschaltung_V6/rf12.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * rf12.h - * - * Created: 25.03.2013 00:25:08 - * Author: netz - */ - - -#ifndef RF12_H_ -#define RF12_H_ - -extern uint16_t rf12_trans(uint16_t wert); // transfer 1 word to/from module -extern void rf12_init(void); // initialize module -extern void rf12_setfreq(uint16_t freq); // set center frequency -extern void rf12_setbaud(uint16_t baud); // set baudrate -extern void rf12_setpower(uint8_t power, uint8_t mod); // set transmission settings -extern void rf12_setbandwidth(uint8_t bandwidth, uint8_t gain, uint8_t drssi); // set receiver settings -extern void rf12_txdata(uint8_t *data, uint8_t number); // transmit number of bytes from array -extern void rf12_rxdata(uint8_t *data, uint8_t number); // receive number of bytes into array -extern void rf12_ready(void); // wait until FIFO ready (to transmit/read data) -extern void rf12_txpacket(uint8_t addr, uint8_t from, uint8_t data); // Send two bytes over the air -extern void rf12_beginasyncrx(); // Init RX of Bytes -extern uint8_t rf12_hasdata(); // Returns 0 if Bytes are there -extern uint8_t rf12_rxbyte(); // Rx one Byte -extern void rf12_endasyncrx(); // End RX of Bytes - -#define RF12FREQ(freq) ((freq-430.0)/0.0025) // macro for calculating frequency value out of frequency in MHz - -#include "global.h" -#include "config.h" - -#endif /* RF12_H_ */ \ No newline at end of file