diff --git a/firmware/firmware.bin b/firmware/firmware.bin index a61f64a..980a23a 100755 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/firmware/firmware.hex b/firmware/firmware.hex index 06aface..151f47f 100644 --- a/firmware/firmware.hex +++ b/firmware/firmware.hex @@ -1,174 +1,175 @@ -:1000000049C0C1C162C061C060C05FC05EC05DC0A8 -:100010005CC05BC05AC059C058C057C056C055C01C -:1000200054C053C052C0040309041A0354006900A9 -:100030006C006C00200048006100720062006100EA -:1000400075006D0024034C0043004400320055004D -:1000500053004200200049006E00740065007200E9 -:10006000660061006300650012011001FF000008D6 -:10007000030430C60901010200010902190001014F -:10008000008025090400000100000000070581032D -:1000900008000A0011241FBECFE5D4E0DEBFCDBFAB -:1000A00010E0A0E6B0E0EAEAFAE002C005900D92A6 -:1000B000A038B107D9F710E0A0E8B0E001C01D9268 -:1000C000AC3BB107E1F7EBD2EFC49ACF85B78360C1 -:1000D00085BF8BB780648BBF8BE4809392008AE5E9 -:1000E0008093910008951F93CF93DF939091A20086 -:1000F000935097FD09C020919F0080919E008D3202 -:1001000009F44CC01092A2008091600084FF39C0B5 -:10011000609161006F3FA9F1693008F06AC01092E8 -:1001200061008091860098E8892780938600662385 -:1001300009F47AC02091A0003091A1008091800044 -:1001400086FF69C0962FF901A7E8B0E084918D93EE -:1001500031969150D9F76150C901860F911D6F5F9B -:1001600001969093A1008093A0007727162F87E82F -:1001700090E005D11C5F1C3008F45BC01CE01093BC -:10018000600094E102C0915021F083B38370D9F3F1 -:10019000BAC01092A30010929D00B5C0983009F02B -:1001A000B1CFC2EBD0E0C21BD10983EC80938600B3 -:1001B0008AE5809360001092800088818076E9F55E -:1001C0009A8110928F0089818823D9F5109290002E -:1001D0008FE890E022E09093A1008093A0008F81AF -:1001E000882321F48E81821708F4282F2093610040 -:1001F00089CF6850609361008091860098E88927D4 -:100200008093860068E02091A0003091A100809149 -:10021000800086FD97CF962FF901A7E8B0E0819185 -:100220008D939150E1F797CF60E087E890E0A7D0F9 -:1002300014E08FEF80936100A2CFCE017FD2282FF0 -:10024000CECF853071F0863091F0883031F1893031 -:1002500061F18A3031F18B30F1F18FE890E020E0EC -:10026000BACF9093A3008FE890E020E0B4CF8B81C9 -:10027000813049F18230F9F0833029F020E080E4C8 -:1002800080938000ACCF992351F586E290E0909363 -:10029000A1008093A00024E0F2CF85EA90E021E065 -:1002A0009ACF8FE890E021E096CF9093A5008FE859 -:1002B00090E020E090CF8AE790E09093A1008093B7 -:1002C000A00029E1DCCF88E690E09093A100809324 -:1002D000A00022E1D4CF8BE480939200BECF913076 -:1002E00051F0923059F684E490E09093A10080930D -:1002F000A00024E2C4CF8AE290E09093A100809312 -:10030000A0002AE1BCCFDF91CF911F9108951F93E8 -:10031000DC01162F8091910084FF0FC08091920024 -:1003200098E8892780939200912FE3E9F0E08D917E -:10033000819391501916DCF304C08AE580939100F3 -:10034000F3CF612F83E990E01AD01C5F10939100E6 -:100350001F910895A82FB92F80E090E041E050EA66 -:10036000609530E009C02D9182279795879510F010 -:1003700084279527305EC8F36F5FA8F30895EADFFE -:100380008D939D930895CF93CFB7CF93C395989BAB -:10039000E9F7989B09C0989B07C0989B05C0989B5C -:1003A00003C0989B01C0A3C0DF93C0919F00DD27CD -:1003B000CA55DF4F989B02C0DF91EBCF2F930F936D -:1003C0001F9303B32FEF00FB20F94F933F9313B319 -:1003D0004FEF012700FB21F93BE031C04E7F012F99 -:1003E00013B3216028C0102F4D7F2260000003B39B -:1003F00029C04B7F2460012F000013B32BC013B31F -:10040000477F28602AC04F7E03B320612CC04F7DF8 -:1004100013B320622FC04F7B03B3206432C0422746 -:1004200003B349934FEF0000102710FB20F913B3DB -:100430001370C9F1297F91F2012700FB21F903B361 -:10044000237F89F2315058F1102710FB22F913B3A2 -:10045000277E79F2012700FB23F92F7C81F203B379 -:10046000102710FB24F92F7971F200C013B3012774 -:1004700000FB25F92F7359F200C003B3102710FBBE -:1004800026F9223040F200C013B3012700FB27F900 -:10049000243028F64F77206813B30000F9CF10E41A -:1004A0001ABF002719C03B503195C31BD04010E440 -:1004B0001ABF0881033CF9F00B34E9F020919D004C -:1004C0001981110F1213EDCF4A81441F093641F1F2 -:1004D0000D3211F0013E29F70093A4003F914F9196 -:1004E0001F910F912F91DF91CAB7C6FD4FCFCF91CA -:1004F000CFBFCF9118952091A400222379F31091BA -:10050000A200112369F534306AF13093A2002093E0 -:100510009E0010919F003BE0311B30939F0022C052 -:100520000091A2000130E4F40AE54F7049F43091E3 -:10053000600034FD19C000936000C6E8D0E018C028 -:100540003091910034FD10C000939100C2E9D0E0D9 -:100550000FC02795A8F45150A9F4220F0000F9CF3D -:100560004AE503C042ED01C0432FC4E1D0E032E0D0 -:1005700014B31360A89A14BB05B320E413E05F938F -:10058000012756E005BB279520F4515021F4220F96 -:10059000F9CF012756E000003B5A05BBD0F2279562 -:1005A00028F4515029F4220F0000F9CF012756E01A -:1005B000279505BB20F4515021F4220FF9CF0127D4 -:1005C00056E02991332305BB21F60C7F1091A3003F -:1005D000110FC651D04005BB11F010939D0010E4DF -:1005E0001ABF016014B31C7F402F4C7F5F9100C085 -:1005F00000C005BB14BB45BB71CF20E030E0D90182 -:100600003FD2802D823481F082E4D901082E40D27D -:100610008FEF21E030E0D901082E3AD242E050E0DD -:10062000DA01082E35D204C021E030E042E050E08B -:1006300087B3866087BB81EE8FBD89E08EBD89B7A9 -:10064000837C89BFD9011CD2802D99279BBD8ABD8F -:10065000DA0116D2802D992799BD88BD0895982F6B -:1006600021E030E0D9010CD2802D981719F0D90182 -:10067000092E0ED2892F99279BBD8ABD0895982FE8 -:1006800022E030E0D901FCD1802D981719F0D90172 -:10069000092EFED1892F992799BD88BD089588E13B -:1006A00090E02EE00FB6F894A89581BD0FBE21BD55 -:1006B00088EF81BB12BA15BA8FEF84BB80E49CE946 -:1006C0000197F1F78CEF84BB01DD97DFA598AD9A18 -:1006D000B898C09A81E086D1882329F08091810062 -:1006E00081608093810082E07DD1882321F1809117 -:1006F000810082608093810080FD16C081FD0DC065 -:10070000992780FF06C081FF04C069E770E083E09D -:1007100057D17894A895E7DCFDCF60E770E082E0E0 -:100720004FD180918100ECCF62E670E081E048D14A -:1007300080918100E3CF80918100DECFFF920F9303 -:100740001F93CF93DF93EC0182E890E09093A10098 -:100750008093A000898193E0F92EF822F394869586 -:1007600086958695982F9370869586958230F9F0B8 -:10077000833040F0833009F443C0843091F180E04D -:1007800090E069C0882321F18130C9F70091810090 -:100790000923A9F3FF2099F310E0FE01E10FF11DF9 -:1007A0006281802FF2D01F5FF116B9F7E8CF009178 -:1007B0008100092321F3FF2011F310E0FE01E10F76 -:1007C000F11D6281802FEDD01F5FF116B9F7D7CFF1 -:1007D0008A81809382008B818093830082E090E005 -:1007E0003AC0913029F19130D0F0923041F68091A9 -:1007F0008100809382001092830082E090E02BC001 -:10080000992341F0913009F0BACF8A8138DF80E036 -:1008100090E021C08A8123DF80E090E01CC081E06D -:100820008093820089E08093830082E090E013C08F -:1008300083B3B09B0EC090E08295869587708095BB -:100840008170982B909382001092830082E090E058 -:1008500002C092E0F1CFDF91CF911F910F91FF90F5 -:1008600008959927AC014170507080FDAB9A9C01AE -:100870002270307081FDAC9A00C04111AB98232BDF -:1008800009F0AC980895FF920F931F93F82E062F4E -:10089000442311F0939A01C09398AA9881B3806F72 -:1008A00081BB12B31F70802F807F812B82BB8F2D65 -:1008B000D8DF0295007F012B02BB8F2DD2DF106F96 -:1008C00012BB1F910F91FF900895982F662359F145 -:1008D000939AAA9A81B38F7081BB82B3806F82BBD7 -:1008E000892F9927BC016170707080FDAB9AAC01B3 -:1008F0004270507081FDAC9A00C080B36111AB981A -:100900004115510509F0AC9800C06111AB9A411531 -:10091000510509F0AC9A00C020B36111AB98452B8A -:1009200021F0AC9802C09398D4CF807F22952F708D -:10093000822B99270895FF920F931F93CF93DF93F4 -:1009400099278C0101701070EC01C270D07004C046 -:10095000FF24209791F00CC001151105C9F360E048 -:1009600081E0B3DFF82EFF1CFF24FF1C209729F045 -:1009700060E082E0AADF87FDEFCFFF2069F7DF911B -:10098000CF911F910F91FF9008950F931F93182FF0 -:10099000062FD1DF40E0602F812F75DF1F910F916F -:1009A00008950F931F93182F062FC5DF41E0602F86 -:1009B000812F69DF1F910F91089561E0E6DF0895AF -:1009C0001F93CF93DF93182FEB016881662331F0DB -:1009D0002196812FE6DF68816623D1F7DF91CF91E1 -:1009E0001F9108951F93CF93DF93182F81B3806FCA -:1009F00081BB8B9AA29AA39AA49A80E89BEB019759 -:100A0000F1F782B38F70806382BB812F2ADF80E889 -:100A10009AE30197F1F7812F24DFC0ECD0E0CE01FB -:100A20000197F1F7812F1DDFCE010197F1F7919822 -:100A3000812F17DFCE010197F1F760E0812F45DFAD -:100A400087FD18C068E2812FA0DF2197F1F760E0F1 -:100A5000812F3BDF87FD0EC068E0812F96DF812F5D -:100A6000ACDF66E0812F91DF6CE0812F8EDF81E0CB -:100A700090E002C080E090E0DF91CF911F91089557 -:100A8000E199FECFBFBBAEBBE09A11960DB20895BF -:100A9000E199FECFBFBBAEBB0DBA11960FB6F8946D -:0A0AA000E29AE19A0FBE0895FFCF1D -:100AAA005AFF4C4344325553422056312E303900B6 -:100ABA00326E64206374726C0020626F7468210065 +:1000000049C0B8C163C062C061C060C05FC05EC0AB +:100010005DC05CC05BC05AC059C058C057C056C014 +:1000200055C054C053C009021900010100A02509A0 +:1000300004000001000000000705810308000A1207 +:10004000011001FF000008030430C609010102008D +:100050000124034C00430044003200550053004289 +:1000600000200049006E00740065007200660061A7 +:1000700000630065001A03540069006C006C0020E6 +:10008000004800610072006200610075006D0004AC +:100090000309040011241FBECFE5D4E0DEBFCDBFAD +:1000A00010E0A0E6B0E0E2EBFAE003C0C8953196BC +:1000B0000D92A038B107D1F720E0A0E8B0E001C070 +:1000C0001D92AC3BB207E1F78DD4F1C499CFCF9329 +:1000D000C62F2091910024FF18C03091920028E88B +:1000E0002327209392002C2FFC01A3E9B0E08191FB +:1000F0008D9321501216DCF36C2F83E990E036D1FA +:10010000CC5FC0939100CF9108952AE52093910090 +:10011000EACFCF93DF938091A200835087FD07C081 +:1001200090919E009D3209F448C01092A2008091E7 +:10013000610084FF35C0609160006F3F89F16930D4 +:1001400008F46AC06850609360009091860088E867 +:10015000892780938600CCE068E02091A000309150 +:10016000A1008091800086FF6AC0A7E8B0E0F90195 +:10017000862F94919D9331968150D9F78FEF860FFA +:1001800090E00196280F391F3093A1002093A00022 +:1001900087E890E0EBD0CC3009F04DC0C09361000F +:1001A00094E183B3837031F49150D9F71092A30096 +:1001B00010929D00DF91CF910895883009F0B5CF5E +:1001C00080919F00CCE0D0E0C81BD109CA55DF4F19 +:1001D00083EC809386008AE5809361001092800012 +:1001E00088818076A9F59A8110928F00898181118A +:1001F00035C0109290002FE830E082E03093A100EB +:100200002093A0009F81911104C09E81981708F44B +:10021000892F8093600089CF1092600090918600B2 +:1002200088E8892780938600611115C060E087E81F +:1002300090E09CD0C4E08FEF80936000AFCFD901F5 +:10024000E7E8F0E0862F9D9191938150E1F796CFFA +:10025000CE0114D2D7CFC4E0C60F7FCF853079F05E +:100260008630B9F0883089F0893049F18A3009F454 +:1002700043C08B30D1F12FE830E080E0BFCF9093C6 +:10028000A3002FE830E080E0B9CF25EA30E081E03C +:10029000B5CF8B81813009F18230B9F0833029F0FC +:1002A00080E090E490938000ADCF911129C08FE859 +:1002B00090E09093A1008093A00084E0F2CF90930F +:1002C000A5002FE830E080E099CF86E290E090939F +:1002D000A1008093A00089E1E4CF8FE390E09093A8 +:1002E000A1008093A00082E1DCCF8BE48093920098 +:1002F0002FE830E080E082CF2FE830E081E07ECF51 +:10030000913051F0923061F681E590E09093A10038 +:100310008093A00084E2C5CF85E790E09093A10090 +:100320008093A0008AE1BDCF85B7836085BF8BB77E +:1003300080648BBFE1E9F0E08BE481838AE5808310 +:100340000895A82FB92F80E090E041E050EA609531 +:1003500030E009C02D9182279795879510F084276A +:100360009527305EC8F36F5FA8F30895EADF8D9399 +:100370009D930895CF93CFB7CF93C395989BE9F7FB +:10038000989B09C0989B07C0989B05C0989B03C089 +:10039000989B01C0A3C0DF93C0919F00DD27CA5581 +:1003A000DF4F989B02C0DF91EBCF2F930F931F93EA +:1003B00003B32FEF00FB20F94F933F9313B34FEF9D +:1003C000012700FB21F93BE031C04E7F012F13B321 +:1003D000216028C0102F4D7F2260000003B329C088 +:1003E0004B7F2460012F000013B32BC013B3477F52 +:1003F00028602AC04F7E03B320612CC04F7D13B309 +:1004000020622FC04F7B03B3206432C0422703B366 +:1004100049934FEF0000102710FB20F913B313701E +:10042000C9F1297F91F2012700FB21F903B3237F52 +:1004300089F2315058F1102710FB22F913B3277EAF +:1004400079F2012700FB23F92F7C81F203B31027F7 +:1004500010FB24F92F7971F200C013B3012700FBC0 +:1004600025F92F7359F200C003B3102710FB26F9AA +:10047000223040F200C013B3012700FB27F92430DB +:1004800028F64F77206813B30000F9CF10E41ABFA5 +:10049000002719C03B503195C31BD04010E41ABF50 +:1004A0000881033CF9F00B34E9F020919D0019819B +:1004B000110F1213EDCF4A81441F093641F10D325D +:1004C00011F0013E29F70093A4003F914F911F9135 +:1004D0000F912F91DF91CAB7C6FD4FCFCF91CFBFFC +:1004E000CF9118952091A400222379F31091A200B6 +:1004F000112369F534306AF13093A20020939E00F5 +:1005000010919F003BE0311B30939F0022C000916F +:10051000A2000130E4F40AE54F7049F43091610023 +:1005200034FD19C000936100C6E8D0E018C03091D6 +:10053000910034FD10C000939100C2E9D0E00FC0DB +:100540002795A8F45150A9F4220F0000F9CF4AE5ED +:1005500003C042ED01C0432FC4E1D0E032E014B348 +:100560001360A89A14BB05B320E413E05F9301273E +:1005700056E005BB279520F4515021F4220FF9CF06 +:10058000012756E000003B5A05BBD0F2279528F41E +:10059000515029F4220F0000F9CF012756E027958A +:1005A00005BB20F4515021F4220FF9CF012756E06A +:1005B0002991332305BB21F60C7F1091A300110F65 +:1005C000C651D04005BB11F010939D0010E41ABF36 +:1005D000016014B31C7F402F4C7F5F9100C000C0AE +:1005E00005BB14BB45BB71CF82E090E04BD2823497 +:1005F00061F062E482E090E04DD26FEF81E090E044 +:1006000049D26FEF80E090E045D287B3866087BB28 +:1006100081EE8FBD89E08EBD89B7837C89BF81E083 +:1006200090E030D290E09BBD8ABD80E090E02AD27D +:1006300090E099BD88BD0895CF93C82F81E090E0E8 +:1006400021D28C1721F06C2F81E090E023D28C2FE7 +:1006500090E09BBD8ABDCF910895CF93C82F80E0D5 +:1006600090E010D28C1721F06C2F80E090E012D235 +:100670008C2F90E099BD88BDCF910895FF920F9384 +:100680001F93CF93DF93EC0182E890E09093A10059 +:100690008093A0009981292F2370392F36953695A4 +:1006A00036953370929596959770923009F447C0BD +:1006B000F8F49923B9F19130A1F4F0908100F3227C +:1006C00081F08E010E5F1F4F30E02D5F3F4FC20F54 +:1006D000D31FF80161918F018F2DE0D0C017D10792 +:1006E000C1F780E0DF91CF911F910F91FF900895A6 +:1006F000933081F09430A9F7313009F441C0C0F152 +:10070000323079F7809181008093820010928300CB +:1007100082E0E8CF332341F1313019F78A819DDF40 +:1007200080E0E0CF8A81809382008B818093830078 +:1007300082E0DF91CF911F910F91FF900895F0908B +:100740008100F32271F28E010E5F1F4F30E02D5FAA +:100750003F4FC20FD31FF80161918F018F2DAFD092 +:100760000C171D07C1F7BDCF8A8166DF80E0BACFC5 +:1007700081E08093820089E08093830082E0B2CFA1 +:1007800083B382958695877038273170B09908C0F9 +:1007900082E0382B309382001092830082E0A2CF57 +:1007A00080E0F7CF282F217080FDAB9A982F9270B0 +:1007B00081FDAC9A00C02111AB989111AC980895BD +:1007C0000F931F93CF93DF931F92CDB7DEB7082F00 +:1007D000411120C09398AA9881B3806F81BB82B3E6 +:1007E000182F1F70862F807F812B82BB802F6983FB +:1007F000D9DF698180E1689FB0011124612B62BB60 +:10080000802FD0DF106F12BB0F90DF91CF911F911F +:100810000F910895939ADFCF9398AA9A91B39F70FE +:1008200091BB92B3906F92BB382F317080FDAB9A21 +:10083000282F227081FDAC9A00C080B3982F907F42 +:100840003111AB982111AC9800C03111AB9A211134 +:10085000AC9A00C080B382958F70892B3111AB9810 +:100860002111AC980895CF93DF93D82FD170C82F62 +:10087000C27006C0CC2379F082E0CEDF87FF0BC0C8 +:10088000DD23C1F381E0C8DF87FFF4CFCC23C1F3C0 +:1008900082E0C2DFF5CFDF91CF9108951F93CF9310 +:1008A000DF931F92CDB7DEB7182F6983DCDF40E0FE +:1008B0006981812F0F90DF91CF911F9181CF1F937D +:1008C000CF93DF931F92CDB7DEB7182F6983CBDFAD +:1008D00041E06981812F0F90DF91CF911F9170CFFF +:1008E000CF93C82FC0DF40E061E08C2FCF9168CF5D +:1008F0000F931F93CF93DF93D82FFB01C081CC239D +:1009000071F08B010F5F1F4F8D2FADDF41E06C2F1A +:100910008D2F56DFF801C1918F01C111F5CFDF9105 +:10092000CF911F910F9108950F931F93CF93C82FCD +:1009300081B3806F81BB8B9AA29AA39AA49A80E814 +:100940009BEB0197F1F782B38F70806382BB8C2F92 +:1009500029DF80E89AE30197F1F78C2F23DF00EC81 +:1009600010E0C8010197F1F78C2F1CDFC801019737 +:10097000F1F791988C2F16DFC8010197F1F78C2FB2 +:100980004BDF87FD2AC08C2F6EDF40E068E28C2FA2 +:1009900017DFC8010197F1F78C2F3EDF87FD1DC0DF +:1009A0008C2F61DF40E068E08C2F0ADF8C2F5BDF4B +:1009B00040E061E08C2F04DF8C2F55DF40E066E0E3 +:1009C0008C2FFEDE8C2F4FDF40E06CE08C2FF8DEAA +:1009D00081E0CF911F910F91089580E0CF911F91F9 +:1009E0000F9108959EE088E10FB6F894A89581BD17 +:1009F0000FBE91BD88EF81BB12BA15BA8FEF84BBD1 +:100A000080E49CE90197F1F78CEF84BB8DDCECDD91 +:100A1000A598AD9AB898C09A81E086DF882329F01E +:100A20008091810081608093810082E07DDF882356 +:100A300081F08091810082608093810080FD0DC0F3 +:100A400081FD13C083708330C9F07894A89561DB71 +:100A5000FDCF8091810080FFF3CF62E670E081E0FE +:100A600047DF8091810081FFEDCF60E770E082E099 +:100A70003FDF809181008370833039F769E770E050 +:100A800037DFE3CFE199FECF9FBB8EBBE09A99277A +:100A90008DB30895262FE199FECF9FBB8EBB2DBB52 +:100AA0000FB6F894E29AE19A0FBE01960895F89471 +:020AB000FFCF76 +:100AB200FF5A4C4344325553422056312E303900AE +:100AC200326E64206374726C0020626F746821005D :00000001FF diff --git a/firmware/lcd.o b/firmware/lcd.o new file mode 100644 index 0000000..94c1021 Binary files /dev/null and b/firmware/lcd.o differ diff --git a/firmware/main.o b/firmware/main.o new file mode 100644 index 0000000..8e869b7 Binary files /dev/null and b/firmware/main.o differ diff --git a/firmware/usbdrv/Changelog.txt b/firmware/usbdrv/Changelog.txt index 5c6354a..79b5215 100644 --- a/firmware/usbdrv/Changelog.txt +++ b/firmware/usbdrv/Changelog.txt @@ -306,3 +306,24 @@ Scroll down to the bottom to see the most recent changes. endpoint now. * Release 2010-07-15 + + - Fixed bug in usbDriverSetup() which prevented descriptor sizes above 255 + bytes. + - Avoid a compiler warning for unused parameter in usbHandleResetHook() when + compiler option -Wextra is enabled. + - Fixed wrong hex value for some IDs in USB-IDs-for-free.txt. + - Keep a define for USBATTR_BUSPOWER, although the flag does not exist + in USB 1.1 any more. Set it to 0. This is for backward compatibility. + +* Release 2012-01-09 + + - Define a separate (defined) type for usbMsgPtr so that projects using a + tiny memory model can define it to an 8 bit type in usbconfig.h. This + change also saves a couple of bytes when using a scalar 16 bit type. + - Inserted "const" keyword for all PROGMEM declarations because new GCC + requires it. + - Fixed problem with dependence of usbportability.h on usbconfig.h. This + problem occurred with IAR CC only. + - Prepared repository for github.com. + +* Release 2012-12-06 \ No newline at end of file diff --git a/firmware/usbdrv/CommercialLicense.txt b/firmware/usbdrv/CommercialLicense.txt index 11d07d9..de1a2b0 100644 --- a/firmware/usbdrv/CommercialLicense.txt +++ b/firmware/usbdrv/CommercialLicense.txt @@ -1,5 +1,5 @@ V-USB Driver Software License Agreement -Version 2009-08-03 +Version 2012-07-09 THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING @@ -37,10 +37,10 @@ Product ID(s), sent to you in e-mail. These Product IDs are reserved exclusively for you. OBJECTIVE DEVELOPMENT has obtained USB Product ID ranges under the Vendor ID 5824 from Wouter van Ooijen (Van Ooijen Technische Informatica, www.voti.nl) and under the Vendor ID 8352 from -Jason Kotzin (Clay Logic, www.claylogic.com). Both owners of the Vendor IDs -have obtained these IDs from the USB Implementers Forum, Inc. -(www.usb.org). OBJECTIVE DEVELOPMENT disclaims all liability which might -arise from the assignment of USB IDs. +Jason Kotzin (now flirc.tv, Inc.). Both owners of the Vendor IDs have +obtained these IDs from the USB Implementers Forum, Inc. (www.usb.org). +OBJECTIVE DEVELOPMENT disclaims all liability which might arise from the +assignment of USB IDs. 2.5 USB Certification. Although not part of this agreement, we want to make it clear that you cannot become USB certified when you use V-USB or a USB diff --git a/firmware/usbdrv/USB-ID-FAQ.txt b/firmware/usbdrv/USB-ID-FAQ.txt index d1de8fb..a4a6bd6 100644 --- a/firmware/usbdrv/USB-ID-FAQ.txt +++ b/firmware/usbdrv/USB-ID-FAQ.txt @@ -1,4 +1,4 @@ -Version 2009-08-22 +Version 2012-07-09 ========================== WHY DO WE NEED THESE IDs? @@ -107,8 +107,8 @@ WHO IS THE OWNER OF THE VENDOR-ID? Objective Development has obtained ranges of USB Product-IDs under two Vendor-IDs: Under Vendor-ID 5824 from Wouter van Ooijen (Van Ooijen Technische Informatica, www.voti.nl) and under Vendor-ID 8352 from Jason -Kotzin (Clay Logic, www.claylogic.com). Both VID owners have received their -Vendor-ID directly from usb.org. +Kotzin (now flirc.tv, Inc.). Both VID owners have received their Vendor-ID +directly from usb.org. ========================================================================= diff --git a/firmware/usbdrv/USB-IDs-for-free.txt b/firmware/usbdrv/USB-IDs-for-free.txt index 2f4d59a..d46517d 100644 --- a/firmware/usbdrv/USB-IDs-for-free.txt +++ b/firmware/usbdrv/USB-IDs-for-free.txt @@ -86,8 +86,9 @@ If you use one of the IDs listed below, your device and host-side software must conform to these rules: (1) The USB device MUST provide a textual representation of the serial -number. The serial number string MUST be available at least in USB language -0x0409 (English/US). +number, unless ONLY the operating system's default class driver is used. +The serial number string MUST be available at least in USB language 0x0409 +(English/US). (2) The serial number MUST start with either an Internet domain name (e.g. "mycompany.com") registered and owned by you, or an e-mail address under your @@ -108,6 +109,11 @@ driver for Vendor Class devices is needed, this driver must be libusb or libusb-win32 (see http://libusb.org/ and http://libusb-win32.sourceforge.net/). +(7) If ONLY the operating system's default class driver is used, e.g. for +mice, keyboards, joysticks, CDC or MIDI devices and no discrimination by an +application is needed, the serial number may be omitted. + + Table if IDs for discrimination by serial number string: PID dec (hex) | VID dec (hex) | Description of use @@ -121,11 +127,11 @@ PID dec (hex) | VID dec (hex) | Description of use ---------------+---------------+------------------------------------------- 10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards ---------------+---------------+------------------------------------------- -10204 (0x27db) | 5824 (0x16c0) | For USB Joysticks +10204 (0x27dc) | 5824 (0x16c0) | For USB Joysticks ---------------+---------------+------------------------------------------- -10205 (0x27dc) | 5824 (0x16c0) | For CDC-ACM class devices (modems) +10205 (0x27dd) | 5824 (0x16c0) | For CDC-ACM class devices (modems) ---------------+---------------+------------------------------------------- -10206 (0x27dd) | 5824 (0x16c0) | For MIDI class devices +10206 (0x27de) | 5824 (0x16c0) | For MIDI class devices ---------------+---------------+------------------------------------------- diff --git a/firmware/usbdrv/asmcommon.inc b/firmware/usbdrv/asmcommon.inc index 07d692b..d2a4f7c 100644 --- a/firmware/usbdrv/asmcommon.inc +++ b/firmware/usbdrv/asmcommon.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id$ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/oddebug.c b/firmware/usbdrv/oddebug.c index 945457c..19bf142 100644 --- a/firmware/usbdrv/oddebug.c +++ b/firmware/usbdrv/oddebug.c @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ */ #include "oddebug.h" diff --git a/firmware/usbdrv/oddebug.h b/firmware/usbdrv/oddebug.h index d61309d..851f84d 100644 --- a/firmware/usbdrv/oddebug.h +++ b/firmware/usbdrv/oddebug.h @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: oddebug.h 692 2008-11-07 15:07:40Z cs $ */ #ifndef __oddebug_h_included__ diff --git a/firmware/usbdrv/oddebug.o b/firmware/usbdrv/oddebug.o new file mode 100644 index 0000000..fddc1a8 Binary files /dev/null and b/firmware/usbdrv/oddebug.o differ diff --git a/firmware/usbdrv/usbconfig-prototype.h b/firmware/usbdrv/usbconfig-prototype.h index 847710e..22dd9e8 100644 --- a/firmware/usbdrv/usbconfig-prototype.h +++ b/firmware/usbdrv/usbconfig-prototype.h @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ #ifndef __usbconfig_h_included__ @@ -356,6 +355,15 @@ section at the end of this file). #define USB_CFG_DESCR_PROPS_HID_REPORT 0 #define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +//#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We may define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + /* ----------------------- Optional MCU Description ------------------------ */ /* The following configurations have working defaults in usbdrv.h. You diff --git a/firmware/usbdrv/usbdrv.c b/firmware/usbdrv/usbdrv.c index 21ed554..b6df986 100644 --- a/firmware/usbdrv/usbdrv.c +++ b/firmware/usbdrv/usbdrv.c @@ -5,10 +5,8 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.c 791 2010-07-15 15:56:13Z cs $ */ -#include "usbportability.h" #include "usbdrv.h" #include "oddebug.h" @@ -45,7 +43,7 @@ uchar usbCurrentDataToken;/* when we check data toggling to ignore duplica #endif /* USB status registers / not shared with asm code */ -uchar *usbMsgPtr; /* data to transmit next -- ROM or RAM address */ +usbMsgPtr_t usbMsgPtr; /* data to transmit next -- ROM or RAM address */ static usbMsgLen_t usbMsgLen = USB_NO_MSG; /* remaining number of bytes */ static uchar usbMsgFlags; /* flag values see below */ @@ -67,7 +65,7 @@ optimizing hints: #if USB_CFG_DESCR_PROPS_STRING_0 == 0 #undef USB_CFG_DESCR_PROPS_STRING_0 #define USB_CFG_DESCR_PROPS_STRING_0 sizeof(usbDescriptorString0) -PROGMEM char usbDescriptorString0[] = { /* language descriptor */ +PROGMEM const char usbDescriptorString0[] = { /* language descriptor */ 4, /* sizeof(usbDescriptorString0): length of descriptor in bytes */ 3, /* descriptor type */ 0x09, 0x04, /* language index (0x0409 = US-English) */ @@ -77,7 +75,7 @@ PROGMEM char usbDescriptorString0[] = { /* language descriptor */ #if USB_CFG_DESCR_PROPS_STRING_VENDOR == 0 && USB_CFG_VENDOR_NAME_LEN #undef USB_CFG_DESCR_PROPS_STRING_VENDOR #define USB_CFG_DESCR_PROPS_STRING_VENDOR sizeof(usbDescriptorStringVendor) -PROGMEM int usbDescriptorStringVendor[] = { +PROGMEM const int usbDescriptorStringVendor[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_VENDOR_NAME_LEN), USB_CFG_VENDOR_NAME }; @@ -86,7 +84,7 @@ PROGMEM int usbDescriptorStringVendor[] = { #if USB_CFG_DESCR_PROPS_STRING_PRODUCT == 0 && USB_CFG_DEVICE_NAME_LEN #undef USB_CFG_DESCR_PROPS_STRING_PRODUCT #define USB_CFG_DESCR_PROPS_STRING_PRODUCT sizeof(usbDescriptorStringDevice) -PROGMEM int usbDescriptorStringDevice[] = { +PROGMEM const int usbDescriptorStringDevice[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_DEVICE_NAME_LEN), USB_CFG_DEVICE_NAME }; @@ -95,7 +93,7 @@ PROGMEM int usbDescriptorStringDevice[] = { #if USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER == 0 && USB_CFG_SERIAL_NUMBER_LEN #undef USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER #define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER sizeof(usbDescriptorStringSerialNumber) -PROGMEM int usbDescriptorStringSerialNumber[] = { +PROGMEM const int usbDescriptorStringSerialNumber[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_SERIAL_NUMBER_LEN), USB_CFG_SERIAL_NUMBER }; @@ -108,7 +106,7 @@ PROGMEM int usbDescriptorStringSerialNumber[] = { #if USB_CFG_DESCR_PROPS_DEVICE == 0 #undef USB_CFG_DESCR_PROPS_DEVICE #define USB_CFG_DESCR_PROPS_DEVICE sizeof(usbDescriptorDevice) -PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ +PROGMEM const char usbDescriptorDevice[] = { /* USB device descriptor */ 18, /* sizeof(usbDescriptorDevice): length of descriptor in bytes */ USBDESCR_DEVICE, /* descriptor type */ 0x10, 0x01, /* USB version supported */ @@ -139,7 +137,7 @@ PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ #if USB_CFG_DESCR_PROPS_CONFIGURATION == 0 #undef USB_CFG_DESCR_PROPS_CONFIGURATION #define USB_CFG_DESCR_PROPS_CONFIGURATION sizeof(usbDescriptorConfiguration) -PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor */ +PROGMEM const char usbDescriptorConfiguration[] = { /* USB configuration descriptor */ 9, /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */ USBDESCR_CONFIG, /* descriptor type */ 18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT3 + @@ -151,7 +149,7 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor #if USB_CFG_IS_SELF_POWERED (1 << 7) | USBATTR_SELFPOWER, /* attributes */ #else - (1 << 7), /* attributes */ + (1 << 7) | USBATTR_REMOTEWAKE, /* attributes */ #endif USB_CFG_MAX_BUS_POWER/2, /* max USB current in 2mA units */ /* interface descriptor follows inline: */ @@ -221,7 +219,7 @@ static inline void usbResetStall(void) static void usbGenericSetInterrupt(uchar *data, uchar len, usbTxStatus_t *txStatus) { uchar *p; -char i; +schar i; #if USB_CFG_IMPLEMENT_HALT if(usbTxLen1 == USBPID_STALL) @@ -301,7 +299,7 @@ USB_PUBLIC void usbSetInterrupt3(uchar *data, uchar len) len = usbFunctionDescriptor(rq); \ }else{ \ len = USB_PROP_LENGTH(cfgProp); \ - usbMsgPtr = (uchar *)(staticName); \ + usbMsgPtr = (usbMsgPtr_t)(staticName); \ } \ } @@ -361,7 +359,8 @@ uchar flags = USB_FLG_MSGPTR_IS_ROM; */ static inline usbMsgLen_t usbDriverSetup(usbRequest_t *rq) { -uchar len = 0, *dataPtr = usbTxBuf + 9; /* there are 2 bytes free space at the end of the buffer */ +usbMsgLen_t len = 0; +uchar *dataPtr = usbTxBuf + 9; /* there are 2 bytes free space at the end of the buffer */ uchar value = rq->wValue.bytes[0]; #if USB_CFG_IMPLEMENT_HALT uchar index = rq->wIndex.bytes[0]; @@ -408,7 +407,7 @@ uchar index = rq->wIndex.bytes[0]; SWITCH_DEFAULT /* 7=SET_DESCRIPTOR, 12=SYNC_FRAME */ /* Should we add an optional hook here? */ SWITCH_END - usbMsgPtr = dataPtr; + usbMsgPtr = (usbMsgPtr_t)dataPtr; skipMsgPtrAssignment: return len; } @@ -498,7 +497,8 @@ static uchar usbDeviceRead(uchar *data, uchar len) }else #endif { - uchar i = len, *r = usbMsgPtr; + uchar i = len; + usbMsgPtr_t r = usbMsgPtr; if(usbMsgFlags & USB_FLG_MSGPTR_IS_ROM){ /* ROM data */ do{ uchar c = USB_READ_FLASH(r); /* assign to char size variable to enforce byte ops */ @@ -507,7 +507,8 @@ static uchar usbDeviceRead(uchar *data, uchar len) }while(--i); }else{ /* RAM data */ do{ - *data++ = *r++; + *data++ = *((uchar *)r); + r++; }while(--i); } usbMsgPtr = r; @@ -557,6 +558,8 @@ uchar isReset = !notResetState; USB_RESET_HOOK(isReset); wasReset = isReset; } +#else + notResetState = notResetState; // avoid compiler warning #endif } diff --git a/firmware/usbdrv/usbdrv.h b/firmware/usbdrv/usbdrv.h index 3a78f30..113854e 100644 --- a/firmware/usbdrv/usbdrv.h +++ b/firmware/usbdrv/usbdrv.h @@ -5,13 +5,10 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.h 793 2010-07-15 15:58:11Z cs $ */ #ifndef __usbdrv_h_included__ #define __usbdrv_h_included__ -#include "usbconfig.h" -#include "usbportability.h" /* Hardware Prerequisites: @@ -118,11 +115,28 @@ USB messages, even if they address another (low-speed) device on the same bus. */ + +#ifdef __cplusplus +// This header should be included as C-header from C++ code. However if usbdrv.c +// is incorporated into a C++ module with an include, function names are mangled +// and this header must be parsed as C++ header, too. External modules should be +// treated as C, though, because they are compiled separately as C code. +extern "C" { +#endif + +#include "usbconfig.h" +#include "usbportability.h" + +#ifdef __cplusplus +} +#endif + + /* ------------------------------------------------------------------------- */ /* --------------------------- Module Interface ---------------------------- */ /* ------------------------------------------------------------------------- */ -#define USBDRV_VERSION 20100715 +#define USBDRV_VERSION 20121206 /* This define uniquely identifies a driver version. It is a decimal number * constructed from the driver's release date in the form YYYYMMDD. If the * driver's behavior or interface changes, you can use this constant to @@ -163,6 +177,17 @@ USB messages, even if they address another (low-speed) device on the same bus. */ #define USB_NO_MSG ((usbMsgLen_t)-1) /* constant meaning "no message" */ +#ifndef usbMsgPtr_t +#define usbMsgPtr_t uchar * +#endif +/* Making usbMsgPtr_t a define allows the user of this library to define it to + * an 8 bit type on tiny devices. This reduces code size, especially if the + * compiler supports a tiny memory model. + * The type can be a pointer or scalar type, casts are made where necessary. + * Although it's paradoxical, Gcc 4 generates slightly better code for scalar + * types than for pointers. + */ + struct usbRequest; /* forward declaration */ USB_PUBLIC void usbInit(void); @@ -178,7 +203,7 @@ USB_PUBLIC void usbPoll(void); * Please note that debug outputs through the UART take ~ 0.5ms per byte * at 19200 bps. */ -extern uchar *usbMsgPtr; +extern usbMsgPtr_t usbMsgPtr; /* This variable may be used to pass transmit data to the driver from the * implementation of usbFunctionWrite(). It is also used internally by the * driver for standard control requests. @@ -390,13 +415,13 @@ extern volatile schar usbRxLen; * about the various methods to define USB descriptors. If you do nothing, * the default descriptors will be used. */ -#define USB_PROP_IS_DYNAMIC (1 << 14) +#define USB_PROP_IS_DYNAMIC (1u << 14) /* If this property is set for a descriptor, usbFunctionDescriptor() will be * used to obtain the particular descriptor. Data directly returned via * usbMsgPtr are FLASH data by default, combine (OR) with USB_PROP_IS_RAM to * return RAM data. */ -#define USB_PROP_IS_RAM (1 << 15) +#define USB_PROP_IS_RAM (1u << 15) /* If this property is set for a descriptor, the data is read from RAM * memory instead of Flash. The property is used for all methods to provide * external descriptors. @@ -450,43 +475,43 @@ extern volatile schar usbRxLen; #ifndef __ASSEMBLER__ extern #if !(USB_CFG_DESCR_PROPS_DEVICE & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorDevice[]; extern #if !(USB_CFG_DESCR_PROPS_CONFIGURATION & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorConfiguration[]; extern #if !(USB_CFG_DESCR_PROPS_HID_REPORT & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorHidReport[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_0 & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorString0[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_VENDOR & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif int usbDescriptorStringVendor[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_PRODUCT & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif int usbDescriptorStringDevice[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif int usbDescriptorStringSerialNumber[]; @@ -719,6 +744,7 @@ typedef struct usbRequest{ #define USBDESCR_HID_PHYS 0x23 //#define USBATTR_BUSPOWER 0x80 // USB 1.1 does not define this value any more +#define USBATTR_BUSPOWER 0 #define USBATTR_SELFPOWER 0x40 #define USBATTR_REMOTEWAKE 0x20 diff --git a/firmware/usbdrv/usbdrv.o b/firmware/usbdrv/usbdrv.o new file mode 100644 index 0000000..edaeffb Binary files /dev/null and b/firmware/usbdrv/usbdrv.o differ diff --git a/firmware/usbdrv/usbdrvasm.S b/firmware/usbdrv/usbdrvasm.S index 45fcf18..3bda63c 100644 --- a/firmware/usbdrv/usbdrvasm.S +++ b/firmware/usbdrv/usbdrvasm.S @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm.S 785 2010-05-30 17:57:07Z cs $ */ /* @@ -146,7 +145,8 @@ RTMODEL "__rt_version", "3" #if USB_USE_FAST_CRC ; This implementation is faster, but has bigger code size -; Thanks to Slawomir Fras (BoskiDialer) for this code! +; Thanks to Slawomir Fras (BoskiDialer) for this code and to Shay Green for +; even further optimizations! ; It implements the following C pseudo-code: ; unsigned table(unsigned char x) ; { @@ -176,35 +176,29 @@ RTMODEL "__rt_version", "3" ; resCrc r24+r25 / r16+r17 ; ptr X / Z usbCrc16: - mov ptrL, argPtrL - mov ptrH, argPtrH + movw ptrL, argPtrL ldi resCrcL, 0xFF ldi resCrcH, 0xFF + clr bitCnt ; zero reg rjmp usbCrc16LoopTest usbCrc16ByteLoop: ld byte, ptr+ - eor resCrcL, byte ; resCrcL is now 'x' in table() - mov byte, resCrcL ; compute parity of 'x' + eor byte, resCrcL ; scratch is now 'x' in table() + mov scratch, byte ; compute parity of 'x' swap byte - eor byte, resCrcL - mov scratch, byte + eor byte, scratch + mov resCrcL, byte lsr byte lsr byte - eor byte, scratch + eor byte, resCrcL inc byte - lsr byte - andi byte, 1 ; byte is now parity(x) - mov scratch, resCrcL - mov resCrcL, resCrcH - eor resCrcL, byte ; low byte of if(parity(x)) value ^= 0xc001; - neg byte - andi byte, 0xc0 - mov resCrcH, byte ; high byte of if(parity(x)) value ^= 0xc001; - clr byte - lsr scratch - ror byte - eor resCrcH, scratch - eor resCrcL, byte + andi byte, 2 ; byte is now parity(x) << 1 + cp bitCnt, byte ; c = (byte != 0), then put in high bit + ror scratch ; so that after xoring, shifting, and xoring, it gives + ror byte ; the desired 0xC0 with resCrcH + mov resCrcL, byte + eor resCrcL, resCrcH + mov resCrcH, scratch lsr scratch ror byte eor resCrcH, scratch @@ -372,7 +366,7 @@ usbMFTimeout: # if USB_CFG_CLOCK_KHZ == 18000 # include "usbdrvasm18-crc.inc" # else -# error "USB_CFG_CLOCK_KHZ is not one of the supported crc-rates!" +# error "USB_CFG_CLOCK_KHZ is not one of the supported rates for USB_CFG_CHECK_CRC!" # endif #else /* USB_CFG_CHECK_CRC */ # if USB_CFG_CLOCK_KHZ == 12000 @@ -385,9 +379,11 @@ usbMFTimeout: # include "usbdrvasm16.inc" # elif USB_CFG_CLOCK_KHZ == 16500 # include "usbdrvasm165.inc" +# elif USB_CFG_CLOCK_KHZ == 18000 +# include "usbdrvasm18.inc" # elif USB_CFG_CLOCK_KHZ == 20000 # include "usbdrvasm20.inc" # else -# error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!" +# error "USB_CFG_CLOCK_KHZ is not one of the supported rates!" # endif #endif /* USB_CFG_CHECK_CRC */ diff --git a/firmware/usbdrv/usbdrvasm.asm b/firmware/usbdrv/usbdrvasm.asm index 9cc4e4d..fb66934 100644 --- a/firmware/usbdrv/usbdrvasm.asm +++ b/firmware/usbdrv/usbdrvasm.asm @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id$ */ /* diff --git a/firmware/usbdrv/usbdrvasm.o b/firmware/usbdrv/usbdrvasm.o new file mode 100644 index 0000000..32bc0ef Binary files /dev/null and b/firmware/usbdrv/usbdrvasm.o differ diff --git a/firmware/usbdrv/usbdrvasm12.inc b/firmware/usbdrv/usbdrvasm12.inc index c116758..d3bd056 100644 --- a/firmware/usbdrv/usbdrvasm12.inc +++ b/firmware/usbdrv/usbdrvasm12.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm12.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm128.inc b/firmware/usbdrv/usbdrvasm128.inc index bcd6621..8f67bcc 100644 --- a/firmware/usbdrv/usbdrvasm128.inc +++ b/firmware/usbdrv/usbdrvasm128.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm128.inc 758 2009-08-06 10:12:54Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm15.inc b/firmware/usbdrv/usbdrvasm15.inc index 401b7f8..33bcf0e 100644 --- a/firmware/usbdrv/usbdrvasm15.inc +++ b/firmware/usbdrv/usbdrvasm15.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm15.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm16.inc b/firmware/usbdrv/usbdrvasm16.inc index 207b6e4..25b84e6 100644 --- a/firmware/usbdrv/usbdrvasm16.inc +++ b/firmware/usbdrv/usbdrvasm16.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm16.inc 760 2009-08-09 18:59:43Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm165.inc b/firmware/usbdrv/usbdrvasm165.inc index 79b3c61..ae91588 100644 --- a/firmware/usbdrv/usbdrvasm165.inc +++ b/firmware/usbdrv/usbdrvasm165.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm165.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm18-crc.inc b/firmware/usbdrv/usbdrvasm18-crc.inc index f83347d..0ff2f42 100644 --- a/firmware/usbdrv/usbdrvasm18-crc.inc +++ b/firmware/usbdrv/usbdrvasm18-crc.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2008 by Lukas Schrittwieser and OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm18-crc.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm18.inc b/firmware/usbdrv/usbdrvasm18.inc new file mode 100644 index 0000000..e058bb9 --- /dev/null +++ b/firmware/usbdrv/usbdrvasm18.inc @@ -0,0 +1,557 @@ +/* Name: usbdrvasm18.inc + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Lukas Schrittwieser (based on 20 MHz usbdrvasm20.inc by Jeroen Benschop) + * Creation Date: 2009-01-20 + * Tabsize: 4 + * Copyright: (c) 2008 by Lukas Schrittwieser and OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + */ + +/* Do not link this file! Link usbdrvasm.S instead, which includes the + * appropriate implementation! + */ + +/* +General Description: +This file is the 18 MHz version of the asssembler part of the USB driver. It +requires a 18 MHz crystal (not a ceramic resonator and not a calibrated RC +oscillator). + +See usbdrv.h for a description of the entire driver. + +Since almost all of this code is timing critical, don't change unless you +really know what you are doing! Many parts require not only a maximum number +of CPU cycles, but even an exact number of cycles! + +Note: This version is smaller than usbdrvasm18-crc.inc because it saves the CRC +table. It's therefore suitable for boot loaders on boards @ 18 MHz. However, it +is not as small as it could be, because loops are unrolled in the same way as in +usbdrvasm18-crc.inc. There is room for optimization. +*/ + + +;max stack usage: [ret(2), YL, SREG, YH, [sofError], bitcnt(x5), shift, x1, x2, x3, x4, cnt, ZL, ZH] = 14 bytes +;nominal frequency: 18 MHz -> 12 cycles per bit +; Numbers in brackets are clocks counted from center of last sync bit +; when instruction starts +;register use in receive loop to receive the data bytes: +; shift assembles the byte currently being received +; x1 holds the D+ and D- line state +; x2 holds the previous line state +; cnt holds the number of bytes left in the receive buffer +; x4 is used as temporary register +; x3 is used for unstuffing: when unstuffing the last received bit is inverted in shift (to prevent further +; unstuffing calls. In the same time the corresponding bit in x3 is cleared to mark the bit as beening iverted +; zl lower crc value and crc table index +; zh used for crc table accesses + + + +macro POP_STANDARD ; 18 cycles + pop cnt + pop x5 + pop x3 + pop x2 + pop x1 + pop shift + pop x4 + endm +macro POP_RETI ; 7 cycles + pop YH + pop YL + out SREG, YL + pop YL + endm + +;macro CRC_CLEANUP_AND_CHECK +; ; the last byte has already been xored with the lower crc byte, we have to do the table lookup and xor +; ; x3 is the higher crc byte, zl the lower one +; ldi ZH, hi8(usbCrcTableHigh);[+1] get the new high byte from the table +; lpm x2, Z ;[+2][+3][+4] +; ldi ZH, hi8(usbCrcTableLow);[+5] get the new low xor byte from the table +; lpm ZL, Z ;[+6][+7][+8] +; eor ZL, x3 ;[+7] xor the old high byte with the value from the table, x2:ZL now holds the crc value +; cpi ZL, 0x01 ;[+8] if the crc is ok we have a fixed remainder value of 0xb001 in x2:ZL (see usb spec) +; brne ignorePacket ;[+9] detected a crc fault -> paket is ignored and retransmitted by the host +; cpi x2, 0xb0 ;[+10] +; brne ignorePacket ;[+11] detected a crc fault -> paket is ignored and retransmitted by the host +; endm + + +USB_INTR_VECTOR: +;order of registers pushed: YL, SREG, YH, [sofError], x4, shift, x1, x2, x3, x5, cnt, ZL, ZH + push YL ;[-28] push only what is necessary to sync with edge ASAP + in YL, SREG ;[-26] + push YL ;[-25] + push YH ;[-23] +;---------------------------------------------------------------------------- +; Synchronize with sync pattern: +;---------------------------------------------------------------------------- +;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] +;sync up with J to K edge during sync pattern -- use fastest possible loops +;The first part waits at most 1 bit long since we must be in sync pattern. +;YL is guarenteed to be < 0x80 because I flag is clear. When we jump to +;waitForJ, ensure that this prerequisite is met. +waitForJ: + inc YL + sbis USBIN, USBMINUS + brne waitForJ ; just make sure we have ANY timeout +waitForK: +;The following code results in a sampling window of < 1/4 bit which meets the spec. + sbis USBIN, USBMINUS ;[-17] + rjmp foundK ;[-16] + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK +#if USB_COUNT_SOF + lds YL, usbSofCount + inc YL + sts usbSofCount, YL +#endif /* USB_COUNT_SOF */ +#ifdef USB_SOF_HOOK + USB_SOF_HOOK +#endif + rjmp sofError +foundK: ;[-15] +;{3, 5} after falling D- edge, average delay: 4 cycles +;bit0 should be at 30 (2.5 bits) for center sampling. Currently at 4 so 26 cylces till bit 0 sample +;use 1 bit time for setup purposes, then sample again. Numbers in brackets +;are cycles from center of first sync (double K) bit after the instruction + push x4 ;[-14] +; [---] ;[-13] + lds YL, usbInputBufOffset;[-12] used to toggle the two usb receive buffers +; [---] ;[-11] + clr YH ;[-10] + subi YL, lo8(-(usbRxBuf));[-9] [rx loop init] + sbci YH, hi8(-(usbRxBuf));[-8] [rx loop init] + push shift ;[-7] +; [---] ;[-6] + ldi shift, 0x80 ;[-5] the last bit is the end of byte marker for the pid receiver loop + clc ;[-4] the carry has to be clear for receipt of pid bit 0 + sbis USBIN, USBMINUS ;[-3] we want two bits K (sample 3 cycles too early) + rjmp haveTwoBitsK ;[-2] + pop shift ;[-1] undo the push from before + pop x4 ;[1] + rjmp waitForK ;[3] this was not the end of sync, retry +; The entire loop from waitForK until rjmp waitForK above must not exceed two +; bit times (= 24 cycles). + +;---------------------------------------------------------------------------- +; push more registers and initialize values while we sample the first bits: +;---------------------------------------------------------------------------- +haveTwoBitsK: + push x1 ;[0] + push x2 ;[2] + push x3 ;[4] + ldi x2, 1< jump back and store the byte + ori shift, 0x01 ;[11] invert the last received bit to prevent furhter unstuffing + in x2, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + andi x3, 0xFE ;[1] mark this bit as inverted (will be corrected before storing shift) + eor x1, x2 ;[2] x1 and x2 have to be different because the stuff bit is always a zero + andi x1, USBMASK ;[3] mask the interesting bits + breq stuffErr ;[4] if the stuff bit is a 1-bit something went wrong + mov x1, x2 ;[5] the next bit expects the last state to be in x1 + rjmp didunstuff0 ;[6] + ;[7] jump delay of rjmp didunstuffX + +unstuff1: ;[11] this is the jump delay of breq unstuffX + in x1, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + ori shift, 0x02 ;[1] invert the last received bit to prevent furhter unstuffing + andi x3, 0xFD ;[2] mark this bit as inverted (will be corrected before storing shift) + eor x2, x1 ;[3] x1 and x2 have to be different because the stuff bit is always a zero + andi x2, USBMASK ;[4] mask the interesting bits + breq stuffErr ;[5] if the stuff bit is a 1-bit something went wrong + mov x2, x1 ;[6] the next bit expects the last state to be in x2 + nop2 ;[7] + ;[8] + rjmp didunstuff1 ;[9] + ;[10] jump delay of rjmp didunstuffX + +unstuff2: ;[9] this is the jump delay of breq unstuffX + ori shift, 0x04 ;[10] invert the last received bit to prevent furhter unstuffing + andi x3, 0xFB ;[11] mark this bit as inverted (will be corrected before storing shift) + in x2, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + eor x1, x2 ;[1] x1 and x2 have to be different because the stuff bit is always a zero + andi x1, USBMASK ;[2] mask the interesting bits + breq stuffErr ;[3] if the stuff bit is a 1-bit something went wrong + mov x1, x2 ;[4] the next bit expects the last state to be in x1 + nop2 ;[5] + ;[6] + rjmp didunstuff2 ;[7] + ;[8] jump delay of rjmp didunstuffX + +unstuff3: ;[9] this is the jump delay of breq unstuffX + ori shift, 0x08 ;[10] invert the last received bit to prevent furhter unstuffing + andi x3, 0xF7 ;[11] mark this bit as inverted (will be corrected before storing shift) + in x1, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + eor x2, x1 ;[1] x1 and x2 have to be different because the stuff bit is always a zero + andi x2, USBMASK ;[2] mask the interesting bits + breq stuffErr ;[3] if the stuff bit is a 1-bit something went wrong + mov x2, x1 ;[4] the next bit expects the last state to be in x2 + nop2 ;[5] + ;[6] + rjmp didunstuff3 ;[7] + ;[8] jump delay of rjmp didunstuffX + + + +; the include has to be here due to branch distance restirctions +#include "asmcommon.inc" + + + +; USB spec says: +; idle = J +; J = (D+ = 0), (D- = 1) +; K = (D+ = 1), (D- = 0) +; Spec allows 7.5 bit times from EOP to SOP for replies +; 7.5 bit times is 90 cycles. ...there is plenty of time + + +sendNakAndReti: + ldi x3, USBPID_NAK ;[-18] + rjmp sendX3AndReti ;[-17] +sendAckAndReti: + ldi cnt, USBPID_ACK ;[-17] +sendCntAndReti: + mov x3, cnt ;[-16] +sendX3AndReti: + ldi YL, 20 ;[-15] x3==r20 address is 20 + ldi YH, 0 ;[-14] + ldi cnt, 2 ;[-13] +; rjmp usbSendAndReti fallthrough + +;usbSend: +;pointer to data in 'Y' +;number of bytes in 'cnt' -- including sync byte [range 2 ... 12] +;uses: x1...x4, btcnt, shift, cnt, Y +;Numbers in brackets are time since first bit of sync pattern is sent + +usbSendAndReti: ; 12 cycles until SOP + in x2, USBDDR ;[-12] + ori x2, USBMASK ;[-11] + sbi USBOUT, USBMINUS;[-10] prepare idle state; D+ and D- must have been 0 (no pullups) + in x1, USBOUT ;[-8] port mirror for tx loop + out USBDDR, x2 ;[-6] <- acquire bus + ldi x2, 0 ;[-6] init x2 (bitstuff history) because sync starts with 0 + ldi x4, USBMASK ;[-5] exor mask + ldi shift, 0x80 ;[-4] sync byte is first byte sent +txByteLoop: + ldi bitcnt, 0x40 ;[-3]=[9] binary 01000000 +txBitLoop: ; the loop sends the first 7 bits of the byte + sbrs shift, 0 ;[-2]=[10] if we have to send a 1 don't change the line state + eor x1, x4 ;[-1]=[11] + out USBOUT, x1 ;[0] + ror shift ;[1] + ror x2 ;[2] transfers the last sent bit to the stuffing history +didStuffN: + nop ;[3] + nop ;[4] + cpi x2, 0xfc ;[5] if we sent six consecutive ones + brcc bitstuffN ;[6] + lsr bitcnt ;[7] + brne txBitLoop ;[8] restart the loop while the 1 is still in the bitcount + +; transmit bit 7 + sbrs shift, 0 ;[9] + eor x1, x4 ;[10] +didStuff7: + ror shift ;[11] + out USBOUT, x1 ;[0] transfer bit 7 to the pins + ror x2 ;[1] move the bit into the stuffing history + cpi x2, 0xfc ;[2] + brcc bitstuff7 ;[3] + ld shift, y+ ;[4] get next byte to transmit + dec cnt ;[5] decrement byte counter + brne txByteLoop ;[7] if we have more bytes start next one + ;[8] branch delay + +;make SE0: + cbr x1, USBMASK ;[8] prepare SE0 [spec says EOP may be 25 to 30 cycles] + lds x2, usbNewDeviceAddr;[9] + lsl x2 ;[11] we compare with left shifted address + out USBOUT, x1 ;[0] <-- out SE0 -- from now 2 bits = 24 cycles until bus idle + subi YL, 20 + 2 ;[1] Only assign address on data packets, not ACK/NAK in x3 + sbci YH, 0 ;[2] +;2006-03-06: moved transfer of new address to usbDeviceAddr from C-Code to asm: +;set address only after data packet was sent, not after handshake + breq skipAddrAssign ;[3] + sts usbDeviceAddr, x2 ; if not skipped: SE0 is one cycle longer +skipAddrAssign: +;end of usbDeviceAddress transfer + ldi x2, 1<