From: root Date: Sun, 27 Oct 2013 17:00:10 +0000 (+0100) Subject: puuh, it still works, lets find the mistakes in the port handling X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=dd562149f427ff1cfa17cf8f6d7ba1ecf8357a1c;p=coral.git puuh, it still works, lets find the mistakes in the port handling --- diff --git a/firmware/Descriptors.o b/firmware/Descriptors.o index 129b593..c3235c8 100644 Binary files a/firmware/Descriptors.o and b/firmware/Descriptors.o differ diff --git a/firmware/USBtoSerial.c b/firmware/USBtoSerial.c index 9ed439f..ef5a460 100644 --- a/firmware/USBtoSerial.c +++ b/firmware/USBtoSerial.c @@ -401,7 +401,7 @@ uint32_t times_ten_pow(uint8_t exponent) { return val; } - +#define PHASE_DELAY_MS 10 uint8_t move_plate(int16_t dx, int16_t dy){ static int16_t todo_x,todo_y = 0; @@ -423,6 +423,7 @@ uint8_t move_plate(int16_t dx, int16_t dy){ } motor_step(Y,signum); todo_y -= signum; + _delay_ms(PHASE_DELAY_MS); return returnval; // busy @@ -665,8 +666,8 @@ int main(void) parse_command(); // read data from virtual comport touchpad_read(); // read data from touchpad - dx = delta_x();// returns the amount your finger has moved in x direction since last readout - dy = delta_y();// returns the amount your finger has moved in y direction since last readout + dx = -delta_x();// returns the amount your finger has moved in x direction since last readout + dy = -delta_y();// returns the amount your finger has moved in y direction since last readout // increment/decrement some dummy variables with the @@ -682,7 +683,6 @@ int main(void) pos_report(); } - _delay_ms(20); } // end of relative mode demo block diff --git a/firmware/USBtoSerial.c~ b/firmware/USBtoSerial.c~ index 077e024..f1820eb 100644 --- a/firmware/USBtoSerial.c~ +++ b/firmware/USBtoSerial.c~ @@ -42,6 +42,7 @@ #include "TM1001A.c" // #include "rfm70.c" #include "pins.h" +#include "leds.c" int16_t plate_pos_x = 0,plate_pos_y = 0; char stringbuffer[16]; @@ -401,7 +402,7 @@ uint32_t times_ten_pow(uint8_t exponent) { return val; } - +#define PHASE_DELAY_MS 10 uint8_t move_plate(int16_t dx, int16_t dy){ static int16_t todo_x,todo_y = 0; @@ -423,6 +424,7 @@ uint8_t move_plate(int16_t dx, int16_t dy){ } motor_step(Y,signum); todo_y -= signum; + _delay_ms(PHASE_DELAY_MS); return returnval; // busy @@ -623,6 +625,8 @@ int main(void) { init_motors(); +// init_leds(); + char dummy; uint8_t field_val = 0; @@ -655,6 +659,10 @@ int main(void) uint8_t busy = 0, last_busy = 0; while (1) { + +// set_led0(sw0_state()); +// set_led1(sw1_state()); +// set_led2(sw2_state()); Usb2SerialTask(); // loopcounter++; @@ -665,8 +673,8 @@ int main(void) parse_command(); // read data from virtual comport touchpad_read(); // read data from touchpad - dx = delta_x();// returns the amount your finger has moved in x direction since last readout - dy = delta_y();// returns the amount your finger has moved in y direction since last readout + dx = -delta_x();// returns the amount your finger has moved in x direction since last readout + dy = -delta_y();// returns the amount your finger has moved in y direction since last readout // increment/decrement some dummy variables with the @@ -682,7 +690,6 @@ int main(void) pos_report(); } - _delay_ms(10); } // end of relative mode demo block diff --git a/firmware/USBtoSerial.elf b/firmware/USBtoSerial.elf index f34a9e7..8a2b459 100755 Binary files a/firmware/USBtoSerial.elf and b/firmware/USBtoSerial.elf differ diff --git a/firmware/USBtoSerial.hex b/firmware/USBtoSerial.hex index c277ec8..8e1e12c 100644 --- a/firmware/USBtoSerial.hex +++ b/firmware/USBtoSerial.hex @@ -20,7 +20,7 @@ :1001300065007200000011241FBECFEFD4E0DEBFC7 :10014000CDBF11E0A0E0B1E0E8EFFEE102C0059014 :100150000D92AE34B107D9F712E0AEE4B1E001C0C0 -:100160001D92A43DB107E1F767D60C947A0F48CFF2 +:100160001D92A43DB107E1F76DD60C947A0F48CFEC :10017000FC01A081B1816C93808191810196918372 :100180008083268137818217930721F484819581AA :10019000918380832FB7F894828593850196938706 @@ -163,80 +163,80 @@ :100A2000A5022093A4028091A2029091A3024BDF21 :100A3000082F81111F5F81E0602F95DF602F7727DE :100A400067FD70952091A2023091A302261B370BFF -:100A50003093A3022093A202812F1F910F9108953A -:100A60000F931F938C0168E170E00E940F0F88279D -:100A700077FD8095982F43E046DF8EE2A3DEC80124 -:100A800017FF03C0909581959F4F68E170E00E9429 -:100A90000F0F61EA71E00E94E90E6AE070E00E94C7 -:100AA0000F0F882777FD8095982F43E018DF1F915F -:100AB0000F91089580E091E08DDE80914E0190913C -:100AC0004F01CEDF88E091E085DE8091500190916A -:100AD0005101C6DF82E191E07DCECF92DF92EF92AD -:100AE000FF920F931F93CF93DF932FB7F8948091CA -:100AF0005C0190915D012FBF009709F494C182E5DC -:100B000091E051DB182F8D3019F08A3009F074C153 -:100B100084E191E05FDE80916D02E82FF0E0EE5716 -:100B2000FD4F108280936C0210926D0280918202C0 -:100B3000873659F0873449F08D3649F08D3439F0D5 -:100B40008A3739F08A3539F404C001E005C002E083 -:100B500003C003E001C000E080918302883739F0D0 -:100B6000883529F0893729F011E0893519F010E02E -:100B700001C011E0802F8150823008F06DC01092CA -:100B800071021092700210926F0210926E02109217 -:100B90006B0210926A0292E0F92EDD24D39480E376 -:100BA000C82E54C0E0906B02EE2049F4EF2DF0E027 -:100BB000EE57FD4F80818D3211F4DD24DA94CF2D74 -:100BC000D0E0FE01EE57FD4F808180538A3028F43B -:100BD000EE20D9F5F0926B0238C0EE20B1F16E2D07 -:100BE00070E0C61BD70B6E577D4F82E792E0AE01D7 -:100BF0000E94610FCE58DD4F188280916A028F5F8C -:100C000080936A02813049F482E792E00E94440FA7 -:100C1000909371028093700216C08F2D8E198330CD -:100C200040F4E82FF0E0EE58FD4FC0828F5F833034 -:100C3000C1F71092750282E792E00E94440F9093F0 -:100C40006F0280936E0210926B02F39480916C029B -:100C50008F1508F0A7CF02C0DD24D394023009F429 -:100C600061C0033009F4BEC0013009F0C3C087E1A0 -:100C700091E0B0DD812F885AA5DD80E2A3DDCD2D86 -:100C8000DD27C7FDD0956091700270917102CE0191 -:100C90000E94E90EBC0180E090E043E034DE8EE289 -:100CA00091DD60916E0270916F0280E090E043E010 -:100CB00016DE84E191E08EDD80916E0290916F02EC -:100CC0006AE070E00E94E90E60EA71E00E94FB0EAB -:100CD0009B01809170029091710268E170E00E9426 -:100CE000E90E280F391FCE01B9010E94E90E112328 -:100CF00069F420914E0130914F01E82EE7017E0109 -:100D0000F92EE701C21BD30BCE014FC02091500139 -:100D100030915101E82EE7017E01F92EE701C21B57 -:100D2000D30B51C08DE191E055DD812F885A4ADD0A -:100D300080E248DDCD2DDD27C7FDD09560917002A2 -:100D400070917102CE010E94E90EBC0180E090E03A -:100D500043E0D9DD8EE236DD60916E0270916F0264 -:100D600080E090E043E0BBDD84E191E033DD809101 -:100D70006E0290916F026AE070E00E94E90E60EAF4 -:100D800071E00E94FB0E9B018091700290917102B4 -:100D900068E170E00E94E90E280F391FCE01B90109 -:100DA0000E94E90EEC01112371F460E070E00DDEA9 -:100DB00080914E0190914F018C0F9D1F90934F0198 -:100DC00080934E0117C080E090E0BE01FEDD80916F -:100DD0005001909151018C0F9D1F90935101809370 -:100DE000500108C010924F0110924E011092510113 -:100DF000109250015FDE17C080916D02882319F4B4 -:100E000083E291E0E7DC80916D02183011F48150AB -:100E100006C0E82FF0E0EE57FD4F10838F5F809300 -:100E20006D02812FCFDCDF91CF911F910F91FF9049 -:100E3000EF90DF90CF9008950F931F93DF93CF93A0 -:100E40000F92CDB7DEB782DD0EDC82E591E06EE574 -:100E500071E037DA8EED91E06AEE71E032DA789483 -:100E600072DB2FEF39E648E1215030404040E1F796 -:100E700000C00000789478DB10E0AADB2EDE6BDB8C -:100E800097DB082F85DB402F552747FD5095209194 -:100E90004E0130914F01240F351F30934F012093A5 -:100EA0004E01682F772767FD7095809150019091D2 -:100EB0005101860F971F9093510180935001CA01F1 -:100EC00084DD112329F0882319F48983F3DD8981D6 -:100ED0002FEF39EF40E0215030404040E1F700C0B3 -:100EE0000000182FCACF923029F0933041F0913092 +:100A50003093A3022093A2028FE39CE90197F1F760 +:100A600000C00000812F1F910F9108950F931F93D5 +:100A70008C0168E170E00E940F0F882777FD809558 +:100A8000982F43E040DF8EE29DDEC80117FF03C0D0 +:100A9000909581959F4F68E170E00E940F0F61EA89 +:100AA00071E00E94E90E6AE070E00E940F0F882753 +:100AB00077FD8095982F43E012DF1F910F910895E5 +:100AC00080E091E087DE80914E0190914F01CEDF72 +:100AD00088E091E07FDE8091500190915101C6DF66 +:100AE00082E191E077CECF92DF92EF92FF920F9367 +:100AF0001F93CF93DF932FB7F89480915C0190916F +:100B00005D012FBF009709F494C182E591E04BDBB2 +:100B1000182F8D3019F08A3009F074C184E191E00A +:100B200059DE80916D02E82FF0E0EE57FD4F108204 +:100B300080936C0210926D0280918202873659F088 +:100B4000873449F08D3649F08D3439F08A3739F0E1 +:100B50008A3539F404C001E005C002E003C003E0B7 +:100B600001C000E080918302883739F0883529F090 +:100B7000893729F011E0893519F010E001C011E042 +:100B8000802F8150823008F06DC010927102109257 +:100B9000700210926F0210926E0210926B0210920D +:100BA0006A0292E0F92EDD24D39480E3C82E54C06B +:100BB000E0906B02EE2049F4EF2DF0E0EE57FD4F90 +:100BC00080818D3211F4DD24DA94CF2DD0E0FE0146 +:100BD000EE57FD4F808180538A3028F4EE20D9F5FE +:100BE000F0926B0238C0EE20B1F16E2D70E0C61BA2 +:100BF000D70B6E577D4F82E792E0AE010E94610FE6 +:100C0000CE58DD4F188280916A028F5F80936A020E +:100C1000813049F482E792E00E94440F9093710280 +:100C20008093700216C08F2D8E19833040F4E82F08 +:100C3000F0E0EE58FD4FC0828F5F8330C1F7109215 +:100C4000750282E792E00E94440F90936F028093B6 +:100C50006E0210926B02F39480916C028F1508F073 +:100C6000A7CF02C0DD24D394023009F461C0033061 +:100C700009F4BEC0013009F0C3C087E191E0AADDEC +:100C8000812F885A9FDD80E29DDDCD2DDD27C7FDB8 +:100C9000D0956091700270917102CE010E94E90EB0 +:100CA000BC0180E090E043E02EDE8EE28BDD6091BF +:100CB0006E0270916F0280E090E043E010DE84E10C +:100CC00091E088DD80916E0290916F026AE070E0A1 +:100CD0000E94E90E60EA71E00E94FB0E9B01809188 +:100CE00070029091710268E170E00E94E90E280F95 +:100CF000391FCE01B9010E94E90E112369F4209138 +:100D00004E0130914F01E82EE7017E01F92EE701F7 +:100D1000C21BD30BCE014FC0209150013091510125 +:100D2000E82EE7017E01F92EE701C21BD30B51C06B +:100D30008DE191E04FDD812F885A44DD80E242DD74 +:100D4000CD2DDD27C7FDD0956091700270917102A5 +:100D5000CE010E94E90EBC0180E090E043E0D3DDCB +:100D60008EE230DD60916E0270916F0280E090E063 +:100D700043E0B5DD84E191E02DDD80916E0290913C +:100D80006F026AE070E00E94E90E60EA71E00E9482 +:100D9000FB0E9B01809170029091710268E170E0FE +:100DA0000E94E90E280F391FCE01B9010E94E90EF9 +:100DB000EC01112371F460E070E007DE80914E01D8 +:100DC00090914F018C0F9D1F90934F0180934E0186 +:100DD00017C080E090E0BE01F8DD80915001909155 +:100DE00051018C0F9D1F909351018093500108C0B9 +:100DF00010924F0110924E01109251011092500129 +:100E00005FDE17C080916D02882319F483E291E0C0 +:100E1000E1DC80916D02183011F4815006C0E82F9A +:100E2000F0E0EE57FD4F10838F5F80936D02812FAE +:100E3000C9DCDF91CF911F910F91FF90EF90DF9070 +:100E4000CF9008950F931F93DF93CF930F92CDB759 +:100E5000DEB77CDD08DC82E591E06EE571E031DA39 +:100E60008EED91E06AEE71E02CDA78946CDB8FEF16 +:100E700099E6A8E181509040A040E1F700C0000051 +:100E8000789472DB10E001C0182FA2DB2CDE63DB4C +:100E90008FDB082F7DDB0195402F552747FD5095AF +:100EA00020914E0130914F01240F351F30934F0197 +:100EB00020934E018195682F772767FD709580916B +:100EC000500190915101860F971F9093510180938B +:100ED0005001CA017ADD1123B9F28823A9F689836A +:100EE000EFDD8981D1CF923029F0933041F09130FC :100EF000E9F417C02EE330E0EAEAF0E01BC08130ED :100F000041F0813018F0823089F406C0E8EEF0E05C :100F100005C0ECEEF0E002C0E6E0F1E0249130E044 diff --git a/firmware/USBtoSerial.lss b/firmware/USBtoSerial.lss index d1847ab..02e4d77 100644 --- a/firmware/USBtoSerial.lss +++ b/firmware/USBtoSerial.lss @@ -17,21 +17,21 @@ Idx Name Size VMA LMA File off Algn CONTENTS, READONLY, DEBUGGING 6 .debug_pubnames 00000f39 00000000 00000000 00004fad 2**0 CONTENTS, READONLY, DEBUGGING - 7 .debug_info 000092a5 00000000 00000000 00005ee6 2**0 + 7 .debug_info 000092a1 00000000 00000000 00005ee6 2**0 CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 0000220b 00000000 00000000 0000f18b 2**0 + 8 .debug_abbrev 0000220b 00000000 00000000 0000f187 2**0 CONTENTS, READONLY, DEBUGGING - 9 .debug_line 00007bdc 00000000 00000000 00011396 2**0 + 9 .debug_line 00007bee 00000000 00000000 00011392 2**0 CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 00000900 00000000 00000000 00018f74 2**2 + 10 .debug_frame 00000900 00000000 00000000 00018f80 2**2 CONTENTS, READONLY, DEBUGGING - 11 .debug_str 00003d96 00000000 00000000 00019874 2**0 + 11 .debug_str 00003d74 00000000 00000000 00019880 2**0 CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 00004b07 00000000 00000000 0001d60a 2**0 + 12 .debug_loc 00004b3c 00000000 00000000 0001d5f4 2**0 CONTENTS, READONLY, DEBUGGING - 13 .debug_pubtypes 00001111 00000000 00000000 00022111 2**0 + 13 .debug_pubtypes 00001111 00000000 00000000 00022130 2**0 CONTENTS, READONLY, DEBUGGING - 14 .debug_ranges 00000828 00000000 00000000 00023222 2**0 + 14 .debug_ranges 00000828 00000000 00000000 00023241 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: @@ -180,7 +180,7 @@ Disassembly of section .text: 162: a4 3d cpi r26, 0xD4 ; 212 164: b1 07 cpc r27, r17 166: e1 f7 brne .-8 ; 0x160 <.do_clear_bss_loop> - 168: 67 d6 rcall .+3278 ; 0xe38
+ 168: 6d d6 rcall .+3290 ; 0xe44
16a: 0c 94 7a 0f jmp 0x1ef4 ; 0x1ef4 <_exit> 0000016e <__bad_interrupt>: @@ -2015,7 +2015,7 @@ uint8_t motor_step(uint8_t motor, int8_t direction) { // motor: M1 or M2, direct return val; } - +#define PHASE_DELAY_MS 10 uint8_t move_plate(int16_t dx, int16_t dy){ 9ca: 0f 93 push r16 @@ -2042,7 +2042,7 @@ uint8_t move_plate(int16_t dx, int16_t dy){ 9f6: c9 01 movw r24, r18 9f8: 66 df rcall .-308 ; 0x8c6 9fa: 08 2f mov r16, r24 - +#define PHASE_DELAY_MS 10 uint8_t move_plate(int16_t dx, int16_t dy){ static int16_t todo_x,todo_y = 0; @@ -2098,852 +2098,872 @@ uint8_t move_plate(int16_t dx, int16_t dy){ a4e: 37 0b sbc r19, r23 a50: 30 93 a3 02 sts 0x02A3, r19 a54: 20 93 a2 02 sts 0x02A2, r18 + a58: 8f e3 ldi r24, 0x3F ; 63 + a5a: 9c e9 ldi r25, 0x9C ; 156 + a5c: 01 97 sbiw r24, 0x01 ; 1 + a5e: f1 f7 brne .-4 ; 0xa5c + a60: 00 c0 rjmp .+0 ; 0xa62 + a62: 00 00 nop + _delay_ms(PHASE_DELAY_MS); return returnval; // busy } - a58: 81 2f mov r24, r17 - a5a: 1f 91 pop r17 - a5c: 0f 91 pop r16 - a5e: 08 95 ret + a64: 81 2f mov r24, r17 + a66: 1f 91 pop r17 + a68: 0f 91 pop r16 + a6a: 08 95 ret -00000a60 : +00000a6c : void print_steps_in_mm(int16_t steps) { - a60: 0f 93 push r16 - a62: 1f 93 push r17 - a64: 8c 01 movw r16, r24 + a6c: 0f 93 push r16 + a6e: 1f 93 push r17 + a70: 8c 01 movw r16, r24 int16_t predot,postdot; predot = steps/24; - a66: 68 e1 ldi r22, 0x18 ; 24 - a68: 70 e0 ldi r23, 0x00 ; 0 - a6a: 0e 94 0f 0f call 0x1e1e ; 0x1e1e <__divmodhi4> + a72: 68 e1 ldi r22, 0x18 ; 24 + a74: 70 e0 ldi r23, 0x00 ; 0 + a76: 0e 94 0f 0f call 0x1e1e ; 0x1e1e <__divmodhi4> postdot = ((abs(steps)%24)*417)/10; uart_print_signed_number(predot,3); - a6e: 88 27 eor r24, r24 - a70: 77 fd sbrc r23, 7 - a72: 80 95 com r24 - a74: 98 2f mov r25, r24 - a76: 43 e0 ldi r20, 0x03 ; 3 - a78: 46 df rcall .-372 ; 0x906 + a7a: 88 27 eor r24, r24 + a7c: 77 fd sbrc r23, 7 + a7e: 80 95 com r24 + a80: 98 2f mov r25, r24 + a82: 43 e0 ldi r20, 0x03 ; 3 + a84: 40 df rcall .-384 ; 0x906 uart_putc('.'); - a7a: 8e e2 ldi r24, 0x2E ; 46 - a7c: a3 de rcall .-698 ; 0x7c4 + a86: 8e e2 ldi r24, 0x2E ; 46 + a88: 9d de rcall .-710 ; 0x7c4 void print_steps_in_mm(int16_t steps) { int16_t predot,postdot; predot = steps/24; postdot = ((abs(steps)%24)*417)/10; - a7e: c8 01 movw r24, r16 - a80: 17 ff sbrs r17, 7 - a82: 03 c0 rjmp .+6 ; 0xa8a - a84: 90 95 com r25 - a86: 81 95 neg r24 - a88: 9f 4f sbci r25, 0xFF ; 255 - a8a: 68 e1 ldi r22, 0x18 ; 24 - a8c: 70 e0 ldi r23, 0x00 ; 0 - a8e: 0e 94 0f 0f call 0x1e1e ; 0x1e1e <__divmodhi4> - a92: 61 ea ldi r22, 0xA1 ; 161 - a94: 71 e0 ldi r23, 0x01 ; 1 - a96: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - a9a: 6a e0 ldi r22, 0x0A ; 10 - a9c: 70 e0 ldi r23, 0x00 ; 0 - a9e: 0e 94 0f 0f call 0x1e1e ; 0x1e1e <__divmodhi4> + a8a: c8 01 movw r24, r16 + a8c: 17 ff sbrs r17, 7 + a8e: 03 c0 rjmp .+6 ; 0xa96 + a90: 90 95 com r25 + a92: 81 95 neg r24 + a94: 9f 4f sbci r25, 0xFF ; 255 + a96: 68 e1 ldi r22, 0x18 ; 24 + a98: 70 e0 ldi r23, 0x00 ; 0 + a9a: 0e 94 0f 0f call 0x1e1e ; 0x1e1e <__divmodhi4> + a9e: 61 ea ldi r22, 0xA1 ; 161 + aa0: 71 e0 ldi r23, 0x01 ; 1 + aa2: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + aa6: 6a e0 ldi r22, 0x0A ; 10 + aa8: 70 e0 ldi r23, 0x00 ; 0 + aaa: 0e 94 0f 0f call 0x1e1e ; 0x1e1e <__divmodhi4> uart_print_signed_number(predot,3); uart_putc('.'); uart_print_number_wlzeros(postdot,3); - aa2: 88 27 eor r24, r24 - aa4: 77 fd sbrc r23, 7 - aa6: 80 95 com r24 - aa8: 98 2f mov r25, r24 - aaa: 43 e0 ldi r20, 0x03 ; 3 - aac: 18 df rcall .-464 ; 0x8de + aae: 88 27 eor r24, r24 + ab0: 77 fd sbrc r23, 7 + ab2: 80 95 com r24 + ab4: 98 2f mov r25, r24 + ab6: 43 e0 ldi r20, 0x03 ; 3 + ab8: 12 df rcall .-476 ; 0x8de } - aae: 1f 91 pop r17 - ab0: 0f 91 pop r16 - ab2: 08 95 ret + aba: 1f 91 pop r17 + abc: 0f 91 pop r16 + abe: 08 95 ret -00000ab4 : +00000ac0 : void pos_report(void){ uart_puts("x_pos: "); - ab4: 80 e0 ldi r24, 0x00 ; 0 - ab6: 91 e0 ldi r25, 0x01 ; 1 - ab8: 8d de rcall .-742 ; 0x7d4 + ac0: 80 e0 ldi r24, 0x00 ; 0 + ac2: 91 e0 ldi r25, 0x01 ; 1 + ac4: 87 de rcall .-754 ; 0x7d4 // uart_print_signed_number(plate_pos_x,6); print_steps_in_mm(plate_pos_x); - aba: 80 91 4e 01 lds r24, 0x014E - abe: 90 91 4f 01 lds r25, 0x014F - ac2: ce df rcall .-100 ; 0xa60 + ac6: 80 91 4e 01 lds r24, 0x014E + aca: 90 91 4f 01 lds r25, 0x014F + ace: ce df rcall .-100 ; 0xa6c // my_uitoa(plate_pos_x, stringbuffer, 6); // uart_puts(stringbuffer); uart_puts(" y_pos: "); - ac4: 88 e0 ldi r24, 0x08 ; 8 - ac6: 91 e0 ldi r25, 0x01 ; 1 - ac8: 85 de rcall .-758 ; 0x7d4 + ad0: 88 e0 ldi r24, 0x08 ; 8 + ad2: 91 e0 ldi r25, 0x01 ; 1 + ad4: 7f de rcall .-770 ; 0x7d4 // uart_print_signed_number(plate_pos_y,6); print_steps_in_mm(plate_pos_y); - aca: 80 91 50 01 lds r24, 0x0150 - ace: 90 91 51 01 lds r25, 0x0151 - ad2: c6 df rcall .-116 ; 0xa60 + ad6: 80 91 50 01 lds r24, 0x0150 + ada: 90 91 51 01 lds r25, 0x0151 + ade: c6 df rcall .-116 ; 0xa6c uart_puts("\r"); - ad4: 82 e1 ldi r24, 0x12 ; 18 - ad6: 91 e0 ldi r25, 0x01 ; 1 + ae0: 82 e1 ldi r24, 0x12 ; 18 + ae2: 91 e0 ldi r25, 0x01 ; 1 } - ad8: 7d ce rjmp .-774 ; 0x7d4 + ae4: 77 ce rjmp .-786 ; 0x7d4 -00000ada : +00000ae6 : #define POSITION 0 #define GOTO 1 #define MOVEREL 2 #define SETZERO 3 void parse_command(void){ - ada: cf 92 push r12 - adc: df 92 push r13 - ade: ef 92 push r14 - ae0: ff 92 push r15 - ae2: 0f 93 push r16 - ae4: 1f 93 push r17 - ae6: cf 93 push r28 - ae8: df 93 push r29 + ae6: cf 92 push r12 + ae8: df 92 push r13 + aea: ef 92 push r14 + aec: ff 92 push r15 + aee: 0f 93 push r16 + af0: 1f 93 push r17 + af2: cf 93 push r28 + af4: df 93 push r29 static inline uint_reg_t GetGlobalInterruptMask(void) { GCC_MEMORY_BARRIER(); #if (ARCH == ARCH_AVR8) return SREG; - aea: 2f b7 in r18, 0x3f ; 63 + af6: 2f b7 in r18, 0x3f ; 63 static inline void GlobalInterruptDisable(void) { GCC_MEMORY_BARRIER(); #if (ARCH == ARCH_AVR8) cli(); - aec: f8 94 cli + af8: f8 94 cli uint16_t Count; uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); GlobalInterruptDisable(); Count = Buffer->Count; - aee: 80 91 5c 01 lds r24, 0x015C - af2: 90 91 5d 01 lds r25, 0x015D + afa: 80 91 5c 01 lds r24, 0x015C + afe: 90 91 5d 01 lds r25, 0x015D static inline void SetGlobalInterruptMask(const uint_reg_t GlobalIntState) { GCC_MEMORY_BARRIER(); #if (ARCH == ARCH_AVR8) SREG = GlobalIntState; - af6: 2f bf out 0x3f, r18 ; 63 + b02: 2f bf out 0x3f, r18 ; 63 uint8_t action=0,axis=0; int8_t num_sign = 1; char byte; /* Load the next byte from the USART transmit buffer into the USART */ if (!(RingBuffer_IsEmpty(&USBtoUSART_Buffer))) { - af8: 00 97 sbiw r24, 0x00 ; 0 - afa: 09 f4 brne .+2 ; 0xafe - afc: 94 c1 rjmp .+808 ; 0xe26 + b04: 00 97 sbiw r24, 0x00 ; 0 + b06: 09 f4 brne .+2 ; 0xb0a + b08: 94 c1 rjmp .+808 ; 0xe32 byte = RingBuffer_Remove(&USBtoUSART_Buffer); - afe: 82 e5 ldi r24, 0x52 ; 82 - b00: 91 e0 ldi r25, 0x01 ; 1 - b02: 51 db rcall .-2398 ; 0x1a6 - b04: 18 2f mov r17, r24 + b0a: 82 e5 ldi r24, 0x52 ; 82 + b0c: 91 e0 ldi r25, 0x01 ; 1 + b0e: 4b db rcall .-2410 ; 0x1a6 + b10: 18 2f mov r17, r24 if (byte == '\r' || byte == '\n') {// end of command, evaluate cemmand! - b06: 8d 30 cpi r24, 0x0D ; 13 - b08: 19 f0 breq .+6 ; 0xb10 - b0a: 8a 30 cpi r24, 0x0A ; 10 - b0c: 09 f0 breq .+2 ; 0xb10 - b0e: 74 c1 rjmp .+744 ; 0xdf8 + b12: 8d 30 cpi r24, 0x0D ; 13 + b14: 19 f0 breq .+6 ; 0xb1c + b16: 8a 30 cpi r24, 0x0A ; 10 + b18: 09 f0 breq .+2 ; 0xb1c + b1a: 74 c1 rjmp .+744 ; 0xe04 uart_puts("\r\n"); - b10: 84 e1 ldi r24, 0x14 ; 20 - b12: 91 e0 ldi r25, 0x01 ; 1 - b14: 5f de rcall .-834 ; 0x7d4 + b1c: 84 e1 ldi r24, 0x14 ; 20 + b1e: 91 e0 ldi r25, 0x01 ; 1 + b20: 59 de rcall .-846 ; 0x7d4 cmdbuffer[cmdPos] = '\0'; // terminate new command string - b16: 80 91 6d 02 lds r24, 0x026D - b1a: e8 2f mov r30, r24 - b1c: f0 e0 ldi r31, 0x00 ; 0 - b1e: ee 57 subi r30, 0x7E ; 126 - b20: fd 4f sbci r31, 0xFD ; 253 - b22: 10 82 st Z, r1 + b22: 80 91 6d 02 lds r24, 0x026D + b26: e8 2f mov r30, r24 + b28: f0 e0 ldi r31, 0x00 ; 0 + b2a: ee 57 subi r30, 0x7E ; 126 + b2c: fd 4f sbci r31, 0xFD ; 253 + b2e: 10 82 st Z, r1 curCmdLen = cmdPos; - b24: 80 93 6c 02 sts 0x026C, r24 + b30: 80 93 6c 02 sts 0x026C, r24 cmdPos = 0; - b28: 10 92 6d 02 sts 0x026D, r1 + b34: 10 92 6d 02 sts 0x026D, r1 if (cmdbuffer[0] == 'g' || cmdbuffer[0] == 'G') { // goto command - b2c: 80 91 82 02 lds r24, 0x0282 - b30: 87 36 cpi r24, 0x67 ; 103 - b32: 59 f0 breq .+22 ; 0xb4a - b34: 87 34 cpi r24, 0x47 ; 71 - b36: 49 f0 breq .+18 ; 0xb4a + b38: 80 91 82 02 lds r24, 0x0282 + b3c: 87 36 cpi r24, 0x67 ; 103 + b3e: 59 f0 breq .+22 ; 0xb56 + b40: 87 34 cpi r24, 0x47 ; 71 + b42: 49 f0 breq .+18 ; 0xb56 action = GOTO; } else if ( cmdbuffer[0] == 'm' || cmdbuffer[0] == 'M') { - b38: 8d 36 cpi r24, 0x6D ; 109 - b3a: 49 f0 breq .+18 ; 0xb4e - b3c: 8d 34 cpi r24, 0x4D ; 77 - b3e: 39 f0 breq .+14 ; 0xb4e + b44: 8d 36 cpi r24, 0x6D ; 109 + b46: 49 f0 breq .+18 ; 0xb5a + b48: 8d 34 cpi r24, 0x4D ; 77 + b4a: 39 f0 breq .+14 ; 0xb5a action = MOVEREL; } else if ( cmdbuffer[0] == 'z' || cmdbuffer[0] == 'Z' ) { - b40: 8a 37 cpi r24, 0x7A ; 122 - b42: 39 f0 breq .+14 ; 0xb52 - b44: 8a 35 cpi r24, 0x5A ; 90 - b46: 39 f4 brne .+14 ; 0xb56 - b48: 04 c0 rjmp .+8 ; 0xb52 + b4c: 8a 37 cpi r24, 0x7A ; 122 + b4e: 39 f0 breq .+14 ; 0xb5e + b50: 8a 35 cpi r24, 0x5A ; 90 + b52: 39 f4 brne .+14 ; 0xb62 + b54: 04 c0 rjmp .+8 ; 0xb5e curCmdLen = cmdPos; cmdPos = 0; if (cmdbuffer[0] == 'g' || cmdbuffer[0] == 'G') { // goto command action = GOTO; - b4a: 01 e0 ldi r16, 0x01 ; 1 - b4c: 05 c0 rjmp .+10 ; 0xb58 + b56: 01 e0 ldi r16, 0x01 ; 1 + b58: 05 c0 rjmp .+10 ; 0xb64 } else if ( cmdbuffer[0] == 'm' || cmdbuffer[0] == 'M') { action = MOVEREL; - b4e: 02 e0 ldi r16, 0x02 ; 2 - b50: 03 c0 rjmp .+6 ; 0xb58 + b5a: 02 e0 ldi r16, 0x02 ; 2 + b5c: 03 c0 rjmp .+6 ; 0xb64 } else if ( cmdbuffer[0] == 'z' || cmdbuffer[0] == 'Z' ) { action = SETZERO; - b52: 03 e0 ldi r16, 0x03 ; 3 - b54: 01 c0 rjmp .+2 ; 0xb58 + b5e: 03 e0 ldi r16, 0x03 ; 3 + b60: 01 c0 rjmp .+2 ; 0xb64 } else { action = POSITION; - b56: 00 e0 ldi r16, 0x00 ; 0 + b62: 00 e0 ldi r16, 0x00 ; 0 } if (cmdbuffer[1] == 'x' || cmdbuffer[1] == 'X') { - b58: 80 91 83 02 lds r24, 0x0283 - b5c: 88 37 cpi r24, 0x78 ; 120 - b5e: 39 f0 breq .+14 ; 0xb6e - b60: 88 35 cpi r24, 0x58 ; 88 - b62: 29 f0 breq .+10 ; 0xb6e + b64: 80 91 83 02 lds r24, 0x0283 + b68: 88 37 cpi r24, 0x78 ; 120 + b6a: 39 f0 breq .+14 ; 0xb7a + b6c: 88 35 cpi r24, 0x58 ; 88 + b6e: 29 f0 breq .+10 ; 0xb7a axis = X; } else if (cmdbuffer[1] == 'y' || cmdbuffer[1] == 'Y') { - b64: 89 37 cpi r24, 0x79 ; 121 - b66: 29 f0 breq .+10 ; 0xb72 + b70: 89 37 cpi r24, 0x79 ; 121 + b72: 29 f0 breq .+10 ; 0xb7e #define POSITION 0 #define GOTO 1 #define MOVEREL 2 #define SETZERO 3 void parse_command(void){ - b68: 11 e0 ldi r17, 0x01 ; 1 - b6a: 89 35 cpi r24, 0x59 ; 89 - b6c: 19 f0 breq .+6 ; 0xb74 + b74: 11 e0 ldi r17, 0x01 ; 1 + b76: 89 35 cpi r24, 0x59 ; 89 + b78: 19 f0 breq .+6 ; 0xb80 } else { action = POSITION; } if (cmdbuffer[1] == 'x' || cmdbuffer[1] == 'X') { axis = X; - b6e: 10 e0 ldi r17, 0x00 ; 0 - b70: 01 c0 rjmp .+2 ; 0xb74 + b7a: 10 e0 ldi r17, 0x00 ; 0 + b7c: 01 c0 rjmp .+2 ; 0xb80 } else if (cmdbuffer[1] == 'y' || cmdbuffer[1] == 'Y') { axis = Y; - b72: 11 e0 ldi r17, 0x01 ; 1 + b7e: 11 e0 ldi r17, 0x01 ; 1 } // if you expect coordinate, parse number! if (action == GOTO || action == MOVEREL){ - b74: 80 2f mov r24, r16 - b76: 81 50 subi r24, 0x01 ; 1 - b78: 82 30 cpi r24, 0x02 ; 2 - b7a: 08 f0 brcs .+2 ; 0xb7e - b7c: 6d c0 rjmp .+218 ; 0xc58 + b80: 80 2f mov r24, r16 + b82: 81 50 subi r24, 0x01 ; 1 + b84: 82 30 cpi r24, 0x02 ; 2 + b86: 08 f0 brcs .+2 ; 0xb8a + b88: 6d c0 rjmp .+218 ; 0xc64 predot = 0; - b7e: 10 92 71 02 sts 0x0271, r1 - b82: 10 92 70 02 sts 0x0270, r1 + b8a: 10 92 71 02 sts 0x0271, r1 + b8e: 10 92 70 02 sts 0x0270, r1 postdot = 0; - b86: 10 92 6f 02 sts 0x026F, r1 - b8a: 10 92 6e 02 sts 0x026E, r1 + b92: 10 92 6f 02 sts 0x026F, r1 + b96: 10 92 6e 02 sts 0x026E, r1 num_sign = 1; num_start = 0; - b8e: 10 92 6b 02 sts 0x026B, r1 + b9a: 10 92 6b 02 sts 0x026B, r1 nums_found = 0; - b92: 10 92 6a 02 sts 0x026A, r1 + b9e: 10 92 6a 02 sts 0x026A, r1 for (uint8_t i=2; i<=curCmdLen; i++) { - b96: 92 e0 ldi r25, 0x02 ; 2 - b98: f9 2e mov r15, r25 + ba2: 92 e0 ldi r25, 0x02 ; 2 + ba4: f9 2e mov r15, r25 // if you expect coordinate, parse number! if (action == GOTO || action == MOVEREL){ predot = 0; postdot = 0; num_sign = 1; - b9a: dd 24 eor r13, r13 - b9c: d3 94 inc r13 + ba6: dd 24 eor r13, r13 + ba8: d3 94 inc r13 predot = atoi(numbuffer); } else { // its the postdot digits uint8_t postdotlen = i-num_start; if (postdotlen < 3){ // if too small ,fill with zeros for( uint8_t j = postdotlen; j <=2; j++) { numbuffer[j] = '0'; - b9e: 80 e3 ldi r24, 0x30 ; 48 - ba0: c8 2e mov r12, r24 + baa: 80 e3 ldi r24, 0x30 ; 48 + bac: c8 2e mov r12, r24 postdot = 0; num_sign = 1; num_start = 0; nums_found = 0; for (uint8_t i=2; i<=curCmdLen; i++) { - ba2: 54 c0 rjmp .+168 ; 0xc4c + bae: 54 c0 rjmp .+168 ; 0xc58 if ( num_start == 0 && cmdbuffer[i] == '-' ) { // if you find a minus before - ba4: e0 90 6b 02 lds r14, 0x026B - ba8: ee 20 and r14, r14 - baa: 49 f4 brne .+18 ; 0xbbe - bac: ef 2d mov r30, r15 - bae: f0 e0 ldi r31, 0x00 ; 0 - bb0: ee 57 subi r30, 0x7E ; 126 - bb2: fd 4f sbci r31, 0xFD ; 253 - bb4: 80 81 ld r24, Z - bb6: 8d 32 cpi r24, 0x2D ; 45 - bb8: 11 f4 brne .+4 ; 0xbbe + bb0: e0 90 6b 02 lds r14, 0x026B + bb4: ee 20 and r14, r14 + bb6: 49 f4 brne .+18 ; 0xbca + bb8: ef 2d mov r30, r15 + bba: f0 e0 ldi r31, 0x00 ; 0 + bbc: ee 57 subi r30, 0x7E ; 126 + bbe: fd 4f sbci r31, 0xFD ; 253 + bc0: 80 81 ld r24, Z + bc2: 8d 32 cpi r24, 0x2D ; 45 + bc4: 11 f4 brne .+4 ; 0xbca // you find a digit, it's a negative number num_sign = -1; - bba: dd 24 eor r13, r13 - bbc: da 94 dec r13 + bc6: dd 24 eor r13, r13 + bc8: da 94 dec r13 } if ( cmdbuffer[i] >= 48 && cmdbuffer[i] <= 57 ){ // is it a number? - bbe: cf 2d mov r28, r15 - bc0: d0 e0 ldi r29, 0x00 ; 0 - bc2: fe 01 movw r30, r28 - bc4: ee 57 subi r30, 0x7E ; 126 - bc6: fd 4f sbci r31, 0xFD ; 253 - bc8: 80 81 ld r24, Z - bca: 80 53 subi r24, 0x30 ; 48 - bcc: 8a 30 cpi r24, 0x0A ; 10 - bce: 28 f4 brcc .+10 ; 0xbda + bca: cf 2d mov r28, r15 + bcc: d0 e0 ldi r29, 0x00 ; 0 + bce: fe 01 movw r30, r28 + bd0: ee 57 subi r30, 0x7E ; 126 + bd2: fd 4f sbci r31, 0xFD ; 253 + bd4: 80 81 ld r24, Z + bd6: 80 53 subi r24, 0x30 ; 48 + bd8: 8a 30 cpi r24, 0x0A ; 10 + bda: 28 f4 brcc .+10 ; 0xbe6 if ( num_start == 0) { // this is the first digit in the string - bd0: ee 20 and r14, r14 - bd2: d9 f5 brne .+118 ; 0xc4a + bdc: ee 20 and r14, r14 + bde: d9 f5 brne .+118 ; 0xc56 num_start = i; - bd4: f0 92 6b 02 sts 0x026B, r15 - bd8: 38 c0 rjmp .+112 ; 0xc4a + be0: f0 92 6b 02 sts 0x026B, r15 + be4: 38 c0 rjmp .+112 ; 0xc56 } } else { // no digit! if ( num_start != 0) { // digits have been found before - bda: ee 20 and r14, r14 - bdc: b1 f1 breq .+108 ; 0xc4a + be6: ee 20 and r14, r14 + be8: b1 f1 breq .+108 ; 0xc56 strncpy(numbuffer,cmdbuffer+num_start,i-num_start); // copy number found to - bde: 6e 2d mov r22, r14 - be0: 70 e0 ldi r23, 0x00 ; 0 - be2: c6 1b sub r28, r22 - be4: d7 0b sbc r29, r23 - be6: 6e 57 subi r22, 0x7E ; 126 - be8: 7d 4f sbci r23, 0xFD ; 253 - bea: 82 e7 ldi r24, 0x72 ; 114 - bec: 92 e0 ldi r25, 0x02 ; 2 - bee: ae 01 movw r20, r28 - bf0: 0e 94 61 0f call 0x1ec2 ; 0x1ec2 + bea: 6e 2d mov r22, r14 + bec: 70 e0 ldi r23, 0x00 ; 0 + bee: c6 1b sub r28, r22 + bf0: d7 0b sbc r29, r23 + bf2: 6e 57 subi r22, 0x7E ; 126 + bf4: 7d 4f sbci r23, 0xFD ; 253 + bf6: 82 e7 ldi r24, 0x72 ; 114 + bf8: 92 e0 ldi r25, 0x02 ; 2 + bfa: ae 01 movw r20, r28 + bfc: 0e 94 61 0f call 0x1ec2 ; 0x1ec2 // numbuffer numbuffer[i-num_start] = '\0'; // make sure it's always a terminated string - bf4: ce 58 subi r28, 0x8E ; 142 - bf6: dd 4f sbci r29, 0xFD ; 253 - bf8: 18 82 st Y, r1 + c00: ce 58 subi r28, 0x8E ; 142 + c02: dd 4f sbci r29, 0xFD ; 253 + c04: 18 82 st Y, r1 nums_found++; - bfa: 80 91 6a 02 lds r24, 0x026A - bfe: 8f 5f subi r24, 0xFF ; 255 - c00: 80 93 6a 02 sts 0x026A, r24 + c06: 80 91 6a 02 lds r24, 0x026A + c0a: 8f 5f subi r24, 0xFF ; 255 + c0c: 80 93 6a 02 sts 0x026A, r24 if(nums_found == 1) { // its the predot digits - c04: 81 30 cpi r24, 0x01 ; 1 - c06: 49 f4 brne .+18 ; 0xc1a + c10: 81 30 cpi r24, 0x01 ; 1 + c12: 49 f4 brne .+18 ; 0xc26 predot = atoi(numbuffer); - c08: 82 e7 ldi r24, 0x72 ; 114 - c0a: 92 e0 ldi r25, 0x02 ; 2 - c0c: 0e 94 44 0f call 0x1e88 ; 0x1e88 - c10: 90 93 71 02 sts 0x0271, r25 - c14: 80 93 70 02 sts 0x0270, r24 - c18: 16 c0 rjmp .+44 ; 0xc46 + c14: 82 e7 ldi r24, 0x72 ; 114 + c16: 92 e0 ldi r25, 0x02 ; 2 + c18: 0e 94 44 0f call 0x1e88 ; 0x1e88 + c1c: 90 93 71 02 sts 0x0271, r25 + c20: 80 93 70 02 sts 0x0270, r24 + c24: 16 c0 rjmp .+44 ; 0xc52 } else { // its the postdot digits uint8_t postdotlen = i-num_start; - c1a: 8f 2d mov r24, r15 - c1c: 8e 19 sub r24, r14 + c26: 8f 2d mov r24, r15 + c28: 8e 19 sub r24, r14 if (postdotlen < 3){ // if too small ,fill with zeros - c1e: 83 30 cpi r24, 0x03 ; 3 - c20: 40 f4 brcc .+16 ; 0xc32 + c2a: 83 30 cpi r24, 0x03 ; 3 + c2c: 40 f4 brcc .+16 ; 0xc3e for( uint8_t j = postdotlen; j <=2; j++) { numbuffer[j] = '0'; - c22: e8 2f mov r30, r24 - c24: f0 e0 ldi r31, 0x00 ; 0 - c26: ee 58 subi r30, 0x8E ; 142 - c28: fd 4f sbci r31, 0xFD ; 253 - c2a: c0 82 st Z, r12 + c2e: e8 2f mov r30, r24 + c30: f0 e0 ldi r31, 0x00 ; 0 + c32: ee 58 subi r30, 0x8E ; 142 + c34: fd 4f sbci r31, 0xFD ; 253 + c36: c0 82 st Z, r12 if(nums_found == 1) { // its the predot digits predot = atoi(numbuffer); } else { // its the postdot digits uint8_t postdotlen = i-num_start; if (postdotlen < 3){ // if too small ,fill with zeros for( uint8_t j = postdotlen; j <=2; j++) { - c2c: 8f 5f subi r24, 0xFF ; 255 - c2e: 83 30 cpi r24, 0x03 ; 3 - c30: c1 f7 brne .-16 ; 0xc22 + c38: 8f 5f subi r24, 0xFF ; 255 + c3a: 83 30 cpi r24, 0x03 ; 3 + c3c: c1 f7 brne .-16 ; 0xc2e numbuffer[j] = '0'; } } // crop the number to three post dot digits numbuffer[3] = '\0'; - c32: 10 92 75 02 sts 0x0275, r1 + c3e: 10 92 75 02 sts 0x0275, r1 postdot = atoi(numbuffer); - c36: 82 e7 ldi r24, 0x72 ; 114 - c38: 92 e0 ldi r25, 0x02 ; 2 - c3a: 0e 94 44 0f call 0x1e88 ; 0x1e88 - c3e: 90 93 6f 02 sts 0x026F, r25 - c42: 80 93 6e 02 sts 0x026E, r24 + c42: 82 e7 ldi r24, 0x72 ; 114 + c44: 92 e0 ldi r25, 0x02 ; 2 + c46: 0e 94 44 0f call 0x1e88 ; 0x1e88 + c4a: 90 93 6f 02 sts 0x026F, r25 + c4e: 80 93 6e 02 sts 0x026E, r24 } num_start = 0; - c46: 10 92 6b 02 sts 0x026B, r1 + c52: 10 92 6b 02 sts 0x026B, r1 postdot = 0; num_sign = 1; num_start = 0; nums_found = 0; for (uint8_t i=2; i<=curCmdLen; i++) { - c4a: f3 94 inc r15 - c4c: 80 91 6c 02 lds r24, 0x026C - c50: 8f 15 cp r24, r15 - c52: 08 f0 brcs .+2 ; 0xc56 - c54: a7 cf rjmp .-178 ; 0xba4 - c56: 02 c0 rjmp .+4 ; 0xc5c + c56: f3 94 inc r15 + c58: 80 91 6c 02 lds r24, 0x026C + c5c: 8f 15 cp r24, r15 + c5e: 08 f0 brcs .+2 ; 0xc62 + c60: a7 cf rjmp .-178 ; 0xbb0 + c62: 02 c0 rjmp .+4 ; 0xc68 static char cmdbuffer[32]; static char numbuffer[16]; static uint16_t predot = 0,postdot = 0; static uint8_t cmdPos, curCmdLen, num_start = 0, nums_found = 0; uint8_t action=0,axis=0; int8_t num_sign = 1; - c58: dd 24 eor r13, r13 - c5a: d3 94 inc r13 + c64: dd 24 eor r13, r13 + c66: d3 94 inc r13 } int16_t steps = 0,dest=0; switch (action) { - c5c: 02 30 cpi r16, 0x02 ; 2 - c5e: 09 f4 brne .+2 ; 0xc62 - c60: 61 c0 rjmp .+194 ; 0xd24 - c62: 03 30 cpi r16, 0x03 ; 3 - c64: 09 f4 brne .+2 ; 0xc68 - c66: be c0 rjmp .+380 ; 0xde4 - c68: 01 30 cpi r16, 0x01 ; 1 - c6a: 09 f0 breq .+2 ; 0xc6e - c6c: c3 c0 rjmp .+390 ; 0xdf4 + c68: 02 30 cpi r16, 0x02 ; 2 + c6a: 09 f4 brne .+2 ; 0xc6e + c6c: 61 c0 rjmp .+194 ; 0xd30 + c6e: 03 30 cpi r16, 0x03 ; 3 + c70: 09 f4 brne .+2 ; 0xc74 + c72: be c0 rjmp .+380 ; 0xdf0 + c74: 01 30 cpi r16, 0x01 ; 1 + c76: 09 f0 breq .+2 ; 0xc7a + c78: c3 c0 rjmp .+390 ; 0xe00 case GOTO: uart_puts("GOTO "); - c6e: 87 e1 ldi r24, 0x17 ; 23 - c70: 91 e0 ldi r25, 0x01 ; 1 - c72: b0 dd rcall .-1184 ; 0x7d4 + c7a: 87 e1 ldi r24, 0x17 ; 23 + c7c: 91 e0 ldi r25, 0x01 ; 1 + c7e: aa dd rcall .-1196 ; 0x7d4 uart_putc(88+axis);// x or y - c74: 81 2f mov r24, r17 - c76: 88 5a subi r24, 0xA8 ; 168 - c78: a5 dd rcall .-1206 ; 0x7c4 + c80: 81 2f mov r24, r17 + c82: 88 5a subi r24, 0xA8 ; 168 + c84: 9f dd rcall .-1218 ; 0x7c4 uart_putc(' '); - c7a: 80 e2 ldi r24, 0x20 ; 32 - c7c: a3 dd rcall .-1210 ; 0x7c4 + c86: 80 e2 ldi r24, 0x20 ; 32 + c88: 9d dd rcall .-1222 ; 0x7c4 uart_print_signed_number(predot*num_sign,3); - c7e: cd 2d mov r28, r13 - c80: dd 27 eor r29, r29 - c82: c7 fd sbrc r28, 7 - c84: d0 95 com r29 - c86: 60 91 70 02 lds r22, 0x0270 - c8a: 70 91 71 02 lds r23, 0x0271 - c8e: ce 01 movw r24, r28 - c90: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - c94: bc 01 movw r22, r24 - c96: 80 e0 ldi r24, 0x00 ; 0 - c98: 90 e0 ldi r25, 0x00 ; 0 - c9a: 43 e0 ldi r20, 0x03 ; 3 - c9c: 34 de rcall .-920 ; 0x906 + c8a: cd 2d mov r28, r13 + c8c: dd 27 eor r29, r29 + c8e: c7 fd sbrc r28, 7 + c90: d0 95 com r29 + c92: 60 91 70 02 lds r22, 0x0270 + c96: 70 91 71 02 lds r23, 0x0271 + c9a: ce 01 movw r24, r28 + c9c: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + ca0: bc 01 movw r22, r24 + ca2: 80 e0 ldi r24, 0x00 ; 0 + ca4: 90 e0 ldi r25, 0x00 ; 0 + ca6: 43 e0 ldi r20, 0x03 ; 3 + ca8: 2e de rcall .-932 ; 0x906 uart_putc('.'); - c9e: 8e e2 ldi r24, 0x2E ; 46 - ca0: 91 dd rcall .-1246 ; 0x7c4 + caa: 8e e2 ldi r24, 0x2E ; 46 + cac: 8b dd rcall .-1258 ; 0x7c4 uart_print_number_wlzeros(postdot,3); - ca2: 60 91 6e 02 lds r22, 0x026E - ca6: 70 91 6f 02 lds r23, 0x026F - caa: 80 e0 ldi r24, 0x00 ; 0 - cac: 90 e0 ldi r25, 0x00 ; 0 - cae: 43 e0 ldi r20, 0x03 ; 3 - cb0: 16 de rcall .-980 ; 0x8de + cae: 60 91 6e 02 lds r22, 0x026E + cb2: 70 91 6f 02 lds r23, 0x026F + cb6: 80 e0 ldi r24, 0x00 ; 0 + cb8: 90 e0 ldi r25, 0x00 ; 0 + cba: 43 e0 ldi r20, 0x03 ; 3 + cbc: 10 de rcall .-992 ; 0x8de uart_puts("\r\n"); - cb2: 84 e1 ldi r24, 0x14 ; 20 - cb4: 91 e0 ldi r25, 0x01 ; 1 - cb6: 8e dd rcall .-1252 ; 0x7d4 + cbe: 84 e1 ldi r24, 0x14 ; 20 + cc0: 91 e0 ldi r25, 0x01 ; 1 + cc2: 88 dd rcall .-1264 ; 0x7d4 dest = num_sign *( predot*24 +(postdot*10)/416); - cb8: 80 91 6e 02 lds r24, 0x026E - cbc: 90 91 6f 02 lds r25, 0x026F - cc0: 6a e0 ldi r22, 0x0A ; 10 - cc2: 70 e0 ldi r23, 0x00 ; 0 - cc4: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - cc8: 60 ea ldi r22, 0xA0 ; 160 - cca: 71 e0 ldi r23, 0x01 ; 1 - ccc: 0e 94 fb 0e call 0x1df6 ; 0x1df6 <__udivmodhi4> - cd0: 9b 01 movw r18, r22 - cd2: 80 91 70 02 lds r24, 0x0270 - cd6: 90 91 71 02 lds r25, 0x0271 - cda: 68 e1 ldi r22, 0x18 ; 24 - cdc: 70 e0 ldi r23, 0x00 ; 0 - cde: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - ce2: 28 0f add r18, r24 - ce4: 39 1f adc r19, r25 - ce6: ce 01 movw r24, r28 - ce8: b9 01 movw r22, r18 + cc4: 80 91 6e 02 lds r24, 0x026E + cc8: 90 91 6f 02 lds r25, 0x026F + ccc: 6a e0 ldi r22, 0x0A ; 10 + cce: 70 e0 ldi r23, 0x00 ; 0 + cd0: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + cd4: 60 ea ldi r22, 0xA0 ; 160 + cd6: 71 e0 ldi r23, 0x01 ; 1 + cd8: 0e 94 fb 0e call 0x1df6 ; 0x1df6 <__udivmodhi4> + cdc: 9b 01 movw r18, r22 + cde: 80 91 70 02 lds r24, 0x0270 + ce2: 90 91 71 02 lds r25, 0x0271 + ce6: 68 e1 ldi r22, 0x18 ; 24 + ce8: 70 e0 ldi r23, 0x00 ; 0 cea: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + cee: 28 0f add r18, r24 + cf0: 39 1f adc r19, r25 + cf2: ce 01 movw r24, r28 + cf4: b9 01 movw r22, r18 + cf6: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> if (axis == X) { - cee: 11 23 and r17, r17 - cf0: 69 f4 brne .+26 ; 0xd0c + cfa: 11 23 and r17, r17 + cfc: 69 f4 brne .+26 ; 0xd18 steps = dest - plate_pos_x; // experimental correction! - cf2: 20 91 4e 01 lds r18, 0x014E - cf6: 30 91 4f 01 lds r19, 0x014F - cfa: e8 2e mov r14, r24 - cfc: e7 01 movw r28, r14 - cfe: 7e 01 movw r14, r28 - d00: f9 2e mov r15, r25 - d02: e7 01 movw r28, r14 - d04: c2 1b sub r28, r18 - d06: d3 0b sbc r29, r19 + cfe: 20 91 4e 01 lds r18, 0x014E + d02: 30 91 4f 01 lds r19, 0x014F + d06: e8 2e mov r14, r24 + d08: e7 01 movw r28, r14 + d0a: 7e 01 movw r14, r28 + d0c: f9 2e mov r15, r25 + d0e: e7 01 movw r28, r14 + d10: c2 1b sub r28, r18 + d12: d3 0b sbc r29, r19 move_plate(steps,0); - d08: ce 01 movw r24, r28 - d0a: 4f c0 rjmp .+158 ; 0xdaa + d14: ce 01 movw r24, r28 + d16: 4f c0 rjmp .+158 ; 0xdb6 plate_pos_x += steps; } else if (axis == Y) { steps = dest - plate_pos_y; - d0c: 20 91 50 01 lds r18, 0x0150 - d10: 30 91 51 01 lds r19, 0x0151 - d14: e8 2e mov r14, r24 - d16: e7 01 movw r28, r14 - d18: 7e 01 movw r14, r28 - d1a: f9 2e mov r15, r25 - d1c: e7 01 movw r28, r14 - d1e: c2 1b sub r28, r18 - d20: d3 0b sbc r29, r19 - d22: 51 c0 rjmp .+162 ; 0xdc6 + d18: 20 91 50 01 lds r18, 0x0150 + d1c: 30 91 51 01 lds r19, 0x0151 + d20: e8 2e mov r14, r24 + d22: e7 01 movw r28, r14 + d24: 7e 01 movw r14, r28 + d26: f9 2e mov r15, r25 + d28: e7 01 movw r28, r14 + d2a: c2 1b sub r28, r18 + d2c: d3 0b sbc r29, r19 + d2e: 51 c0 rjmp .+162 ; 0xdd2 } pos_report(); break; case MOVEREL: uart_puts("MOVE "); - d24: 8d e1 ldi r24, 0x1D ; 29 - d26: 91 e0 ldi r25, 0x01 ; 1 - d28: 55 dd rcall .-1366 ; 0x7d4 + d30: 8d e1 ldi r24, 0x1D ; 29 + d32: 91 e0 ldi r25, 0x01 ; 1 + d34: 4f dd rcall .-1378 ; 0x7d4 uart_putc(88+axis);// x or y - d2a: 81 2f mov r24, r17 - d2c: 88 5a subi r24, 0xA8 ; 168 - d2e: 4a dd rcall .-1388 ; 0x7c4 + d36: 81 2f mov r24, r17 + d38: 88 5a subi r24, 0xA8 ; 168 + d3a: 44 dd rcall .-1400 ; 0x7c4 uart_putc(' '); - d30: 80 e2 ldi r24, 0x20 ; 32 - d32: 48 dd rcall .-1392 ; 0x7c4 + d3c: 80 e2 ldi r24, 0x20 ; 32 + d3e: 42 dd rcall .-1404 ; 0x7c4 uart_print_signed_number(predot*num_sign,3); - d34: cd 2d mov r28, r13 - d36: dd 27 eor r29, r29 - d38: c7 fd sbrc r28, 7 - d3a: d0 95 com r29 - d3c: 60 91 70 02 lds r22, 0x0270 - d40: 70 91 71 02 lds r23, 0x0271 - d44: ce 01 movw r24, r28 - d46: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - d4a: bc 01 movw r22, r24 - d4c: 80 e0 ldi r24, 0x00 ; 0 - d4e: 90 e0 ldi r25, 0x00 ; 0 - d50: 43 e0 ldi r20, 0x03 ; 3 - d52: d9 dd rcall .-1102 ; 0x906 + d40: cd 2d mov r28, r13 + d42: dd 27 eor r29, r29 + d44: c7 fd sbrc r28, 7 + d46: d0 95 com r29 + d48: 60 91 70 02 lds r22, 0x0270 + d4c: 70 91 71 02 lds r23, 0x0271 + d50: ce 01 movw r24, r28 + d52: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + d56: bc 01 movw r22, r24 + d58: 80 e0 ldi r24, 0x00 ; 0 + d5a: 90 e0 ldi r25, 0x00 ; 0 + d5c: 43 e0 ldi r20, 0x03 ; 3 + d5e: d3 dd rcall .-1114 ; 0x906 uart_putc('.'); - d54: 8e e2 ldi r24, 0x2E ; 46 - d56: 36 dd rcall .-1428 ; 0x7c4 + d60: 8e e2 ldi r24, 0x2E ; 46 + d62: 30 dd rcall .-1440 ; 0x7c4 uart_print_number_wlzeros(postdot,3); - d58: 60 91 6e 02 lds r22, 0x026E - d5c: 70 91 6f 02 lds r23, 0x026F - d60: 80 e0 ldi r24, 0x00 ; 0 - d62: 90 e0 ldi r25, 0x00 ; 0 - d64: 43 e0 ldi r20, 0x03 ; 3 - d66: bb dd rcall .-1162 ; 0x8de + d64: 60 91 6e 02 lds r22, 0x026E + d68: 70 91 6f 02 lds r23, 0x026F + d6c: 80 e0 ldi r24, 0x00 ; 0 + d6e: 90 e0 ldi r25, 0x00 ; 0 + d70: 43 e0 ldi r20, 0x03 ; 3 + d72: b5 dd rcall .-1174 ; 0x8de uart_puts("\r\n"); - d68: 84 e1 ldi r24, 0x14 ; 20 - d6a: 91 e0 ldi r25, 0x01 ; 1 - d6c: 33 dd rcall .-1434 ; 0x7d4 + d74: 84 e1 ldi r24, 0x14 ; 20 + d76: 91 e0 ldi r25, 0x01 ; 1 + d78: 2d dd rcall .-1446 ; 0x7d4 steps = num_sign *( predot*24 +(postdot*10)/416); - d6e: 80 91 6e 02 lds r24, 0x026E - d72: 90 91 6f 02 lds r25, 0x026F - d76: 6a e0 ldi r22, 0x0A ; 10 - d78: 70 e0 ldi r23, 0x00 ; 0 - d7a: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - d7e: 60 ea ldi r22, 0xA0 ; 160 - d80: 71 e0 ldi r23, 0x01 ; 1 - d82: 0e 94 fb 0e call 0x1df6 ; 0x1df6 <__udivmodhi4> - d86: 9b 01 movw r18, r22 - d88: 80 91 70 02 lds r24, 0x0270 - d8c: 90 91 71 02 lds r25, 0x0271 - d90: 68 e1 ldi r22, 0x18 ; 24 - d92: 70 e0 ldi r23, 0x00 ; 0 - d94: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - d98: 28 0f add r18, r24 - d9a: 39 1f adc r19, r25 - d9c: ce 01 movw r24, r28 - d9e: b9 01 movw r22, r18 + d7a: 80 91 6e 02 lds r24, 0x026E + d7e: 90 91 6f 02 lds r25, 0x026F + d82: 6a e0 ldi r22, 0x0A ; 10 + d84: 70 e0 ldi r23, 0x00 ; 0 + d86: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + d8a: 60 ea ldi r22, 0xA0 ; 160 + d8c: 71 e0 ldi r23, 0x01 ; 1 + d8e: 0e 94 fb 0e call 0x1df6 ; 0x1df6 <__udivmodhi4> + d92: 9b 01 movw r18, r22 + d94: 80 91 70 02 lds r24, 0x0270 + d98: 90 91 71 02 lds r25, 0x0271 + d9c: 68 e1 ldi r22, 0x18 ; 24 + d9e: 70 e0 ldi r23, 0x00 ; 0 da0: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> - da4: ec 01 movw r28, r24 + da4: 28 0f add r18, r24 + da6: 39 1f adc r19, r25 + da8: ce 01 movw r24, r28 + daa: b9 01 movw r22, r18 + dac: 0e 94 e9 0e call 0x1dd2 ; 0x1dd2 <__mulhi3> + db0: ec 01 movw r28, r24 if (axis == X) { - da6: 11 23 and r17, r17 - da8: 71 f4 brne .+28 ; 0xdc6 + db2: 11 23 and r17, r17 + db4: 71 f4 brne .+28 ; 0xdd2 move_plate(steps,0); - daa: 60 e0 ldi r22, 0x00 ; 0 - dac: 70 e0 ldi r23, 0x00 ; 0 - dae: 0d de rcall .-998 ; 0x9ca + db6: 60 e0 ldi r22, 0x00 ; 0 + db8: 70 e0 ldi r23, 0x00 ; 0 + dba: 07 de rcall .-1010 ; 0x9ca plate_pos_x += steps; - db0: 80 91 4e 01 lds r24, 0x014E - db4: 90 91 4f 01 lds r25, 0x014F - db8: 8c 0f add r24, r28 - dba: 9d 1f adc r25, r29 - dbc: 90 93 4f 01 sts 0x014F, r25 - dc0: 80 93 4e 01 sts 0x014E, r24 - dc4: 17 c0 rjmp .+46 ; 0xdf4 + dbc: 80 91 4e 01 lds r24, 0x014E + dc0: 90 91 4f 01 lds r25, 0x014F + dc4: 8c 0f add r24, r28 + dc6: 9d 1f adc r25, r29 + dc8: 90 93 4f 01 sts 0x014F, r25 + dcc: 80 93 4e 01 sts 0x014E, r24 + dd0: 17 c0 rjmp .+46 ; 0xe00 } else if (axis == Y) { move_plate(0,steps); - dc6: 80 e0 ldi r24, 0x00 ; 0 - dc8: 90 e0 ldi r25, 0x00 ; 0 - dca: be 01 movw r22, r28 - dcc: fe dd rcall .-1028 ; 0x9ca + dd2: 80 e0 ldi r24, 0x00 ; 0 + dd4: 90 e0 ldi r25, 0x00 ; 0 + dd6: be 01 movw r22, r28 + dd8: f8 dd rcall .-1040 ; 0x9ca plate_pos_y += steps; - dce: 80 91 50 01 lds r24, 0x0150 - dd2: 90 91 51 01 lds r25, 0x0151 - dd6: 8c 0f add r24, r28 - dd8: 9d 1f adc r25, r29 - dda: 90 93 51 01 sts 0x0151, r25 - dde: 80 93 50 01 sts 0x0150, r24 - de2: 08 c0 rjmp .+16 ; 0xdf4 + dda: 80 91 50 01 lds r24, 0x0150 + dde: 90 91 51 01 lds r25, 0x0151 + de2: 8c 0f add r24, r28 + de4: 9d 1f adc r25, r29 + de6: 90 93 51 01 sts 0x0151, r25 + dea: 80 93 50 01 sts 0x0150, r24 + dee: 08 c0 rjmp .+16 ; 0xe00 } pos_report(); break; case SETZERO: plate_pos_x = 0; - de4: 10 92 4f 01 sts 0x014F, r1 - de8: 10 92 4e 01 sts 0x014E, r1 + df0: 10 92 4f 01 sts 0x014F, r1 + df4: 10 92 4e 01 sts 0x014E, r1 plate_pos_y = 0; - dec: 10 92 51 01 sts 0x0151, r1 - df0: 10 92 50 01 sts 0x0150, r1 + df8: 10 92 51 01 sts 0x0151, r1 + dfc: 10 92 50 01 sts 0x0150, r1 pos_report(); break; case POSITION: pos_report(); - df4: 5f de rcall .-834 ; 0xab4 + e00: 5f de rcall .-834 ; 0xac0 break; - df6: 17 c0 rjmp .+46 ; 0xe26 + e02: 17 c0 rjmp .+46 ; 0xe32 } } else { // queue command if( cmdPos == 0 ){ - df8: 80 91 6d 02 lds r24, 0x026D - dfc: 88 23 and r24, r24 - dfe: 19 f4 brne .+6 ; 0xe06 + e04: 80 91 6d 02 lds r24, 0x026D + e08: 88 23 and r24, r24 + e0a: 19 f4 brne .+6 ; 0xe12 uart_puts("\r\n$ "); - e00: 83 e2 ldi r24, 0x23 ; 35 - e02: 91 e0 ldi r25, 0x01 ; 1 - e04: e7 dc rcall .-1586 ; 0x7d4 - e06: 80 91 6d 02 lds r24, 0x026D + e0c: 83 e2 ldi r24, 0x23 ; 35 + e0e: 91 e0 ldi r25, 0x01 ; 1 + e10: e1 dc rcall .-1598 ; 0x7d4 + e12: 80 91 6d 02 lds r24, 0x026D } if( byte == 8 ){ // backspace - e0a: 18 30 cpi r17, 0x08 ; 8 - e0c: 11 f4 brne .+4 ; 0xe12 + e16: 18 30 cpi r17, 0x08 ; 8 + e18: 11 f4 brne .+4 ; 0xe1e cmdPos--; - e0e: 81 50 subi r24, 0x01 ; 1 - e10: 06 c0 rjmp .+12 ; 0xe1e + e1a: 81 50 subi r24, 0x01 ; 1 + e1c: 06 c0 rjmp .+12 ; 0xe2a } else { cmdbuffer[cmdPos++] = byte; - e12: e8 2f mov r30, r24 - e14: f0 e0 ldi r31, 0x00 ; 0 - e16: ee 57 subi r30, 0x7E ; 126 - e18: fd 4f sbci r31, 0xFD ; 253 - e1a: 10 83 st Z, r17 - e1c: 8f 5f subi r24, 0xFF ; 255 - e1e: 80 93 6d 02 sts 0x026D, r24 + e1e: e8 2f mov r30, r24 + e20: f0 e0 ldi r31, 0x00 ; 0 + e22: ee 57 subi r30, 0x7E ; 126 + e24: fd 4f sbci r31, 0xFD ; 253 + e26: 10 83 st Z, r17 + e28: 8f 5f subi r24, 0xFF ; 255 + e2a: 80 93 6d 02 sts 0x026D, r24 } uart_putc(byte); - e22: 81 2f mov r24, r17 - e24: cf dc rcall .-1634 ; 0x7c4 + e2e: 81 2f mov r24, r17 + e30: c9 dc rcall .-1646 ; 0x7c4 } } } - e26: df 91 pop r29 - e28: cf 91 pop r28 - e2a: 1f 91 pop r17 - e2c: 0f 91 pop r16 - e2e: ff 90 pop r15 - e30: ef 90 pop r14 - e32: df 90 pop r13 - e34: cf 90 pop r12 - e36: 08 95 ret - -00000e38
: + e32: df 91 pop r29 + e34: cf 91 pop r28 + e36: 1f 91 pop r17 + e38: 0f 91 pop r16 + e3a: ff 90 pop r15 + e3c: ef 90 pop r14 + e3e: df 90 pop r13 + e40: cf 90 pop r12 + e42: 08 95 ret + +00000e44
: int main(void) { - e38: 0f 93 push r16 - e3a: 1f 93 push r17 - e3c: df 93 push r29 - e3e: cf 93 push r28 - e40: 0f 92 push r0 - e42: cd b7 in r28, 0x3d ; 61 - e44: de b7 in r29, 0x3e ; 62 + e44: 0f 93 push r16 + e46: 1f 93 push r17 + e48: df 93 push r29 + e4a: cf 93 push r28 + e4c: 0f 92 push r0 + e4e: cd b7 in r28, 0x3d ; 61 + e50: de b7 in r29, 0x3e ; 62 init_motors(); - e46: 82 dd rcall .-1276 ; 0x94c + e52: 7c dd rcall .-1288 ; 0x94c char dummy; uint8_t field_val = 0; SetupHardware(); - e48: 0e dc rcall .-2020 ; 0x666 + e54: 08 dc rcall .-2032 ; 0x666 RingBuffer_InitBuffer(&USBtoUSART_Buffer, USBtoUSART_Buffer_Data, sizeof(USBtoUSART_Buffer_Data)); - e4a: 82 e5 ldi r24, 0x52 ; 82 - e4c: 91 e0 ldi r25, 0x01 ; 1 - e4e: 6e e5 ldi r22, 0x5E ; 94 - e50: 71 e0 ldi r23, 0x01 ; 1 - e52: 37 da rcall .-2962 ; 0x2c2 + e56: 82 e5 ldi r24, 0x52 ; 82 + e58: 91 e0 ldi r25, 0x01 ; 1 + e5a: 6e e5 ldi r22, 0x5E ; 94 + e5c: 71 e0 ldi r23, 0x01 ; 1 + e5e: 31 da rcall .-2974 ; 0x2c2 RingBuffer_InitBuffer(&USARTtoUSB_Buffer, USARTtoUSB_Buffer_Data, sizeof(USARTtoUSB_Buffer_Data)); - e54: 8e ed ldi r24, 0xDE ; 222 - e56: 91 e0 ldi r25, 0x01 ; 1 - e58: 6a ee ldi r22, 0xEA ; 234 - e5a: 71 e0 ldi r23, 0x01 ; 1 - e5c: 32 da rcall .-2972 ; 0x2c2 + e60: 8e ed ldi r24, 0xDE ; 222 + e62: 91 e0 ldi r25, 0x01 ; 1 + e64: 6a ee ldi r22, 0xEA ; 234 + e66: 71 e0 ldi r23, 0x01 ; 1 + e68: 2c da rcall .-2984 ; 0x2c2 static inline void GlobalInterruptEnable(void) { GCC_MEMORY_BARRIER(); #if (ARCH == ARCH_AVR8) sei(); - e5e: 78 94 sei + e6a: 78 94 sei // LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); GlobalInterruptEnable(); touchpad_init(); // you need to call this to setup the I/O pin! - e60: 72 db rcall .-2332 ; 0x546 - e62: 2f ef ldi r18, 0xFF ; 255 - e64: 39 e6 ldi r19, 0x69 ; 105 - e66: 48 e1 ldi r20, 0x18 ; 24 - e68: 21 50 subi r18, 0x01 ; 1 - e6a: 30 40 sbci r19, 0x00 ; 0 - e6c: 40 40 sbci r20, 0x00 ; 0 - e6e: e1 f7 brne .-8 ; 0xe68 - e70: 00 c0 rjmp .+0 ; 0xe72 - e72: 00 00 nop + e6c: 6c db rcall .-2344 ; 0x546 + e6e: 8f ef ldi r24, 0xFF ; 255 + e70: 99 e6 ldi r25, 0x69 ; 105 + e72: a8 e1 ldi r26, 0x18 ; 24 + e74: 81 50 subi r24, 0x01 ; 1 + e76: 90 40 sbci r25, 0x00 ; 0 + e78: a0 40 sbci r26, 0x00 ; 0 + e7a: e1 f7 brne .-8 ; 0xe74 + e7c: 00 c0 rjmp .+0 ; 0xe7e + e7e: 00 00 nop _delay_ms(500); sei(); - e74: 78 94 sei + e80: 78 94 sei uint16_t loopcounter=0; // uart_puts("you selected the relative position demo modus:\n\r"); touchpad_set_rel_mode_100dpi();// use touchpad in relative mode - e76: 78 db rcall .-2320 ; 0x568 + e82: 72 db rcall .-2332 ; 0x568 // touchpad_set_rel_mode_200dpi(); // uncomment this line if you want double resolution int16_t x, y = 0; int8_t dx, dy = 0; uint8_t busy = 0, last_busy = 0; - e78: 10 e0 ldi r17, 0x00 ; 0 + e84: 10 e0 ldi r17, 0x00 ; 0 + e86: 01 c0 rjmp .+2 ; 0xe8a + } + } +} + +int main(void) +{ + e88: 18 2f mov r17, r24 + int8_t dx, dy = 0; + uint8_t busy = 0, last_busy = 0; while (1) { Usb2SerialTask(); - e7a: aa db rcall .-2220 ; 0x5d0 + e8a: a2 db rcall .-2236 ; 0x5d0 // loopcounter++; // if(loopcounter<2000) { // continue; // } // loopcounter=0; parse_command(); // read data from virtual comport - e7c: 2e de rcall .-932 ; 0xada + e8c: 2c de rcall .-936 ; 0xae6 + touchpad_read(); // read data from touchpad + e8e: 63 db rcall .-2362 ; 0x556 + + dx = -delta_x();// returns the amount your finger has moved in x direction since last readout + e90: 8f db rcall .-2274 ; 0x5b0 + e92: 08 2f mov r16, r24 + dy = -delta_y();// returns the amount your finger has moved in y direction since last readout + e94: 7d db rcall .-2310 ; 0x590 +// } +// loopcounter=0; + parse_command(); // read data from virtual comport touchpad_read(); // read data from touchpad - e7e: 6b db rcall .-2346 ; 0x556 - dx = delta_x();// returns the amount your finger has moved in x direction since last readout - e80: 97 db rcall .-2258 ; 0x5b0 - e82: 08 2f mov r16, r24 - dy = delta_y();// returns the amount your finger has moved in y direction since last readout - e84: 85 db rcall .-2294 ; 0x590 + dx = -delta_x();// returns the amount your finger has moved in x direction since last readout + e96: 01 95 neg r16 + dy = -delta_y();// returns the amount your finger has moved in y direction since last readout + + // increment/decrement some dummy variables with the + + plate_pos_x += dx; + e98: 40 2f mov r20, r16 + e9a: 55 27 eor r21, r21 + e9c: 47 fd sbrc r20, 7 + e9e: 50 95 com r21 + ea0: 20 91 4e 01 lds r18, 0x014E + ea4: 30 91 4f 01 lds r19, 0x014F + ea8: 24 0f add r18, r20 + eaa: 35 1f adc r19, r21 + eac: 30 93 4f 01 sts 0x014F, r19 + eb0: 20 93 4e 01 sts 0x014E, r18 +// loopcounter=0; + parse_command(); // read data from virtual comport + touchpad_read(); // read data from touchpad + + dx = -delta_x();// returns the amount your finger has moved in x direction since last readout + dy = -delta_y();// returns the amount your finger has moved in y direction since last readout + eb4: 81 95 neg r24 // increment/decrement some dummy variables with the plate_pos_x += dx; - e86: 40 2f mov r20, r16 - e88: 55 27 eor r21, r21 - e8a: 47 fd sbrc r20, 7 - e8c: 50 95 com r21 - e8e: 20 91 4e 01 lds r18, 0x014E - e92: 30 91 4f 01 lds r19, 0x014F - e96: 24 0f add r18, r20 - e98: 35 1f adc r19, r21 - e9a: 30 93 4f 01 sts 0x014F, r19 - e9e: 20 93 4e 01 sts 0x014E, r18 plate_pos_y += dy; - ea2: 68 2f mov r22, r24 - ea4: 77 27 eor r23, r23 - ea6: 67 fd sbrc r22, 7 - ea8: 70 95 com r23 - eaa: 80 91 50 01 lds r24, 0x0150 - eae: 90 91 51 01 lds r25, 0x0151 - eb2: 86 0f add r24, r22 - eb4: 97 1f adc r25, r23 - eb6: 90 93 51 01 sts 0x0151, r25 - eba: 80 93 50 01 sts 0x0150, r24 + eb6: 68 2f mov r22, r24 + eb8: 77 27 eor r23, r23 + eba: 67 fd sbrc r22, 7 + ebc: 70 95 com r23 + ebe: 80 91 50 01 lds r24, 0x0150 + ec2: 90 91 51 01 lds r25, 0x0151 + ec6: 86 0f add r24, r22 + ec8: 97 1f adc r25, r23 + eca: 90 93 51 01 sts 0x0151, r25 + ece: 80 93 50 01 sts 0x0150, r24 last_busy = busy; busy = move_plate(dx,dy); - ebe: ca 01 movw r24, r20 - ec0: 84 dd rcall .-1272 ; 0x9ca + ed2: ca 01 movw r24, r20 + ed4: 7a dd rcall .-1292 ; 0x9ca if (last_busy && !(busy)){ - ec2: 11 23 and r17, r17 - ec4: 29 f0 breq .+10 ; 0xed0 - ec6: 88 23 and r24, r24 - ec8: 19 f4 brne .+6 ; 0xed0 + ed6: 11 23 and r17, r17 + ed8: b9 f2 breq .-82 ; 0xe88 + eda: 88 23 and r24, r24 + edc: a9 f6 brne .-86 ; 0xe88 pos_report(); - eca: 89 83 std Y+1, r24 ; 0x01 - ecc: f3 dd rcall .-1050 ; 0xab4 - ece: 89 81 ldd r24, Y+1 ; 0x01 - ed0: 2f ef ldi r18, 0xFF ; 255 - ed2: 39 ef ldi r19, 0xF9 ; 249 - ed4: 40 e0 ldi r20, 0x00 ; 0 - ed6: 21 50 subi r18, 0x01 ; 1 - ed8: 30 40 sbci r19, 0x00 ; 0 - eda: 40 40 sbci r20, 0x00 ; 0 - edc: e1 f7 brne .-8 ; 0xed6 - ede: 00 c0 rjmp .+0 ; 0xee0 - ee0: 00 00 nop - plate_pos_x += dx; - plate_pos_y += dy; - - - last_busy = busy; - busy = move_plate(dx,dy); - ee2: 18 2f mov r17, r24 - ee4: ca cf rjmp .-108 ; 0xe7a + ede: 89 83 std Y+1, r24 ; 0x01 + ee0: ef dd rcall .-1058 ; 0xac0 + ee2: 89 81 ldd r24, Y+1 ; 0x01 + ee4: d1 cf rjmp .-94 ; 0xe88 00000ee6 : const uint8_t DescriptorNumber = (wValue & 0xFF); diff --git a/firmware/USBtoSerial.map b/firmware/USBtoSerial.map index aeb65e5..bda817c 100644 --- a/firmware/USBtoSerial.map +++ b/firmware/USBtoSerial.map @@ -748,19 +748,19 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr35/libgcc.a 0x0000000000000966 0x64 USBtoSerial.o 0x0000000000000966 motor_step .text.move_plate - 0x00000000000009ca 0x96 USBtoSerial.o + 0x00000000000009ca 0xa2 USBtoSerial.o 0x00000000000009ca move_plate .text.print_steps_in_mm - 0x0000000000000a60 0x54 USBtoSerial.o - 0x0000000000000a60 print_steps_in_mm + 0x0000000000000a6c 0x54 USBtoSerial.o + 0x0000000000000a6c print_steps_in_mm .text.pos_report - 0x0000000000000ab4 0x26 USBtoSerial.o - 0x0000000000000ab4 pos_report + 0x0000000000000ac0 0x26 USBtoSerial.o + 0x0000000000000ac0 pos_report .text.parse_command - 0x0000000000000ada 0x35e USBtoSerial.o - 0x0000000000000ada parse_command - .text.main 0x0000000000000e38 0xae USBtoSerial.o - 0x0000000000000e38 main + 0x0000000000000ae6 0x35e USBtoSerial.o + 0x0000000000000ae6 parse_command + .text.main 0x0000000000000e44 0xa2 USBtoSerial.o + 0x0000000000000e44 main .text.CALLBACK_USB_GetDescriptor 0x0000000000000ee6 0x5a Descriptors.o 0x0000000000000ee6 CALLBACK_USB_GetDescriptor @@ -1165,39 +1165,39 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr35/libgcc.a .debug_pubnames 0x0000000000000e69 0xd0 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o -.debug_info 0x0000000000000000 0x92a5 +.debug_info 0x0000000000000000 0x92a1 *(.debug_info) - .debug_info 0x0000000000000000 0x14e7 USBtoSerial.o - .debug_info 0x00000000000014e7 0x77d Descriptors.o - .debug_info 0x0000000000001c64 0x6f9 ../../LUFA/Drivers/USB/Class/Common/HIDParser.o - .debug_info 0x000000000000235d 0xd8 ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o - .debug_info 0x0000000000002435 0x154c ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o - .debug_info 0x0000000000003981 0x603 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o - .debug_info 0x0000000000003f84 0x6c ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o - .debug_info 0x0000000000003ff0 0x6c ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o - .debug_info 0x000000000000405c 0x6c ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o - .debug_info 0x00000000000040c8 0x412 ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o - .debug_info 0x00000000000044da 0x662 ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o - .debug_info 0x0000000000004b3c 0x38c ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o - .debug_info 0x0000000000004ec8 0x973 ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o - .debug_info 0x000000000000583b 0x85 ../../LUFA/Drivers/USB/Core/Events.o - .debug_info 0x00000000000058c0 0x6c ../../LUFA/Drivers/USB/Core/HostStandardReq.o - .debug_info 0x000000000000592c 0x245 ../../LUFA/Drivers/USB/Core/USBTask.o - .debug_info 0x0000000000005b71 0x56c ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o - .debug_info 0x00000000000060dd 0xc3b ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o - .debug_info 0x0000000000006d18 0x67a ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o - .debug_info 0x0000000000007392 0x7ca ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o - .debug_info 0x0000000000007b5c 0x4c1 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o - .debug_info 0x000000000000801d 0xebc ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o - .debug_info 0x0000000000008ed9 0x6c ../../LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.o - .debug_info 0x0000000000008f45 0x6c ../../LUFA/Drivers/USB/Class/Host/AudioClassHost.o - .debug_info 0x0000000000008fb1 0x6c ../../LUFA/Drivers/USB/Class/Host/CDCClassHost.o - .debug_info 0x000000000000901d 0x6c ../../LUFA/Drivers/USB/Class/Host/HIDClassHost.o - .debug_info 0x0000000000009089 0x6c ../../LUFA/Drivers/USB/Class/Host/MassStorageClassHost.o - .debug_info 0x00000000000090f5 0x6c ../../LUFA/Drivers/USB/Class/Host/MIDIClassHost.o - .debug_info 0x0000000000009161 0x6c ../../LUFA/Drivers/USB/Class/Host/PrinterClassHost.o - .debug_info 0x00000000000091cd 0x6c ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o - .debug_info 0x0000000000009239 0x6c ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o + .debug_info 0x0000000000000000 0x14e3 USBtoSerial.o + .debug_info 0x00000000000014e3 0x77d Descriptors.o + .debug_info 0x0000000000001c60 0x6f9 ../../LUFA/Drivers/USB/Class/Common/HIDParser.o + .debug_info 0x0000000000002359 0xd8 ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o + .debug_info 0x0000000000002431 0x154c ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o + .debug_info 0x000000000000397d 0x603 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o + .debug_info 0x0000000000003f80 0x6c ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o + .debug_info 0x0000000000003fec 0x6c ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o + .debug_info 0x0000000000004058 0x6c ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o + .debug_info 0x00000000000040c4 0x412 ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o + .debug_info 0x00000000000044d6 0x662 ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o + .debug_info 0x0000000000004b38 0x38c ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o + .debug_info 0x0000000000004ec4 0x973 ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o + .debug_info 0x0000000000005837 0x85 ../../LUFA/Drivers/USB/Core/Events.o + .debug_info 0x00000000000058bc 0x6c ../../LUFA/Drivers/USB/Core/HostStandardReq.o + .debug_info 0x0000000000005928 0x245 ../../LUFA/Drivers/USB/Core/USBTask.o + .debug_info 0x0000000000005b6d 0x56c ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o + .debug_info 0x00000000000060d9 0xc3b ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o + .debug_info 0x0000000000006d14 0x67a ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o + .debug_info 0x000000000000738e 0x7ca ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o + .debug_info 0x0000000000007b58 0x4c1 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o + .debug_info 0x0000000000008019 0xebc ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o + .debug_info 0x0000000000008ed5 0x6c ../../LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.o + .debug_info 0x0000000000008f41 0x6c ../../LUFA/Drivers/USB/Class/Host/AudioClassHost.o + .debug_info 0x0000000000008fad 0x6c ../../LUFA/Drivers/USB/Class/Host/CDCClassHost.o + .debug_info 0x0000000000009019 0x6c ../../LUFA/Drivers/USB/Class/Host/HIDClassHost.o + .debug_info 0x0000000000009085 0x6c ../../LUFA/Drivers/USB/Class/Host/MassStorageClassHost.o + .debug_info 0x00000000000090f1 0x6c ../../LUFA/Drivers/USB/Class/Host/MIDIClassHost.o + .debug_info 0x000000000000915d 0x6c ../../LUFA/Drivers/USB/Class/Host/PrinterClassHost.o + .debug_info 0x00000000000091c9 0x6c ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o + .debug_info 0x0000000000009235 0x6c ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o *(.gnu.linkonce.wi.*) .debug_abbrev 0x0000000000000000 0x220b @@ -1234,39 +1234,39 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr35/libgcc.a .debug_abbrev 0x00000000000021b7 0x2a ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o .debug_abbrev 0x00000000000021e1 0x2a ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o -.debug_line 0x0000000000000000 0x7bdc +.debug_line 0x0000000000000000 0x7bee *(.debug_line) - .debug_line 0x0000000000000000 0x15f9 USBtoSerial.o - .debug_line 0x00000000000015f9 0x1d9 Descriptors.o - .debug_line 0x00000000000017d2 0x762 ../../LUFA/Drivers/USB/Class/Common/HIDParser.o - .debug_line 0x0000000000001f34 0x15f ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o - .debug_line 0x0000000000002093 0x1a80 ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o - .debug_line 0x0000000000003b13 0x5a1 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o - .debug_line 0x00000000000040b4 0x3e ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o - .debug_line 0x00000000000040f2 0x3e ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o - .debug_line 0x0000000000004130 0x3e ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o - .debug_line 0x000000000000416e 0x312 ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o - .debug_line 0x0000000000004480 0x55a ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o - .debug_line 0x00000000000049da 0x269 ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o - .debug_line 0x0000000000004c43 0x5a2 ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o - .debug_line 0x00000000000051e5 0x80 ../../LUFA/Drivers/USB/Core/Events.o - .debug_line 0x0000000000005265 0x3e ../../LUFA/Drivers/USB/Core/HostStandardReq.o - .debug_line 0x00000000000052a3 0x1ae ../../LUFA/Drivers/USB/Core/USBTask.o - .debug_line 0x0000000000005451 0x4be ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o - .debug_line 0x000000000000590f 0x9c2 ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o - .debug_line 0x00000000000062d1 0x5c3 ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o - .debug_line 0x0000000000006894 0x5c6 ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o - .debug_line 0x0000000000006e5a 0x3bc ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o - .debug_line 0x0000000000007216 0x798 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o - .debug_line 0x00000000000079ae 0x3e ../../LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.o - .debug_line 0x00000000000079ec 0x3e ../../LUFA/Drivers/USB/Class/Host/AudioClassHost.o - .debug_line 0x0000000000007a2a 0x3e ../../LUFA/Drivers/USB/Class/Host/CDCClassHost.o - .debug_line 0x0000000000007a68 0x3e ../../LUFA/Drivers/USB/Class/Host/HIDClassHost.o - .debug_line 0x0000000000007aa6 0x3e ../../LUFA/Drivers/USB/Class/Host/MassStorageClassHost.o - .debug_line 0x0000000000007ae4 0x3e ../../LUFA/Drivers/USB/Class/Host/MIDIClassHost.o - .debug_line 0x0000000000007b22 0x3e ../../LUFA/Drivers/USB/Class/Host/PrinterClassHost.o - .debug_line 0x0000000000007b60 0x3e ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o - .debug_line 0x0000000000007b9e 0x3e ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o + .debug_line 0x0000000000000000 0x160b USBtoSerial.o + .debug_line 0x000000000000160b 0x1d9 Descriptors.o + .debug_line 0x00000000000017e4 0x762 ../../LUFA/Drivers/USB/Class/Common/HIDParser.o + .debug_line 0x0000000000001f46 0x15f ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o + .debug_line 0x00000000000020a5 0x1a80 ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o + .debug_line 0x0000000000003b25 0x5a1 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o + .debug_line 0x00000000000040c6 0x3e ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o + .debug_line 0x0000000000004104 0x3e ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o + .debug_line 0x0000000000004142 0x3e ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o + .debug_line 0x0000000000004180 0x312 ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o + .debug_line 0x0000000000004492 0x55a ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o + .debug_line 0x00000000000049ec 0x269 ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o + .debug_line 0x0000000000004c55 0x5a2 ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o + .debug_line 0x00000000000051f7 0x80 ../../LUFA/Drivers/USB/Core/Events.o + .debug_line 0x0000000000005277 0x3e ../../LUFA/Drivers/USB/Core/HostStandardReq.o + .debug_line 0x00000000000052b5 0x1ae ../../LUFA/Drivers/USB/Core/USBTask.o + .debug_line 0x0000000000005463 0x4be ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o + .debug_line 0x0000000000005921 0x9c2 ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o + .debug_line 0x00000000000062e3 0x5c3 ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o + .debug_line 0x00000000000068a6 0x5c6 ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o + .debug_line 0x0000000000006e6c 0x3bc ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o + .debug_line 0x0000000000007228 0x798 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o + .debug_line 0x00000000000079c0 0x3e ../../LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.o + .debug_line 0x00000000000079fe 0x3e ../../LUFA/Drivers/USB/Class/Host/AudioClassHost.o + .debug_line 0x0000000000007a3c 0x3e ../../LUFA/Drivers/USB/Class/Host/CDCClassHost.o + .debug_line 0x0000000000007a7a 0x3e ../../LUFA/Drivers/USB/Class/Host/HIDClassHost.o + .debug_line 0x0000000000007ab8 0x3e ../../LUFA/Drivers/USB/Class/Host/MassStorageClassHost.o + .debug_line 0x0000000000007af6 0x3e ../../LUFA/Drivers/USB/Class/Host/MIDIClassHost.o + .debug_line 0x0000000000007b34 0x3e ../../LUFA/Drivers/USB/Class/Host/PrinterClassHost.o + .debug_line 0x0000000000007b72 0x3e ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o + .debug_line 0x0000000000007bb0 0x3e ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o .debug_frame 0x0000000000000000 0x900 *(.debug_frame) @@ -1289,88 +1289,88 @@ LOAD /usr/lib/gcc/avr/4.5.3/avr35/libgcc.a .debug_frame 0x0000000000000830 0x60 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o .debug_frame 0x0000000000000890 0x70 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o -.debug_str 0x0000000000000000 0x3d96 +.debug_str 0x0000000000000000 0x3d74 *(.debug_str) - .debug_str 0x0000000000000000 0xad8 USBtoSerial.o - 0xb90 (size before relaxing) - .debug_str 0x0000000000000ad8 0x8ba Descriptors.o - 0xa07 (size before relaxing) - .debug_str 0x0000000000001392 0x47c ../../LUFA/Drivers/USB/Class/Common/HIDParser.o - 0x5e7 (size before relaxing) - .debug_str 0x000000000000180e 0x77 ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o - 0x14a (size before relaxing) - .debug_str 0x0000000000001885 0x592 ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o - 0x760 (size before relaxing) - .debug_str 0x0000000000001e17 0x212 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o - 0x55c (size before relaxing) - .debug_str 0x0000000000002029 0x2d ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o - 0xf2 (size before relaxing) - .debug_str 0x0000000000002056 0x33 ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o - 0xf8 (size before relaxing) - .debug_str 0x0000000000002089 0x2d ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o - 0xf2 (size before relaxing) - .debug_str 0x00000000000020b6 0x209 ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o - 0x41b (size before relaxing) - .debug_str 0x00000000000022bf 0x113 ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o - 0x41d (size before relaxing) - .debug_str 0x00000000000023d2 0x227 ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o - 0x332 (size before relaxing) - .debug_str 0x00000000000025f9 0x3b2 ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o - 0x850 (size before relaxing) - .debug_str 0x00000000000029ab 0x34 ../../LUFA/Drivers/USB/Core/Events.o - 0xf9 (size before relaxing) - .debug_str 0x00000000000029df 0x2e ../../LUFA/Drivers/USB/Core/HostStandardReq.o - 0xf3 (size before relaxing) - .debug_str 0x0000000000002a0d 0x4e ../../LUFA/Drivers/USB/Core/USBTask.o - 0x2a0 (size before relaxing) - .debug_str 0x0000000000002a5b 0x239 ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o - 0x520 (size before relaxing) - .debug_str 0x0000000000002c94 0x2fa ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o - 0x8d4 (size before relaxing) - .debug_str 0x0000000000002f8e 0x1ed ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o - 0x54f (size before relaxing) - .debug_str 0x000000000000317b 0x23d ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o - 0x6b0 (size before relaxing) - .debug_str 0x00000000000033b8 0x118 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o - 0x537 (size before relaxing) - .debug_str 0x00000000000034d0 0x6e8 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o - 0xbe8 (size before relaxing) - .debug_str 0x0000000000003bb8 0x3e ../../LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.o - 0x103 (size before relaxing) - .debug_str 0x0000000000003bf6 0x33 ../../LUFA/Drivers/USB/Class/Host/AudioClassHost.o - 0xf8 (size before relaxing) - .debug_str 0x0000000000003c29 0x31 ../../LUFA/Drivers/USB/Class/Host/CDCClassHost.o - 0xf6 (size before relaxing) - .debug_str 0x0000000000003c5a 0x31 ../../LUFA/Drivers/USB/Class/Host/HIDClassHost.o - 0xf6 (size before relaxing) - .debug_str 0x0000000000003c8b 0x39 ../../LUFA/Drivers/USB/Class/Host/MassStorageClassHost.o - 0xfe (size before relaxing) - .debug_str 0x0000000000003cc4 0x32 ../../LUFA/Drivers/USB/Class/Host/MIDIClassHost.o - 0xf7 (size before relaxing) - .debug_str 0x0000000000003cf6 0x35 ../../LUFA/Drivers/USB/Class/Host/PrinterClassHost.o - 0xfa (size before relaxing) - .debug_str 0x0000000000003d2b 0x33 ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o - 0xf8 (size before relaxing) - .debug_str 0x0000000000003d5e 0x38 ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o - 0xfd (size before relaxing) - -.debug_loc 0x0000000000000000 0x4b07 + .debug_str 0x0000000000000000 0xab6 USBtoSerial.o + 0xb6e (size before relaxing) + .debug_str 0x0000000000000ab6 0x8ba Descriptors.o + 0x9e5 (size before relaxing) + .debug_str 0x0000000000001370 0x47c ../../LUFA/Drivers/USB/Class/Common/HIDParser.o + 0x5c5 (size before relaxing) + .debug_str 0x00000000000017ec 0x77 ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o + 0x128 (size before relaxing) + .debug_str 0x0000000000001863 0x592 ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o + 0x73e (size before relaxing) + .debug_str 0x0000000000001df5 0x212 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o + 0x53a (size before relaxing) + .debug_str 0x0000000000002007 0x2d ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o + 0xd0 (size before relaxing) + .debug_str 0x0000000000002034 0x33 ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o + 0xd6 (size before relaxing) + .debug_str 0x0000000000002067 0x2d ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o + 0xd0 (size before relaxing) + .debug_str 0x0000000000002094 0x209 ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o + 0x3f9 (size before relaxing) + .debug_str 0x000000000000229d 0x113 ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o + 0x3fb (size before relaxing) + .debug_str 0x00000000000023b0 0x227 ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o + 0x310 (size before relaxing) + .debug_str 0x00000000000025d7 0x3b2 ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o + 0x82e (size before relaxing) + .debug_str 0x0000000000002989 0x34 ../../LUFA/Drivers/USB/Core/Events.o + 0xd7 (size before relaxing) + .debug_str 0x00000000000029bd 0x2e ../../LUFA/Drivers/USB/Core/HostStandardReq.o + 0xd1 (size before relaxing) + .debug_str 0x00000000000029eb 0x4e ../../LUFA/Drivers/USB/Core/USBTask.o + 0x27e (size before relaxing) + .debug_str 0x0000000000002a39 0x239 ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o + 0x4fe (size before relaxing) + .debug_str 0x0000000000002c72 0x2fa ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o + 0x8b2 (size before relaxing) + .debug_str 0x0000000000002f6c 0x1ed ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o + 0x52d (size before relaxing) + .debug_str 0x0000000000003159 0x23d ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o + 0x68e (size before relaxing) + .debug_str 0x0000000000003396 0x118 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o + 0x515 (size before relaxing) + .debug_str 0x00000000000034ae 0x6e8 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o + 0xbc6 (size before relaxing) + .debug_str 0x0000000000003b96 0x3e ../../LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.o + 0xe1 (size before relaxing) + .debug_str 0x0000000000003bd4 0x33 ../../LUFA/Drivers/USB/Class/Host/AudioClassHost.o + 0xd6 (size before relaxing) + .debug_str 0x0000000000003c07 0x31 ../../LUFA/Drivers/USB/Class/Host/CDCClassHost.o + 0xd4 (size before relaxing) + .debug_str 0x0000000000003c38 0x31 ../../LUFA/Drivers/USB/Class/Host/HIDClassHost.o + 0xd4 (size before relaxing) + .debug_str 0x0000000000003c69 0x39 ../../LUFA/Drivers/USB/Class/Host/MassStorageClassHost.o + 0xdc (size before relaxing) + .debug_str 0x0000000000003ca2 0x32 ../../LUFA/Drivers/USB/Class/Host/MIDIClassHost.o + 0xd5 (size before relaxing) + .debug_str 0x0000000000003cd4 0x35 ../../LUFA/Drivers/USB/Class/Host/PrinterClassHost.o + 0xd8 (size before relaxing) + .debug_str 0x0000000000003d09 0x33 ../../LUFA/Drivers/USB/Class/Host/RNDISClassHost.o + 0xd6 (size before relaxing) + .debug_str 0x0000000000003d3c 0x38 ../../LUFA/Drivers/USB/Class/Host/StillImageClassHost.o + 0xdb (size before relaxing) + +.debug_loc 0x0000000000000000 0x4b3c *(.debug_loc) - .debug_loc 0x0000000000000000 0xa6b USBtoSerial.o - .debug_loc 0x0000000000000a6b 0xd3 Descriptors.o - .debug_loc 0x0000000000000b3e 0x88f ../../LUFA/Drivers/USB/Class/Common/HIDParser.o - .debug_loc 0x00000000000013cd 0x1982 ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o - .debug_loc 0x0000000000002d4f 0x390 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o - .debug_loc 0x00000000000030df 0x190 ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o - .debug_loc 0x000000000000326f 0x2bc ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o - .debug_loc 0x000000000000352b 0x22a ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o - .debug_loc 0x0000000000003755 0x27 ../../LUFA/Drivers/USB/Core/USBTask.o - .debug_loc 0x000000000000377c 0x16d ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o - .debug_loc 0x00000000000038e9 0x52b ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o - .debug_loc 0x0000000000003e14 0x249 ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o - .debug_loc 0x000000000000405d 0x152 ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o - .debug_loc 0x00000000000041af 0x1f6 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o - .debug_loc 0x00000000000043a5 0x762 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o + .debug_loc 0x0000000000000000 0xaa0 USBtoSerial.o + .debug_loc 0x0000000000000aa0 0xd3 Descriptors.o + .debug_loc 0x0000000000000b73 0x88f ../../LUFA/Drivers/USB/Class/Common/HIDParser.o + .debug_loc 0x0000000000001402 0x1982 ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o + .debug_loc 0x0000000000002d84 0x390 ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o + .debug_loc 0x0000000000003114 0x190 ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o + .debug_loc 0x00000000000032a4 0x2bc ../../LUFA/Drivers/USB/Core/ConfigDescriptors.o + .debug_loc 0x0000000000003560 0x22a ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o + .debug_loc 0x000000000000378a 0x27 ../../LUFA/Drivers/USB/Core/USBTask.o + .debug_loc 0x00000000000037b1 0x16d ../../LUFA/Drivers/USB/Class/Device/AudioClassDevice.o + .debug_loc 0x000000000000391e 0x52b ../../LUFA/Drivers/USB/Class/Device/CDCClassDevice.o + .debug_loc 0x0000000000003e49 0x249 ../../LUFA/Drivers/USB/Class/Device/HIDClassDevice.o + .debug_loc 0x0000000000004092 0x152 ../../LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.o + .debug_loc 0x00000000000041e4 0x1f6 ../../LUFA/Drivers/USB/Class/Device/MIDIClassDevice.o + .debug_loc 0x00000000000043da 0x762 ../../LUFA/Drivers/USB/Class/Device/RNDISClassDevice.o .debug_macinfo *(.debug_macinfo) diff --git a/firmware/USBtoSerial.o b/firmware/USBtoSerial.o index 09e575e..04d74d5 100644 Binary files a/firmware/USBtoSerial.o and b/firmware/USBtoSerial.o differ diff --git a/firmware/USBtoSerial.sym b/firmware/USBtoSerial.sym index ebc5891..55ee5ca 100644 --- a/firmware/USBtoSerial.sym +++ b/firmware/USBtoSerial.sym @@ -275,10 +275,10 @@ 0000094c T init_motors 00000966 T motor_step 000009ca T move_plate -00000a60 T print_steps_in_mm -00000ab4 T pos_report -00000ada T parse_command -00000e38 T main +00000a6c T print_steps_in_mm +00000ac0 T pos_report +00000ae6 T parse_command +00000e44 T main 00000ee6 T CALLBACK_USB_GetDescriptor 00000f40 T Endpoint_Write_Control_Stream_LE 00000ff4 T Endpoint_Write_Control_PStream_LE diff --git a/firmware/leds.c b/firmware/leds.c new file mode 100644 index 0000000..ef20540 --- /dev/null +++ b/firmware/leds.c @@ -0,0 +1,45 @@ + +void init_leds(void) { + DDRLED0 |= 1<>SW0; +} + +uint8_t sw1_state(void){ + return (PINSW1 & (1<>SW1; +} + +uint8_t sw2_state(void){ + return (PINSW2 & (1<>SW2; +} \ No newline at end of file diff --git a/firmware/leds.c~ b/firmware/leds.c~ new file mode 100644 index 0000000..ef20540 --- /dev/null +++ b/firmware/leds.c~ @@ -0,0 +1,45 @@ + +void init_leds(void) { + DDRLED0 |= 1<>SW0; +} + +uint8_t sw1_state(void){ + return (PINSW1 & (1<>SW1; +} + +uint8_t sw2_state(void){ + return (PINSW2 & (1<>SW2; +} \ No newline at end of file diff --git a/firmware/pins.h~ b/firmware/pins.h~ index a1c5389..5f199ad 100644 --- a/firmware/pins.h~ +++ b/firmware/pins.h~ @@ -35,10 +35,51 @@ #define PORTY2 PORTC #define PINY2 PINC -#define Y3 6 -#define DDRY3 DDRC -#define PORTY3 PORTC -#define PINY3 PINC +#define Y3 4 +#define DDRY3 DDRD +#define PORTY3 PORTD +#define PINY3 PIND + + + + +#define SW0 4 +#define DDRSW0 DDRD +#define PORTSW0 PORTD +#define PINSW0 PIND + +#define SW1 5 +#define DDRSW1 DDRC +#define PORTSW1 PORTC +#define PINSW1 PINC + +#define SW2 4 +#define DDRSW2 DDRC +#define PORTSW2 PORTC +#define PINSW2 PINC + + + + +#define LED0 1 +#define DDRLED0 DDRB +#define PORTLED0 PORTB +#define PINLED0 PINB + +#define LED1 0 +#define DDRLED1 DDRB +#define PORTLED1 PORTB +#define PINLED1 PINB + +#define LED2 6 +#define DDRLED2 DDRD +#define PORTLED2 PORTD +#define PINLED2 PIND + + + + + #define X 0 #define Y 1