From ad86a960d576ba1bbb3152dd267b608d0c7b7f3b Mon Sep 17 00:00:00 2001 From: Jenna Fox Date: Sun, 23 Sep 2012 18:27:20 +1000 Subject: Working towards getting firmware compiling again - close to testing new version --- firmware/libs-device/osccal.o | Bin 956 -> 0 bytes firmware/main.bin | Bin 9670 -> 0 bytes firmware/main.c | 78 +++++++------------ firmware/main.hex | 175 ------------------------------------------ firmware/main.o | Bin 7536 -> 0 bytes firmware/usbdrv/oddebug.c.lst | 16 ++-- 6 files changed, 37 insertions(+), 232 deletions(-) delete mode 100644 firmware/libs-device/osccal.o delete mode 100755 firmware/main.bin delete mode 100644 firmware/main.hex delete mode 100644 firmware/main.o diff --git a/firmware/libs-device/osccal.o b/firmware/libs-device/osccal.o deleted file mode 100644 index 79622f1..0000000 Binary files a/firmware/libs-device/osccal.o and /dev/null differ diff --git a/firmware/main.bin b/firmware/main.bin deleted file mode 100755 index ea9efbd..0000000 Binary files a/firmware/main.bin and /dev/null differ diff --git a/firmware/main.c b/firmware/main.c index ae32cf7..4ee519c 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -84,44 +84,30 @@ static uchar didWriteSomething = 0; // becomes 1 when some programming happened //static uchar eraseRequested = 0; //#endif //static uchar appWriteComplete = 0; -static uint16_t writeSize; +//static uint16_t writeSize; static uint16_t vectorTemp[2]; -//static uchar needToErase = 0; -//#endif +static longConverter_t currentAddress; /* in bytes */ -// #ifdef APPCHECKSUM -// static uchar connectedToPc = 0; -// static uint16_t checksum = 0; -// #endif -//static uchar requestBootLoaderExit; -static longConverter_t currentAddress; /* in bytes */ -static uchar bytesRemaining; -static uchar isLastPage; +PROGMEM char usbHidReportDescriptor[33] = { + 0x06, 0x00, 0xff, // USAGE_PAGE (Generic Desktop) + 0x09, 0x01, // USAGE (Vendor Usage 1) + 0xa1, 0x01, // COLLECTION (Application) + 0x15, 0x00, // LOGICAL_MINIMUM (0) + 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) + 0x75, 0x08, // REPORT_SIZE (8) -//#if HAVE_EEPROM_PAGED_ACCESS -//static uchar currentRequest; -//#else -static const uchar currentRequest = 0; -//#endif + 0x85, 0x01, // REPORT_ID (1) + 0x95, 0x06, // REPORT_COUNT (6) + 0x09, 0x00, // USAGE (Undefined) + 0xb2, 0x02, 0x01, // FEATURE (Data,Var,Abs,Buf) -// static const uchar signatureBytes[4] = { -// #ifdef SIGNATURE_BYTES -// SIGNATURE_BYTES -// #elif defined (__AVR_ATmega8__) || defined (__AVR_ATmega8HVA__) -// 0x1e, 0x93, 0x07, 0 -// #elif defined (__AVR_ATmega48__) || defined (__AVR_ATmega48P__) -// 0x1e, 0x92, 0x05, 0 -// #elif defined (__AVR_ATmega88__) || defined (__AVR_ATmega88P__) -// 0x1e, 0x93, 0x0a, 0 -// #elif defined (__AVR_ATmega168__) || defined (__AVR_ATmega168P__) -// 0x1e, 0x94, 0x06, 0 -// #elif defined (__AVR_ATmega328P__) -// 0x1e, 0x95, 0x0f, 0 -// #else -// # error "Device signature is not known, please edit main.c!" -// #endif -// }; + 0x85, 0x02, // REPORT_ID (2) + 0x95, 0x83, // REPORT_COUNT (131) + 0x09, 0x00, // USAGE (Undefined) + 0xb2, 0x02, 0x01, // FEATURE (Data,Var,Abs,Buf) + 0xc0 // END_COLLECTION +}; /* ------------------------------------------------------------------------ */ @@ -225,7 +211,7 @@ static inline __attribute__((noreturn)) void leaveBootloader(void) { // make sure remainder of flash is erased and write checksum and application reset vectors if (didWriteSomething) { //if(appWriteComplete) { - while(currentAddress < BOOTLOADER_ADDRESS) { + while (currentAddress < BOOTLOADER_ADDRESS) { fillFlashWithVectors(); } } @@ -475,8 +461,7 @@ uchar usbFunctionWrite(uchar *data, uchar length) { void PushMagicWord (void) __attribute__ ((naked)) __attribute__ ((section (".init3"))); // put the word "B007" at the bottom of the stack (RAMEND - RAMEND-1) -void PushMagicWord (void) -{ +void PushMagicWord (void) { asm volatile("ldi r16, 0xB0"::); asm volatile("push r16"::); asm volatile("ldi r16, 0x07"::); @@ -503,12 +488,6 @@ static inline void tiny85FlashWrites(void) { } else { writeFlashPage(); } - - // if (isLastPage) { - // // store number of bytes written so rest of flash can be filled later - // writeSize = currentAddress; - // appWriteComplete = 1; - // } } int __attribute__((noreturn)) main(void) { @@ -536,13 +515,14 @@ int __attribute__((noreturn)) main(void) { if (isEvent(EVENT_PAGE_NEEDS_ERASE)) eraseFlashPage(); if (isEvent(EVENT_WRITE_PAGE)) tiny85FlashWrites(); -#if BOOTLOADER_CAN_EXIT - // exit if requested by the programming app, or if we timeout waiting for the pc with a valid app - if (isEvent(EVENT_EXIT_BOOTLOADER) || AUTO_EXIT_CONDITION()) { - _delay_ms(10); - break; - } -#endif +# if BOOTLOADER_CAN_EXIT + // exit if requested by the programming app, or if we timeout waiting for the pc with a valid app + if (isEvent(EVENT_EXIT_BOOTLOADER) || AUTO_EXIT_CONDITION()) { + _delay_ms(10); + break; + } +# endif + clearEvents(); } while(bootLoaderCondition()); /* main event loop */ diff --git a/firmware/main.hex b/firmware/main.hex deleted file mode 100644 index f74f40f..0000000 --- a/firmware/main.hex +++ /dev/null @@ -1,175 +0,0 @@ -:1015000037C051C07DC04FC04EC04DC04CC04BC055 -:101510004AC049C048C047C046C045C044C0040393 -:1015200009041C037700770077002E00660069002D -:101530007300630068006C002E00640065000E03F9 -:101540005500530042006100730070001201100149 -:10155000FF000008C016DC050201010200010902BB -:1015600012000101008032090400000000000000A8 -:1015700011241FBECFE5D2E0DEBFCDBF10E0A0E654 -:10158000B0E0E0ECFFE102C005900D92A636B10795 -:10159000D9F710E0A6E6B0E001C01D92A73AB10766 -:1015A000E1F73AD20BC5ACCFA82FB92F80E090E07D -:1015B00041E050EA609530E009C02D91822797956F -:1015C000879510F084279527305EC8F36F5FA8F3E6 -:1015D0000895EADF8D939D930895A6E088279927C3 -:1015E000AA9569F00197E1F3B399FCCFB39BFECFC5 -:1015F00081E09927A6B3019611F0A871D9F7089553 -:10160000CF93CFB7CF93C0915F02C03B21F4C0917D -:101610005E02C73021F0CF91CFBFCF9170CFCC27E2 -:10162000C395B39BE9F7B39B0BC0B39B09C0B39BB6 -:1016300007C0B39B05C0B39B03C0B39B01C0D3C01D -:101640000F92DF93C0918A00DD27CF56DF4F012E26 -:10165000B39B03C0DF910F90E6CF2F930F931F939F -:101660004F932FEF4F6F06B303FB20F95F933F9328 -:1016700050E03BE065C016B30126502953FDC895E4 -:1016800056B3012703FB25F92F7306B3B1F050279A -:10169000102713FB26F906B22230F0F000C016B373 -:1016A000012703FB27F90126502906B22430E8F56B -:1016B0004F77206816B30000F6CF50274F7D206289 -:1016C00006B2102F000000C006B3002650291027D4 -:1016D00013FB26F906B2E2CF4F7B06B3206400C0AD -:1016E000DACF01265029187106B269F14E7F2160C8 -:1016F000012F16B328C0002650294D7F06B2226064 -:10170000102F29C0012650294B7F06B22460012FDB -:101710002DC016B301265029477F2860000006B26D -:101720002EC04F7E06B3206130C0422706B34993D6 -:1017300000265029102706B24FEF13FB20F9297F0E -:1017400016B379F2187159F10126502906B2012712 -:1017500003FB21F9237F06B371F200265029315093 -:10176000D0F006B2102713FB22F9277E16B351F2F0 -:1017700001265029012703FB06B223F92F7C49F2E9 -:10178000000006B3102713FB24F90026502906B2E7 -:101790002F7939F270CF10E21ABF002717C03B50E3 -:1017A0003195C31BD04010E21ABF0881033CF9F009 -:1017B0000B34E9F0209188001981110F1213EDCF3D -:1017C000093651F10D3211F0013E39F700938F00C7 -:1017D0003F915F914F911F910F912F91DF910F904A -:1017E000CAB7C5FD1DCFCF91CFBFCF91189520911E -:1017F0008F00222369F310918D00112321F53430DD -:1018000022F130938D002093890010918A003BE0F3 -:10181000311B30938A0019C000918D0001309CF477 -:101820000AE53091600034FD11C000936000CDE7FF -:10183000D0E010C0052710E000C021C0052710E04F -:10184000C89508BB14C03AE501C032ED032EC0E0D4 -:10185000D0E032E017B31861C39A08B317BB58E160 -:1018600020E84FEF20FF052708BB279517951C3F61 -:1018700028F700004552B0F720FF0527279508BB41 -:1018800017951C3FB8F629913A9561F7077E10919C -:101890008E00110F08BBC250D04011F01093880089 -:1018A00010E21ABF086017B3177E402F477E54E03E -:1018B0005A95F1F708BB17BB48BB8ACF80917000DF -:1018C000882361F0E0916800F0916900329783E02D -:1018D00080935700E89507B600FCFDCFE0916800C3 -:1018E000F0916900329785E080935700E89507B63C -:1018F00000FCFDCF10927000089520916800309197 -:1019000069002115310521F124303105A1F044E1B0 -:101910002A3F340729F480916A00819590E01AC02B -:1019200044E12C3F340749F480916C0090916D00A4 -:101930008E579A4F0FC08FE79AEC44E12E3F340741 -:1019400049F480916E0090916F008D579A4F02C0BC -:101950008FE79AEC682F70E0690F711D40916A0063 -:1019600050916B00460F571F50936B0040936A00D5 -:101970002115310521F421E120935700E895F894D1 -:1019800061E0E0916800F09169000C0160935700FC -:10199000E895112478942091680030916900F9014C -:1019A000459154914817590731F08FEF4F3F580731 -:1019B00011F0609370002E5F3F4F309369002093C9 -:1019C00068000895CF93DF93C0916800D0916900BB -:1019D000CF73D0708FEF9FEF90DF2296C034D10588 -:1019E000CCF36CDFDF91CF91089580E0E0E0F0E090 -:1019F0009491890F319694E1EB3FF907C9F721E003 -:101A000030E0882311F020E030E0C901089500EBB8 -:101A10000F9307E00F930895DF93CF9300D00F92B9 -:101A2000CDB7DEB788E10FB6F89481BD11BC0FBE0B -:101A3000E0E0F0E0859194913AEC8F37930741F420 -:101A4000E4E0F0E0859194914AEC8F37940719F027 -:101A50002B83B8DF2B8110926900109268001092DE -:101A60006B0010926A002B83C0DF6C01AC9A8BB7BD -:101A700080628BBFBB9A8FE49DE2A9E181509040C8 -:101A8000A040E1F700C00000BB98789400E010E0AF -:101A90002B8180918D00835087FD39C190918A0000 -:101AA0003CE0E32EF12CE91AF108A1E9B0E0EA0EDE -:101AB000FB1E909189009D3209F0CCC0883009F05E -:101AC00024C1470183EC80937D008AE58093600008 -:101AD00010927100F7014081842F80762181882344 -:101AE00009F442C031E03093670084E790E09093BE -:101AF0008C0080938B002330A1F4D70112968C9137 -:101B00001297803349F41496EC911497E370F0E047 -:101B1000EE59FF4F808101C080E08093770024E080 -:101B20008AC02530E9F0822F84508630A0F4F70176 -:101B3000828193819093690080936800293091F0AD -:101B4000268120937200858182708093730047FD07 -:101B50006EC02FEF6CC0223029F43093660002C0B3 -:101B600021E069C020E067C0D70112968C911297DE -:101B700010928600222331F41092870086E890E0CC -:101B800022E050C0253019F480938E0041C02630E9 -:101B9000B1F5F7019381913019F48CE495E104C01B -:101BA000923041F48EE595E190938C0080938B0008 -:101BB00022E121C09330F1F4882341F48EE195E1D4 -:101BC00090938C0080938B0024E015C0813041F409 -:101BD00082E295E190938C0080938B002CE10BC006 -:101BE000823041F48EE395E190938C0080938B00DA -:101BF0002EE001C020E080E4809371001CC02830FA -:101C000059F0293019F48093900002C02A3039F03D -:101C100086E890E020E006C080E990E002C086E817 -:101C200090E021E090938C0080938B0004C080E8CA -:101C3000809371000CC0D40117968C91179788235C -:101C400031F416968C911697821708F4282F20935A -:101C500061005BC09091710097FF57C09091720036 -:101C6000B82E981708F4B92E9B199093720041E092 -:101C7000911140E030E042C080916800909169008D -:101C8000009741F4F7018081918190936D008093DA -:101C90006C0015C08430910549F4D7018D919C9159 -:101CA000119790936F0080936E0009C0B4E18A3F52 -:101CB0009B0728F081E180935700E89522C03E5FA2 -:101CC000F701819191917F012B833A83498315DE3E -:101CD00080916800909169008F7390702B813A8198 -:101CE0004981009741F0442349F03B1538F0809139 -:101CF0007300882319F081E0809378003B1508F485 -:101D0000BBCF442311F01092610010928D0080919E -:101D1000600084FF8EC0809161008F3F09F489C00C -:101D2000382F893008F038E0831B80936100809160 -:101D30007D0098E8892780937D00332309F464C0EF -:101D40009091710097FF39C080917200831708F459 -:101D5000382F831B8093720070916C0060916D002E -:101D600050916E0040916F00E0916800F091690021 -:101D7000832F90E082589F4FAEE7B0E016C0E4900A -:101D8000EC92309711F47C930AC0E130F10511F424 -:101D90006C9309C0E430F10511F45C9304C0E530A4 -:101DA000F10509F44C9311963196A817B90739F744 -:101DB000F0936900E093680025C0E0918B00F091FA -:101DC0008C00832F815096FF0CC090E081589F4F6C -:101DD000AEE7B0E044914D933196A817B907D1F71B -:101DE0000DC0AF0190E081589F4FAEE7B0E0FA011F -:101DF0006191AF016D93A817B907C9F7F0938C00F3 -:101E0000E0938B00393078F48EE790E0632F2B83DA -:101E10003A83DFDB3A813C5F2B813C3041F08FEF2E -:101E20008093610004C08FEF809361003EE13093A6 -:101E3000600094E186B3887131F49150D9F7109223 -:101E40008E001092880081E0911180E090917900DD -:101E5000981759F0882339F4F8942B83898374D028 -:101E6000789489812B81809379008CE991E00197A6 -:101E7000F1F7000080917800882339F1A9E3B0E2FE -:101E80001197F1F700C00000F894809168009091DC -:101E900069008F739070009719F02B8393DD02C057 -:101EA0002B830CDD2B817894109278008091730045 -:101EB000882359F0809168009091690090937B008D -:101EC00080937A0081E080937C0080916600882373 -:101ED00081F40F5F1F4FC114D10409F4DACD809152 -:101EE0006700882309F0D5CDB3EC01351B0708F452 -:101EF000D0CDE1E2F1EA3197F1F700C00000F894AB -:101F00001BBE15BA80917C008823A1F080917A00D5 -:101F100090917B00909369008093680003C02B83AD -:101F200051DD2B818091680090916900F5E180304E -:101F30009F07A8F3C114D10409F4E2CA10925F020A -:101F400010925E02DBCA77CEFF920F931F93CF935E -:101F5000DF93C8E0D0E010E000E8F12EF00EF1BE13 -:101F60003CDB29E0843392070CF41F2D0695219762 -:101F7000A1F7212F215021BFEC01012F10C02DDB33 -:101F80008453994097FF03C0909581959F4F8C177C -:101F90009D0714F401B7EC0181B78F5F81BF21B7B2 -:101FA00030E0812F90E001968217930744F701BF3C -:101FB000DF91CF911F910F91FF900895F894FFCF7B -:061FC0005AFF1E930B0006 -:0400000300001500E4 -:00000001FF diff --git a/firmware/main.o b/firmware/main.o deleted file mode 100644 index 60cccae..0000000 Binary files a/firmware/main.o and /dev/null differ diff --git a/firmware/usbdrv/oddebug.c.lst b/firmware/usbdrv/oddebug.c.lst index 562e806..caf379d 100644 --- a/firmware/usbdrv/oddebug.c.lst +++ b/firmware/usbdrv/oddebug.c.lst @@ -1,4 +1,4 @@ -GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s page 1 +GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s page 1 1 .file "oddebug.c" @@ -8,16 +8,16 @@ GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s page 5 __CCP__ = 0x34 6 __tmp_reg__ = 0 7 __zero_reg__ = 1 - GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s page 2 + GAS LISTING /var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s page 2 DEFINED SYMBOLS *ABS*:00000000 oddebug.c -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s:2 *ABS*:0000003f __SREG__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s:3 *ABS*:0000003e __SP_H__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s:4 *ABS*:0000003d __SP_L__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s:5 *ABS*:00000034 __CCP__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s:6 *ABS*:00000000 __tmp_reg__ -/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//ccV2KA1m.s:7 *ABS*:00000001 __zero_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s:2 *ABS*:0000003f __SREG__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s:3 *ABS*:0000003e __SP_H__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s:4 *ABS*:0000003d __SP_L__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s:5 *ABS*:00000034 __CCP__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s:6 *ABS*:00000000 __tmp_reg__ +/var/folders/nd/dq8cd7_x03d_z3x899kwf__80000gn/T//cc7695Dg.s:7 *ABS*:00000001 __zero_reg__ NO UNDEFINED SYMBOLS -- cgit v1.2.3